Skip to main content


easifemBase (henceforth read as Base) library is the lowest (or, base) level component of EASIFEM. All other components are built upon easifemBase.

It contains a lot of valuable routines and derived types.

Programming paradigm

The programming paradigm of easifemBase is Multiple dispatch approach and Procedural programming.


The base library do not use the object-oriented programming concepts. In the Base library String_Class is the only exception wherein Object-oriented paradigm has been used.

All user-defined data types are declared in the BaseType module, and all methods are exposed through BaseMethods modules.

Key features

Currently, easifemBase has interface with

  • BLAS95

  • Lapack95

  • Sparsekit

  • Metis

  • PlPlot

  • SuperLU


  • TODO Add key features in

Use association

USE easifemBase


USE BaseType
USE BaseMethods


The easifemBase library exposes three main modules.

  1. BaseType, which contains the user-defined data-type
  2. BaseMethods, contains the modules (each module defines the routines for data-types defined in BaseType.F90.)
  3. easifemBase

The structure of source directory is shown in the following figure.

The source directory has two directories

  1. modules
  2. submodules

The modules directory mainly contains header and interface of methods. The implementation is given in submodules directory.


Both BaseType.F90 and BaseMethods.F90 are included in modules directory.

Let us understand the structure of the Base library by an example of CSRSparsity_ data type.

  1. First, we define CSRSparsity_ in BaseType.F90 as
  1. Then we create a directory called CSRSparsity in both modules and submodules directory.
  2. In modules/CSRSparsity we create CSRSparsity_Method.F90 file.
  3. In modules/CSRSparsity/CSRSparsity_Method.F90 we define a module CSRSparsity_Method (same name as file).
  4. In CSRSparsity_Method module, we only define interface of methods. In this way, this file can be considered as header file. See, the example given below:
  5. In submodules/CSRSparsity, we create CSRSparsity_Method@ConstructorMethods.F90, which contains the contruction related routines.
  6. Also, we create CSRSparsity_Method@IOMethods.F90, which include methods related to input and output.


BaseType contains user-define data type.

Math_Contains mathematical constants.Math
BoundingBox_Data type for bounding box.FEM
RealMatrix_Extension for Fortran two-d arrayMatrix
IntVector_Vector of integers.Vector
RealVector_Vector of realsVector
Vector3D_3D VectorVector
IndexValue_Key (integer) and value (real), useful for defining nodal boundary conditionsFEM
DOF_Degree of freedom object typeFEM
SparseMatixReOrdering_Sparse matrix reordering schemeLinearAlgebra
CSRSparisty_Datatype for handling sparsity patternLinearAlgebra
SuperLU_SuperLU data structure.LinearAlgebra
CSRMatrix_Compressed sparse row matrixLinearAlgebra
IterationData_Datatype for storing iteration dataFEM
VoigtRank2Tensor_Rank2 tensorTensor
DeformationGradient_Deformation Gradient tensorTensor
LeftCauchyGreen_Left Cauchy Green tensorTensor
RightCauchyGreen_Right Cauchy Green tensorTensor
Strain_Strain tensorTensor
AlmansiStrain_Almansi strainTensor
GreenStrain_Green strain tensorTensor
SmallStrain_Small strain tensor.Tensor
ReferenceTopology_Data type for handling reference element in FEMFEM
ReferenceElement_Data type for reference element in FEMFEM
ReferencePoint_Data type for reference point in FEMFEM
ReferenceLine_Data type for reference line in FEMFEM
ReferenceTriangle_Data type for reference triangle in FEMFEM
ReferenceQuadrangle_Data type for reference quadrangle in FEMFEM
ReferenceTetrahedron_Data type for reference tetrahedron in FEMFEM
ReferenceHexahedron_Data type for reference hexahedron in FEMFEM
ReferencePrism_Data type for reference prism in FEMFEM
ReferencePyramid_Data type for reference pyramid in FEMFEM
KeyValue_Poor man's implementation of dic.Container
FEVariable_Data type for finite element variables.FEM
FEVariableConstant_Constant finite element variableFEM
FEVariableSpace_Spatially variable finite element variableFEM
FEVariableTime_Time variable finite element variableFEM
FEVariableSpaceTime_Spatially and temporally changing finite element variableFEM
FEVariableScalar_Scalar finite element variableFEM
FEVariableVector_Vector finite element variableFEM
FEVariableMatrix_Matrix finite element variableFEM
QuadraturePoint_Quadrature pointsFEM
BaseInterpolation_Data type for basis interpolationFEM
LagrangeInterpolation_Lagrange interpolationFEM
HermitInterpolation_Hermit interpolationFEM
SerendipityInterpolation_Serendipity interpolationFEM
HierarchyInterpolation_Hierarchical interpolationFEM
BaseContinuity_Continuity type of basis functions.FEM
H1_H1 finite element basisFEM
H1DIV_H1(Div) finite element basisFEM
H1Curl_H1(Curl) finite element basisFEM
DG_Discontinuous Galerkin finite element basisFEM
ElementData_Data necessary for creating finite element.FEM
ShapeData_Storage for shape dataFEM
STShapeData_Space-time shape function dataFEM
ElemshapeData_Element shape function dataFEM
STElemShapeData_Space-time element shape data.FEM
QualityMeasure_Datatype for mesh quality measureFEM
Random_Data type for random variablesFEM
OpenMP_Data type for OpenMP parallel environmentFEM
MultiIndices_Data type for multi indicesFEM


