An Object-Oriented Class Organization for Global-Local Generalized Finite Element Method 1

This paper shows and discusses a generic implementation of the global-local analysis toward generalized finite element method (GFEMgl). This implementation, performed into an academic computational platform, follows the object-oriented approach presented by the authors in a previous work for the standard version of GFEM in which the shape functions of finite elements are hierarchically enriched by analytical functions, according to the problem behavior. In global-local GFEM, however, the enrichment functions are constructed numerically from the solution of a local problem. This strategy allows the use of a coarse mesh even when the problem produces complex stress distributions. On the other hand, a local problem is defined where the stress field presents high gradients and it is discretized using a large number of elements. The results of the local problem are used to enrich the global problem which improves the approximate solution. The great advantage is allowing a well-refined description of the local problem, when necessary, avoiding an overburden for the computation of the global solution. Details of the implementation are presented and important aspects of using this strategy are highlighted in the numerical examples.

Latin American Journal of Solids and Structures 13 (2016) 2529-2551 and similar fields.In generalized finite element method (GFEM), Melenk and Babuška (1996), Strouboulis et al. (2000a), Duarte et al. (2000), Strouboulis et al. (2001), as in FEM, the approximation is built over a mesh of elements using interpolation functions.However, the approximation is associated with nodal points as in the Meshless methods, and it is enriched in the same fashion as in the hp-cloud method, Duarte et el. (1995), Duarte (1996), Liszka et al. (1996), Oden et al. (1998).Special functions multiply the original FEM functions and smooth and non-smooth solutions can be modeled independently of the mesh.The enrichment strategy of GFEM is similar to the one used in the extended finite element method (XFEM), introduced in Belytschko and Black (1999).
Global-local FEM was proposed by Noor (1986) in order to solve non-linear problems.This method was presented after proposing zooming method by Hirai et al. (1985).A local problem is defined where a local phenomenon happens.The global-local FEM approach has two steps.The first step is done with a coarse FEM mesh that ignores the effect of the local phenomena.This is followed by the second step which includes an analysis of the local region using refined finite element meshes.The key parameter for the local analyses is the application of field state variables as boundary conditions on the local boundaries.Once the solution of local problem is obtained, the globallocal FEM analysis can be finished.In global-local GFEM (GFEM gl ), Duarte et al. (2007), a variation of the standard GFEM, enrichment functions are constructed numerically from the solution of a local problem.GFEM gl approach has three steps, its first and second steps are the same as the global-local FEM.In the third step, the results of the local problem are used to enrich the global problem which improves the approximate solution.In the case of fracture mechanic problems, the stress field around the crack tip presents high gradients and it is discretized using a large number of elements.The great advantage is providing a well-refined description of the local problem.More information on global-local GFEM, considering its various aspects can be found in Duarte and Kim (2008), Kim et al. (2008), Kim et al. (2009), Kim et al. (2010), Pereira et al. (2011), Gupta et al. (2012), Kim et al. (2012), Gupta et al. (2013), Evangelista et al. (2013), Plews and Duarte (2015).
According to Alves et al. (2013), the similarity between GFEM/XFEM and FEM can allow a straightforward migration for these methods and also the reuse of the FEM structure.This migration and code reuse depend on how the FEM code is implemented, and a successful strategy is the object-oriented approach.Following such strategy several implementations have been proposed, Strouboulis et al. (2000a), Strouboulis et al. (2001), Bordas et al. (2007), Dunant et al. (2007), Nistor et al. (2008), Chamrová and Patzák (2010), Neto et al. (2013).In Alves et al. (2013), the FEM programming environment proposed by Fonseca and Pitangueira (2007) is expanded to enclose the standard version of GFEM.This environment, so called INSANE (Interactive Structural Analysis Environment) is an open source software available at http://www.insane.dees.ufmg.brand written in Java language.In the present paper, a new expansion that includes the GFEM gl is presented.The implementation, conducted through the development of comprehensive object-oriented design, allows generalization of the global-local approach in such way that any types of partition of unity methods, analysis model and enrichment strategy can be combined.It also allows that stress and strain field can be applied as boundary conditions for local problems in addition to the capability of applying displacement boundary condition.Details of the implementation are discussed and important aspects of using these strategies are highlighted in numerical examples.This work is organized as follows: A brief explanation of GFEM is presented in section 2. In section 3, main ideas and Latin American Journal of Solids and Structures 13 (2016) 2529-2551 formulations of global-local GFEM is presented.The INSANE class organization and its expansion to include GFEM gl method are discussed in section 4. In the section 5, numerical examples are presented, and final section is devoted to concluding remarks and discussion.

