# GetFEM++ organization. GetFEM++ 5.0

Add to My manuals109 Pages

The Scilab Interface 5.0 is a user-friendly interface to the GetFEM++ library, a powerful tool for solving partial differential equations using the finite element method. You can use it to create meshes, define finite elements, assemble matrices and vectors, solve linear systems, and visualize results.

advertisement

**CHAPTER**

**THREE**

**GETFEM++ ORGANIZATION**

This part of the SciLab GetFEM++ documentation is to be adapted (comes frome the | MatLab GetFEM++ one).

The GetFEM++ toolbox is just a convenient interface to the GetFEM++ library: you must have a working GetFEM++ installed on your computer. All the functions of GetFEM++ are prefixed by gf_ (hence typing gf_ at the SciLab prompt and then pressing the <tab> key is a quick way to obtain the list of getfem functions).

**3.1 Functions**

• gf_workspace : workspace management.

• gf_util : miscellanous utility functions.

• gf_delete : destroy a GetFEM++ object (gfMesh , gfMeshFem , gfMeshIm etc.).

• gf_cvstruct_get : retrieve informations from a gfCvStruct object.

• gf_geotrans : define a geometric transformation.

• gf_geotrans_get : retrieve informations from a gfGeoTrans object.

• gf_mesh : creates a new gfMesh object.

• gf_mesh_get : retrieve informations from a gfMesh object.

• gf_mesh_set : modify a gfMesh object.

• gf_eltm : define an elementary matrix.

• gf_fem : define a gfFem.

• gf_fem_get : retrieve informations from a gfFem object.

• gf_integ : define a integration method.

• gf_integ_get : retrieve informations from an gfInteg object.

• gf_mesh_fem : creates a new gfMeshFem object.

• gf_mesh_fem_get : retrieve informations from a gfMeshFem object.

• gf_mesh_fem_set : modify a gfMeshFem object.

• gf_mesh_im : creates a new gfMeshIm object.

• gf_mesh_im_get : retrieve informations from a gfMeshIm object.

• gf_mesh_im_set : modify a gfMeshIm object.

• gf_slice : create a new gfSlice object.

**5**

**Scilab Interface, Release 5.0**

• gf_slice_get : retrieve informations from a gfSlice object.

• gf_slice_set : modify a gfSlice object.

• gf_spmat : create a gfSpMat object.

• gf_spmat_get : perform computations with the gfSpMat.

• gf_spmat_set : modify the gfSpMat.

• gf_precond : create a gfPrecond object.

• gf_precond_get : perform computations with the gfPrecond.

• gf_linsolve : interface to various linear solvers provided by getfem (SuperLU, conjugated gradient, etc.).

• gf_asm : assembly routines.

• gf_solve : various solvers for usual PDEs (obsoleted by the gfMdBrick objects).

• gf_compute : computations involving the solution of a PDE (norm, derivative, etc.).

• gf_mdbrick : create a (“model brick”) gfMdBrick object.

• gf_mdbrick_get : retrieve information from a gfMdBrick object.

• gf_mdbrick_set : modify a gfMdBrick object.

• gf_mdstate : create a (“model state”) gfMdState object.

• gf_mdstate_get : retrieve information from a gfMdState object.

• gf_mdstate_set : modify a gfMdState object.

• gf_model : create a gfModel object.

• gf_model_get : retrieve information from a gfModel object.

• gf_model_set : modify a gfModel object.

• gf_global_function : create a gfGlobalFunction object.

• gf_model_get : retrieve information from a gfGlobalFunction object.

• gf_model_set : modify a GlobalFunction object.

• gf_plot_mesh : plotting of mesh.

• gf_plot : plotting of 2D and 3D fields.

• gf_plot_1D : plotting of 1D fields.

• gf_plot_slice : plotting of a mesh slice.

**3.2 Objects**

Various “objects” can be manipulated by the GetFEM++ toolbox, see fig.

and MESHFEM objects are the two most important objects.

• gfGeoTrans: geometric transformations (defines the shape/position of the convexes), created with gf_geotrans

• gfGlobalFunction: represent a global function for the enrichment of finite element methods.

• gfMesh : mesh structure (nodes, convexes, geometric transformations for each convex), created with gf_mesh

**6 Chapter 3. GetFEM++ organization**

**Scilab Interface, Release 5.0**

Figure 3.1: GetFEM++ objects hierarchy.

• gfInteg : integration method (exact, quadrature formula...). Although not linked directly to GEOTRANS, an integration method is usually specific to a given convex structure. Created with gf_integ

• gfFem : the finite element method (one per convex, can be PK, QK, HERMITE, etc.). Created with gf_fem

• gfCvStruct : stores formal information convex structures (nb. of points, nb. of faces which are themselves convex structures).