BaseMethods library contains the modules which defines and implements methods (routines) for data types defined in BaseType.

At present BaseMethods contains following modules.

String_ClassDefines String class and methods.String
String_MethodAdditional methods for handling strings.String
PENFFor portability.OS
BeFoR64For portability.OS
FACEColorful console printing.IO
FPLFortran parameter listUtility
System_MethodInterface to C system libray.OS
CInterfaceUtility for C-Fortran interface building.OS
OpenMP_MethodMethods which uses OpenMP for acceleration.Misc
GlobalDataGlobalData for easifem libraryMisc
Hashing32Hash functions.Utility, Crypto
OGPFGnuplot libraryPlot
Test_MethodUnit testing libraryTest
MdEncode_MethodEncoding text into markdown.IO
DispModulePretty printing on terminal.IO
Display_MethodPretty printing on terminal.IO
ErrorHandlingException handling.ExceptionHandling
UtilityUtility module.Utility
PolynomialUtilityCollection of useful routine for polynomial interpolation.Basis
BaseTypeCollection of user define data types.Core
MultiIndices_MethodMethods for MultiIndices_.Math
Random_MethodMethods for Random_ data type.Math
BoundingBox_MethodMethods for BoundingBox_ data typeMath
IntVector_MethodMethods for IntVector_ data typeVector
IndexValue_MethodMethods for IndexValue_ data typeFEM
IterationData_MethodMethods for IterationData_ data type.FEM
Vector3D_MethodMethods for Vector3D_ data type.Vector
RealVector_MethodMethods for RealVector_ data typeVector
DOF_MethodMethods for DOF_ data typeFEM
Geometry_MethodGeometry realted methods.Math
QuadraturePoint_MethodMethods for QuadraturePoint_ data type.FEM
FEVariable_MethodMethods for FEVariable_ data typeFEM
ElemshapeData_MethodMethods for ElemshapeData_ data type.FEM
RealMatrix_MethodMethods for RealMatrix_ data type.Matrix
FEMatrix_MethodMethods for FEMatrix_ data type.FEM
FEVector_MethodMethods for FEVector_ data type.FEM
Rank2Tensor_MethodMethods for Rank2Tensor_ data type.Tensor
VoigtRank2Tensor_MethodMethods for VoigtRank2Tensor_ data type.Tensor
CSRSparisty_MethodMethods for CSRSparisty_ data type.Matrix
CSRMatrix_MethodMethods for CSRMatrix_ data type.Matrix
SuperLUInterfaceFortran interface to SuperLU libLinearSolver
LISInterfaceFortran interface to LIS libLinearSolver
F77_BLASF77 interface to BLAS.LinearAlgebra
F95_BLASFortran 95 interface to BLAS lib.LinearAlgebra
F77_LAPACKFortran interface to Lapack.LinearAlgebra
F95_LAPACKFortran 95 interface to Lapack lib.LinearAlgebra
Lapack_MethodMethods for linear algebra by using Lapack.LinearAlgebra
EASIFEM_ARPACKFortran interface to ARPACK.LinearAlgebra
FFTW3Fast fourer tranform libraryLinearAlgebra
MetisInterfaceFortran interface to Metis library.LinearAlgebra