THE GENERALIZED FINITE ELEMENT METHOD
A brief explanation of GFEM is described in this section.Further details can be found in Melenk and Babuška (1995), Babuška and Melenk (1997), Oden et al. (1998), Duarte et al. (2000), Strouboulis et al. (2001), Pereira et al. (2011).The GFEM was developed for modeling structural problems with discontinuities.The origins of this method can be summarized as: • Research done by Babuška and co-workers -initially named as special finite element method by Babuška et al. (1994) and later as partition of unity method (PUM) by Melenk and Babuška (1996).
• Then, as a meshless formulation in the hp-cloud method, Duarte et al. (1995), and later as a hybrid approach with the FEM, Oden et al. (1998).
Furthermore, it can be considered an instance of the PUM, in the sense that it employs a set of PU functions to guarantee interelement continuity.Such strategy creates conforming approximations which are improved by a nodal enrichment scheme.This basic idea shares the same characteristics from XFEM proposed by Belytschko and Black (1999), as it is observed in Fries and Belytschko (2010).
Here this procedure is summarized following Barros et al. (2004Barros et al. ( , 2013) ) and considering twodimensional space.A conventional finite elements mesh can be considered for which is a set of NE elements, defined by N nodes, .
A generic patch of elements or cloud j w Î W is obtained by the union of finite elements sharing the vertex node j x , Fig. 1(a).The assemblage of the interpolation functions, built at each element constitutes a partition of unity (PU).A set of q linearly independent functions is defined at each cloud j w as: The generalized finite element shape functions are determined by the enrichment of the PU functions, which is obtained by the product of such functions by each one of the components of the set j I at the generic cloud j w : The enrichment scheme is obtained by multiplying a PU function of C 0 type with compact support j w , Fig. 1 As a consequence, the generalized global approximation, denoted by ( ) u  x , can be described as a linear combination of the shape functions associated with each node: where j u and ji b are nodal parameters associated with standard -( ) x -shape functions, respectively.Aiming to minimize round-off errors, Duarte et al. (2000) suggest that a transformation should be performed over the ( ) ji L x functions, if they are of polynomial type.In such case, the coordinate x is replaced as follows: in which j h is the diameter of the largest finite element sharing the node j, the cloud j w .

GLOBAL-LOCAL GENERALIZED FINITE ELEMENT METHOD
This method, originally proposed by Duarte and Babuška (2005), combines the standard GFEM with the global-local strategy proposed by Noor (1986).GFEM gl is suitable for problems with local phenomena, such as stress field next to the crack tip.The analysis is divided in three steps: initial global problem (step 1), local problem (step 2) and final global problem (step 3).These steps are described in the following sub-sections.

Initial Global Problem (Step 1)
Following Kim et al. (2010), consider a domain , where indices u and s refer to the Dirichlet and Neumann boundary conditions. 00 ( ) (built by FEM or GFEM functions) for the initial global problem in its weak form, shown in: where , and t are stress tensor, strain tensor, test functions, and prescribed traction vector, respectively.

