Skip to main content


The easifemClasses (henceforth, the Classes) library, forms the second level of EASIFEM library. This library contains many useful high-level objects, which are important for implementing FEM. The main programming paradigm of Classes library is object-oriented programming.

Use association

USE easifemClasses


Before installing the Classes library please install:

Step-1: Install the easifem command line application by using:

python3 -m pip install --upgrade easifem

Step-2: Set the environment variables by specifying the src, build, and install directory as shown below:

easifem setenv --install <install directory> --build <build directory> --source <source directory>
source ~/.config/easifem/

You can find detailed information here.

Step-3: If you have not installed the extpkgs, then you can install them by running:

easifem install extpkgs

Step-4: Now, you can install the Base library by:

easifem install base

Step-5: Now, you can install the Classes library by:

easifem install classes

You can combine step-3 to step-5 by using:

easifem install extpkgs base classes


Download the source code:

git clone


git clone


gh repo clone vickysharma0812/easifem-classes

After downloading the source code, enter the source directory, and make a build directory.

cd easifem-classes
mkdir ./build

EASIFEM uses CMake build system. You can install the Base library from CMake by using following steps

  1. Configuration
  2. Build
  3. Install

To configure the Base library you can define following variables:


An example of configuration step is given below:

export EASIFEM_CLASSES=${HOME}/.local/easifem/classes
cmake -G "Ninja" -S ./ -B ./build \

After configuration, you can build and install the library by using:

cmake --build ./build --target --install


Similar to the Base library, the Classes library has two directories in the src directory:

  1. modules
  2. submodules

The modules directory mainly contains following items:

  1. Type definition including methods
  2. Header and interface of methods

The 📁submodules directory contains the implementation of the methods that are defined in the modules directory.

  • In addition, each class has its own subdirectory in the modules and submodules directory.
  • For example, the directory of Domain_ class is Domain, the directory of Mesh_ class is Mesh.
  • In this way, modules/Domain will define the Domain_ class and interface of methods, whereas submodules/Domain will include the submodules that implementes the methods defined inside modules.
  • The name of the module which defines Domain_ class is Domain_Classs, and it is included in the file called Domain_Class.F90.
  • The submodule, which defines methods (for example, constructor methods) will be included in Domain_Class@ConstructorMethods.F90, Domain_Class@IOMethods, etc.

If you want to implement a class called XXX_, then perform following task:

  1. Make a subdirectory XXX in src/modules and src/submodules
  2. In both XXX make a subdirectory XXX/src
  3. Create a file modules/XXX/src/XXX_Class.F90 and define a module called XXX_Class:
  4. Create submodules in submodule/XXX/src/XXX_Class@CategoryofMethods.F90 and implement the methods.
!! Use modules
!! Define class here


easifemClasses currently contains following modules:

Gmsh_ClassInterface to Gmsh libraryMesh
CommandLine_MethodFortran library for making comand line applications.CLI
ExceptionHandling_ClassFortran library for error handlingUtility
FPL_MethodFortran parameter listFEM
FilesCollection of modules related to File IO.IO
ElementFactoryFinite element factoryFEM
IntList_ClassLinked list of integersContainer
RealList_ClassLinked list of realsContainer
StringList_ClassLinked list of stringsContainer
ElementList_ClassLinked list of finite elementsFEM
ElementPointerVector_ClassDynamic vector of element pointersFEM
Mesh_ClassFinite element mesh classFEM
MeshPointerVector_ClassDynamic vector of mesh pointersFEM
Domain_ClassDomain classFEM
DomainUtilityA module for additional methods on Domain.FEM
DomainConnectivity_ClassDomain connectivity classFEM
MeshSelection_ClassA class for selecting the region of domain.FEM
MSHFile_ClassClass for Gmsh`s msh fileFEM
AbstractVector_ClassAbstract class for vectors.FEM
Vector_ClassConcrete class for vectors.FEM
FieldCollection of modules which defines classes for finite element fields.FEM
FieldFactoryFactory for fieldsFEM
AbstractLinSolver_ClassAbstract class for linear solverFEM
LinSolver_ClassNative linear solver class.FEM
LinSolver_FactoryFactory for linear solvers.FEM
AbstractBC_ClassAbstract class for boundary conditionsFEM
DirichletBC_ClassClass for Dirichlet boundary conditions.FEM
NeumannBC_ClassClass for Neumann boundary conditions.FEM
NitscheBC_ClassClass for Nitsche boundary conditions.FEM
PolynomialFactoryFactory of polynomialsFEM
UserFunction_ClassUser function classFEM
RefElementFactoryFactory of reference elementsFEM
FiniteElementFactoryFactory of finite elements.FEM
Tree3R_ClassTree data structure for 3 term recurrence relation.Math
Plot_MethodCollection of methods for plotting.FEM