• gfMeshFem : object linked to a mesh, where each convex has been assigned a FEM. Created with gf_mesh_fem

.

• gfMeshImM : object linked to a mesh, where each convex has been assigned an integration method. Created with gf_mesh_im.

• gfMeshSlice : object linked to a mesh, very similar to a P1-discontinuous gfMeshFem. Used for fast interpolation and plotting.

• gfMdBrick : gfMdBrick , an abstraction of a part of solver (for example, the part which build the tangent matrix, the part which handles the dirichlet conditions, etc.). These objects are stacked to build a complete solver for a wide variety of problems. They typically use a number of gfMeshFem, gfMeshIm etc. Deprecated object, replaced now by gfModel.

• gfMdState : “model state”, holds the global data for a stack of mdbricks (global tangent matrix, right hand side etc.). Deprecated object, replaced now by gfModel.

• gfModel : “model”, holds the global data, variables and description of a model. Evolution of “model state” object for 4.0 version of GetFEM++.

The GetFEM++ toolbox uses its own memory management. Hence GetFEM++ objects are not cleared when a:

>> clear all is issued at the SciLab prompt, but instead the function:

>> gf_workspace( ’clear all’ ) should be used. The various GetFEM++ object can be accessed via handles (or descriptors), which are just SciLab structures containing 32-bits integer identifiers to the real objects. Hence the SciLab command:

**3.2. Objects 7**

**Scilab Interface, Release 5.0**

>> whos does not report the memory consumption of GetFEM++ objects (except the marginal space used by the handle).

Instead, you should use:

>> gf_workspace( ’stats’ )

There are two kinds of GetFEM++ objects:

• static ones, which can not be deleted: ELTM, FEM, INTEG, GEOTRANS and CVSTRUCT. Hopefully their memory consumption is very low.

• dynamic ones, which can be destroyed, and are handled by the gf_workspace function: MESH, MESHFEM,

MESHIM, SLICE, SPMAT, PRECOND.

The objects MESH and MESHFEM are not independent: a MESHFEM object is always linked to a MESH object, and a MESH object can be used by several MESHFEM objects. Hence when you request the destruction of a MESH object, its destruction might be delayed until it is not used anymore by any MESHFEM (these objects waiting for deletion are listed in the anonymous workspace section of gf_workspace(’stats’)).

**8 Chapter 3. GetFEM++ organization**

advertisement

### Key Features

- User-friendly interface to GetFEM++
- Allows creation of meshes
- Supports various finite element methods
- Provides functions for assembling matrices and vectors
- Offers solvers for linear systems
- Includes visualization tools for results
- Open source and freely available

### Related manuals

### Frequently Answers and Questions

###### What is the minimum Scilab release required for the GetFEM++ toolbox?

###### What are the steps to install the Scilab GetFEM++ toolbox?

###### How do I destroy a GetFEM++ object?

advertisement

#### Table of contents

- 5 Introduction
- 7 Installation
- 9 GetFEM++ organization
- 9 Functions
- 10 Objects
- 13 Draw Command reference
- 13 gf_colormap
- 13 gf_plot
- 14 gf_plot_1D
- 14 gf_plot_mesh
- 15 gf_plot_slice
- 17 Command reference
- 18 gf_asm
- 23 gf_compute
- 26 gf_cont_struct
- 28 gf_cont_struct_get
- 29 gf_cvstruct_get
- 30 gf_delete
- 31 gf_eltm
- 31 gf_fem
- 33 gf_fem_get
- 35 gf_geotrans
- 35 gf_geotrans_get
- 36 gf_global_function
- 37 gf_global_function_get
- 38 gf_integ
- 39 gf_integ_get
- 40 gf_levelset
- 41 gf_levelset_get
- 41 gf_levelset_set
- 42 gf_linsolve
- 43 gf_mesh
- 45 gf_mesh_get
- 51 gf_mesh_set
- 53 gf_mesh_fem
- 54 gf_mesh_fem_get
- 59 gf_mesh_fem_set
- 61 gf_mesh_im
- 62 gf_mesh_im_get
- 63 gf_mesh_im_set
- 64 gf_mesh_im_data
- 64 gf_mesh_im_data_get
- 65 gf_mesh_im_data_set
- 65 gf_mesh_levelset
- 65 gf_mesh_levelset_get
- 66 gf_mesh_levelset_set
- 67 gf_mesher_object
- 68 gf_mesher_object_get
- 68 gf_model
- 69 gf_model_get
- 74 gf_model_set
- 96 gf_poly
- 96 gf_precond
- 97 gf_precond_get
- 98 gf_slice
- 100 gf_slice_get
- 102 gf_slice_set
- 102 gf_spmat
- 104 gf_spmat_get
- 105 gf_spmat_set
- 107 gf_util
- 107 gf_workspace
- 109 Index