Local Problem (Step 2)
L W is a sub-domain from G W .This sub-domain may contain cracks, holes or other special features, as suggested by Duarte and Kim (2008).The corresponding local solution ( ) .
where ( ) is the space generated by FEM or GFEM functions, h is the penalty parameter and k is the stiffness parameter both used to impose Dirichlet and Cauchy boundary conditions, respectively.Additionally, t is the prescribed traction, is the part of the local problem boundary that doesn't coincide with the global problem boundary and on which the numerical solution that comes from the step 1 is imposed as boundary condition.The last integrals on the left and right side of Eq. ( 6) correspond to the Cauchy or spring boundary condition, imposing the displacements as well as the stress calculated in the global problem.The ( ) space can be defined as: Latin American Journal of Solids and Structures 13 (2016) 2529-2551   1 ( )  u x are continuous, discontinuous and singular components of the approximate solution and j N is the partition of unity function used in global problem.The number of nodes of the local domain is given by L N .

Final Global Problem (Step 3)
The global problem is enriched by solution L u (from step 2).The new solution ( ) obtained from: where E G v represents the test functions and is the initial space increased by ( ) Figure 2 illustrates a simplified global-local strategy.First the initial global problem is solved using a coarse mesh.After defining the local domain, the results of the initial global problem is transferred as a boundary condition to the local problem.Finally, the solutions of the local problem are transferred to the final global problem as a numeric enrichment function in order to enrich the predefined nodes of the global problem.

INTERACTIVE STRUCTURAL ANALYSIS ENVIRONMENT
The INSANE environment, Fonseca and Pitangueira (2007), Alves et al. (2013), is an open source software implemented in Java, an OOP language.The INSANE computational environment is composed by three great applications: pre-processor, processor and postprocessor.The persistence of data among these three segments of INSANE is performed by data files written in extensible markup language format.Here, a summary of several modules of the numerical core application (the processor) are presented aiming to introduce the INSANE system, corresponding to the standard FEM/GFEM approach, and also to show the generalization performed here to enclose the GFEM gl formulation.More information can be found in Alves et al. (2013).The observation strategy is determined by the observer-observable design pattern, which is a change propagation mechanism.When an object of type observer (which implements the interface java.util.observer) is instantiated, it is added to a list of observers of other objects of type observables (which extends the class java.util.observable).Any modification in the state of an observed object notifies the corresponding observer object that updated itself.
Detailed of GFEM implementation can be found in Alves et al. (2013), section 4. Here, the focus is on the main modifications in order to expand the computational system to comprise GFEM gl .Following sub-sections explain various INSANE classes and approaches in order to perform GFEM analysis as well as GFEM gl analysis.

Persistence Interface
Persistence treats the input data and persists the output data.For GFEM gl , this class was extended to deal with more than one model.In that case, the data is separated in a global model and several local models, corresponding to the global and the several local problems respectively.

Assembler Interface
Assembler interface is responsible for assembling the linear equation system provided by the discretization of the initial value problem.This class is implemented following the generic representation: where X is the solution vector; the single dot represent its first time derivative and the double dots its second time derivative; A, B and C are matrices with the properties of the problem and D is a vector that represents the system excitation.
The Assembler interface has the necessary methods for assembling the matrix system.It is implemented by an object of the class GFemAssembler that was modified in order to transfer boundary condition from the global model to the several local models.A Cauchy boundary condition was implemented following Kim et al. (2010) (here represented by Eq. ( 6)).In static analysis, Eq. ( 10) is simplified by eliminating the two first terms.The resulting matrix system is: where Eq. ( 11) is used to represent each step of the global-local solution given by Eqs. ( 5), (6), and (8).In these equations, the matrix C is the model stiffness matrix, X is the vector of nodal displacements, D is the vector of forces.

Solution
Solution abstract class starts the solution process and has the necessary resources for solving the matrix system.GFEM gl process is implemented by GlobalLocal class, as shown in Fig. 4. Since GFEM gl is composed by more than one model (one global model and several local models), the problem has more than one assembler, each one responsible to build the corresponding equation in the form of ( 11).This is the main difference from standard GFEM solution class.Figure 4 shows in details the UML diagram for this class.The main attributes of this class are: − globalPath: contains the path of the file responsible for storing the global model description.
− solverType: contains information about the type of solver of the linear equation system.
− leq: LinearEquationSystem object which is responsible to solve the linear equation system.
− loadCombination: load combination of the problem.
− globalAssembler: handles information about the global model.
− localAssemblerList: list of Assembler objects that handles information about the several local models.
− globalEnrichedNodes: handles the pointer to the global nodes that will be enriched by globallocal enrichment.− localPath: contains the list of paths of each file responsible for storing each local model description.

Model Interface
The Model interface contains the data of the discrete model and provides to Assembler information to assemble the final matrix system.Both Model and Solution communicate with the Persistence interface, which treats the input data and persists the output data to the other applications, whenever it observes a modification of the discrete model state.This interface consisted of the following classes:

Node
This class is designed to manage the geometric representation of a node entity as well as the information from the discrete model.In addition to information about the node coordinates, this class holds lists of identifiers such as type of degrees of freedom, state variables and type of nodal constraint.This list of identifiers are based on HashMap strategy provided by JAVA API Collection Horstmann and Cornell (2008).This type of Java storing strategy allows an indirect communication between variables associated to the Node, named keys, and the variables stored in the Model.In spite of degrading performance of the framework, such strategy creates a generic and friendly implementation because it simplifies how new information is added to the class.Furthermore, methods from JAVA API Collection allows using the keys like conventional attributes which preserves the readability of the code."LOCAL_ENRICHER" is added in order to indicate which local domain will provide the global-local enrichment function, as shown in Fig. 5.This new attribute is defined in the Node class as an instance of GFEM using the enrichment strategy.

Element
In Alves et al. (2013), this class was not modified for standard GFEM.On the other hand, the special characteristics of GFEM gl , such as the relationship between the global and the local elements, requires a new extension of the Element class.Note that this new GFemElement class is not only derived from the superclass Element but also contains on object of Element type, Fig. 6.Indeed this strategy takes advantage of parametric element library, with bar, triangular, quadrilateral, tetrahedral and hexahedral elements, without having to use simple inheritance from each one of those types of elements.Figure 7 shows the new parameters added in GFemElement class in order to add the ability to solve problems using the global-local scheme.Similar to the Node class, the HashMap strategy is used to include new parameters.The parameters of this class are:

EnrichmentType
GlobalLocalEnrichment extends EnrichmentType and provides specific methods to build the enriched functions from the solution of the local problem and applied in the third step of the globallocal problem. Figure 8 shows the class diagram of this class.EnrichmentType is an abstract class and its methods are abstract.Thus, GlobalLocalEnrichment class contains the same method as the EnrichmentType class.

Problem Driver
Informs to Assembler all the necessary data for assembling the final system of the model, Eq. ( 11).For GFEM gl case, an additional loop is performed using descendants of each global element, since they play the role of cells of integration.Actually, information of each descendants will be used to enriching corresponding global element based on relationship between step 2 and step 3 of globallocal strategy.

Generic Boundary Condition
Figure 10 shows the relationship between the types of objects found in the package Value, which is used to define a generic boundary condition of the problem (e.g., conditions of Dirichlet, Neumann or Cauchy required by Eq. ( 6)).The definition of these boundary conditions in different geometric entities is performed through an ElementValue object, which is derived for the specific types Ele-mentVolumeValue (boundary conditions applied in a volume), ElementAreaValue (boundary conditions applied to a area) and ElementLineValue (boundary conditions imposed on a line).Ele-mentValue consists of the following attributes: − An array of objects of type PointValue, responsible for storing the coordinates of a point and information that defines the boundary condition at this point.
− An object of type Shape, responsible for the interpolation of PointValue.The class Shape is responsible for providing the approximation function that interpolates the different PointValue applied in a region of the element that can be a line, area or a volume, depending on the element type.The responsible for combining this information and providing the equivalent nodal value is EquivalentNodalValue class, whose attributes are objects of Element and Ele-mentValue classes.

Information Transferring from the Global to the Local Problem
One of the actions performed during the process of generalization of the imposition of boundary conditions on INSANE environment is to add the ability to obtain boundary conditions of an element of the local problem from an element of the global problem.This is required in the globallocal analysis process in which, it is necessary to impose boundary conditions for the local problem provided by the global mesh solution.There are basically three types of boundary conditions that can be used: -Dirichlet boundary conditions

-Neumann boundary conditions -Cauchy boundary conditions
The class responsible for the transfer of boundary conditions between domains is the Equiva-lentNodalValue class that is part of the Value package.The EquivalentNodalValue class has methods that fall into those capable of modifying the matrix C (stiffness) and those able to modify the vector D (force) of the system in Eq. ( 10), as can be seen in Fig. 11.

NUMERICAL EXAMPLES
This section presents two linear-elastic problems in R 2 .Section 5.1 presents a linear bending problem, and section 5.2 presents a fracture mechanic problem.The geometry and boundary conditions Latin American Journal of Solids and Structures 13 (2016) 2529-2551 are very simple, since the goal is not demonstrate the capabilities of the methods, but the general approach proposed to enclose the GFEM gl formulation in INSANE environment.
Among the three aforementioned boundary conditions in section 4.6, according to Kim et al. (2010), the Dirichlet boundary conditions (a limiting case of Cauchy boundary condition) lead to worse results than Cauchy boundary conditions.Thus, for all two examples, the Dirichlet boundary conditions are applied on the local problem boundaries in order to demonstrate the robustness of the methodology in the worst case scenario.
Numerical integration for the first and second steps of the global-local analysis is done based on standard Gaussian quadrature procedure.In the third step, the numerical integration for those global elements that contain local elements is done over the Gauss points of local elements, as proposed by Kim et al. (2010).Consider that a global element contains n Le local elements and number of Gauss points for each local elements be equal to GP.Thus, the number of integration points for this global element is obtained by: . In other words, the global numerical integration is done over Gauss points of each local element that represent a part of the global element.

Linear Bending-Moment Problem
Figure 12 illustrates a beam subjected to a set of loads that produce a linear-bending moment.In Lee and Bathe (1993), this problem is used to evaluate numerically the effects of element distortions in FEM.Here, this problem exemplifies and validates the GFEM gl implementation within INSANE environment.The analytical solution is given for the displacements u and v, in direction x and y respectively and described in Cartesian coordinates, as: Using the GFEM gl , the solution of this problem can be divided in three steps: • Step 1: All the nodes of the problem are enriched by P2 functions (quadratic enrichment).This strategy guarantees a cubic order of approximation through the beam, reproducing the analytical solution of the problem (see Eqs. ( 12) and ( 13)).The P2 enrichment function for x direction is as follows: • Step 2: Global problem is split in 9 local problems, as presented in Fig. 13.Each local problem is enriched using P2 functions in order to exactly represent the analytical solution of the problem (this is only possible if exact boundary conditions are provided from step 1).At the end of step 2, there is a numerical solution that can exactly reproduce this problem.
• Step 3: Returning to the global problem, the enrichment P2 is replaced by global-local enrichment obtained from step 2. For this example, the numerical solution from local problems can exactly reproduce the analytical solution for this problem.
For this analysis, a Gauss-Legendre quadrature rule with 4 × 4 points is employed for both global and local problems.
Figure 14 shows stress distribution of stress component σxx for each local domain of the beam.This figure depicts a generic application of the GFEM gl implementation, in which any region, or the whole mesh can be defined as local domains and used to solve the problem.This is an important issue in the case of not having a predefined local phenomenon and can take advantage of the independent characteristic of each local problem.As an efficient way and with the help of parallel processing, each local problem can be solved separately using multi-core machines.The P2 enrichment is used for the global problem aiming to avoid any error in the boundary condition of the local problem.The idea is to having an "exact" local solution to enrich the global mesh.Then, the implementation is validate if the global-local solution exactly reproduce the analytic solution.

Fracture Mechanic Problem
This example considers a cracked plate submitted to an axial stress, as shown in  The reference solution of this problem is obtained using a mesh of 12087 p-quadrilateral elements in ANSYS ® .For GFEM gl analysis, however, a smaller number of finite elements as well as of degrees of freedom (DOFs) is used.The reason for using a smaller number of DOFs is explained by the use of global-local enrichment function, which is suitable for high stress concentration.This strategy is used to describe the singular stress near the crack tip.
A geometric mesh is used to describe the local domain, Fig. 16 and it is shown in Fig. 17.This mesh is graded so that the elements are decreased in geometric progression toward the crack tip, in four levels (L1, L2, L3 and L4) with a common reduction factor of 10%.Results are shown in Fig. 18.Also, Table 1 presents a comparison between the strain energy values for the reference and approximate solutions.It can be observed from the results shown in Fig. 18 and Table 1 the capability of the globallocal enrichment strategy to represent the singular stress field close to the crack tip.

CONCLUSION
An overview of the GFEM gl is given with emphasis on implementation aspects under OOP approach.The focus of this work is to present a GFEM gl extension of a FEM programming environment called INSANE.The proposed approach allows to combine any types of partition of unity methods, analysis model and enrichment strategy.Also, an expansion of the numerical core IN-SANE, in order to adapt it to impose boundary conditions using the penalty method is included.The OOP approach is fully exploited, reinforcing the premise segmentation and encapsulation of the INSANE environment.The validation of this extension and some additional conclusions about the GFEM global-local strategy are presented by numerical examples for Solid Mechanics.
x in the domain W , the set of functions ( )
of nodes enriched by the local solution L u .

Figure 2 :
Figure 2: Three steps of the Global-Local strategy.

Figure 3 :
Figure 3: Organization of numerical core of INSANE.

Figure 4 :
Figure 4: UML diagram for Solution class.

Figure 10 :
Figure 10: UML diagram of the Value package.

LatinFigure 13 :Figure 14 :
Figure 13: Description of the 9 local domains of the problem.
Fig. 15.The cracked zone produces singular stress field near the crack tip.The objective of this problem is to illustrate the use of this version of GFEM gl for fracture mechanic problems.This problem analyzed under plane stress state, has the following parameters (in consistent units): − Modulus of elasticity E = 1.0; − Poisson ratio ν = 0.3; − Traction σ = 1.0.

Figure 15 :
Figure 15: Geometry and loading of a cracked plate submitted to an axial stress.

Figure 16 :
Figure 16: Global and local domain of the problem.

Figure 18 :
Figure 18: Results for stress component σxx (step 3) in different positions given by the coordinate x and the same coordinate y of the crack, for L4 in the global-local analysis.
list that relates each global node, that will be enriched by the global-local enrichment strategy, with the corresponding local model.This is a very important information because it is in the local model that the function ( ) Latin American Journal ofSolids and Structures 13 (2016) 2529-2551− localEnrichedList: element belongs to a local problem, this parameter indicates in which local model it is inserted.− GLOBAL_ELEMENT: if the element belongs to a local problem, this parameter indicates which element from the global model contains the current element.This relationship allows to obtain from the global element the necessary data to apply the boundary conditions on the edge, if it is the case, of the current element.− LOCAL_ELEMENTS: if the element belongs to a global problem, this parameter indicates the elements of the local problem that discretize the domain of this global element.In this implementation the local mesh is nested in the global mesh.As a consequence each global element exactly contains a set of local elements.
− STEP_GL: informs in which step of the problem the solution is being processed.− LOCAL_TWINS: if the element belongs to a local problem, this parameter indicates which element, if there is, from another local problem coincides with it.Latin American Journal of Solids and Structures 13 (2016) 2529-2551 Figure 7: UML diagram for GFemElement class.

Table 1 :
DOFs and strain energy for geometric enrichment.