easifemBase
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
-
ARPACK
-
TODO Add key features in
easifemBase.md
.
Use association
USE easifemBase
or
USE BaseType
USE BaseMethods
Structure
The easifemBase
library exposes three main modules.
BaseType
, which contains the user-defined data-typeBaseMethods
, contains the modules (each module defines the routines for data-types defined inBaseType.F90
.)easifemBase
The structure of source directory is shown in the following figure.
The source directory has two directories
modules
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.
- First, we define
CSRSparsity_
inBaseType.F90
as
- ܀ BaseType.F90
- ↢
TYPE :: CSRSparsity_
INTEGER(I4B) :: nnz = 0
INTEGER(I4B) :: ncol = 0
INTEGER(I4B) :: nrow = 0
LOGICAL(LGT) :: isSorted = .FALSE.
LOGICAL(LGT) :: isInitiated = .FALSE.
LOGICAL(LGT) :: isSparsityLock = .FALSE.
LOGICAL(LGT) :: isDiagStored = .FALSE.
INTEGER(I4B), ALLOCATABLE :: IA(:)
INTEGER(I4B), ALLOCATABLE :: JA(:)
INTEGER(I4B), ALLOCATABLE :: idiag(:)
TYPE(IntVector_), ALLOCATABLE :: row(:)
TYPE(DOF_) :: idof
!! DOF for row
TYPE(DOF_) :: jdof
!! DOF for columns
END TYPE CSRSparsity_
- Then we create a directory called
CSRSparsity
in bothmodules
andsubmodules
directory. - In
modules/CSRSparsity
we createCSRSparsity_Method.F90
file. - In
modules/CSRSparsity/CSRSparsity_Method.F90
we define a moduleCSRSparsity_Method
(same name as file). - 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: - In
submodules/CSRSparsity
, we createCSRSparsity_Method@ConstructorMethods.F90
, which contains the contruction related routines. - Also, we create
CSRSparsity_Method@IOMethods.F90
, which include methods related to input and output.
- ܀ CSRSparsity_Method
- ܀ ConstructorMethods.F90
- ܀ IOMethods
- ↢
MODULE CSRSparsity_Method
USE GlobalData
USE BaseType
IMPLICIT NONE
PRIVATE
INTERFACE
MODULE SUBROUTINE csr_initiate1(obj, ncol, nrow, idof, jdof)
TYPE(CSRSparsity_), INTENT(INOUT) :: obj
INTEGER(I4B), INTENT(IN) :: ncol, nrow
TYPE(DOF_), OPTIONAL, INTENT(IN) :: idof
!! DOF for row
TYPE(DOF_), OPTIONAL, INTENT(IN) :: jdof
!! DOF for column
END SUBROUTINE csr_initiate1
END INTERFACE
INTERFACE Initiate
MODULE PROCEDURE csr_initiate1
END INTERFACE Initiate
INTERFACE
MODULE SUBROUTINE csr_Display(obj, Msg, UnitNo)
TYPE(CSRSparsity_), INTENT(IN) :: obj
CHARACTER(*), INTENT(IN) :: Msg
INTEGER(I4B), OPTIONAL, INTENT(IN) :: UnitNo
END SUBROUTINE csr_Display
END INTERFACE
INTERFACE Display
MODULE PROCEDURE csr_Display
END INTERFACE Display
END MODULE CSRSparsity_Method
CSRSparsity_Method@ConstructorMethods.F90
SUBMODULE(CSRSparsity_Method) ConstructorMethods
USE BaseMethod
IMPLICIT NONE
CONTAINS
MODULE PROCEDURE csr_initiate1
obj%nnz = 0
obj%ncol = ncol
obj%nrow = nrow
IF (PRESENT(idof)) THEN
obj%idof = idof
obj%jdof = jdof
ELSE
CALL initiate(obj=obj%idof, tNodes=[nrow], names=['K'], &
& spacecompo=[1], timecompo=[1], storageFMT=NODES_FMT)
CALL initiate(obj=obj%jdof, tNodes=[ncol], names=['K'], &
& spacecompo=[1], timecompo=[1], storageFMT=NODES_FMT)
END IF
CALL Reallocate(obj%IA, nrow + 1)
CALL Reallocate(obj%idiag, nrow)
IF (ALLOCATED(obj%row)) DEALLOCATE (obj%row)
IF (ALLOCATED(obj%JA)) DEALLOCATE (obj%JA)
obj%isInitiated = .TRUE.
obj%isSparsityLock = .FALSE.
obj%isSorted = .FALSE.
obj%isDiagStored = .FALSE.
END PROCEDURE csr_initiate1
END SUBMODULE ConstructorMethods
CSRSparsity_Method@IOMethods.F90
SUBMODULE(CSRSparsity_Method) IOMethods
USE BaseMethod
IMPLICIT NONE
CONTAINS
MODULE PROCEDURE csr_Display
CALL Display(Msg, unitNo=unitNo)
CALL Display(obj%nnz, "# NNZ : ", unitNo=unitNo)
CALL Display(obj%ncol, "# NCOL : ", unitNo=unitNo)
CALL Display(obj%nrow, "# NROW : ", unitNo=unitNo)
CALL Display(obj%idof, "# iDOF : ", unitNo=unitNo)
CALL Display(obj%jdof, "# jDOF : ", unitNo=unitNo)
END PROCEDURE csr_Display
END SUBMODULE IOMethods
BaseType
BaseType
contains user-define data type.
Data-type | Summary | Category |
---|---|---|
Math_ | Contains mathematical constants. | Math |
BoundingBox_ | Data type for bounding box. | FEM |
RealMatrix_ | Extension for Fortran two-d array | Matrix |
IntVector_ | Vector of integers. | Vector |
RealVector_ | Vector of reals | Vector |
Vector3D_ | 3D Vector | Vector |
IndexValue_ | Key (integer) and value (real), useful for defining nodal boundary conditions | FEM |
DOF_ | Degree of freedom object type | FEM |
SparseMatixReOrdering_ | Sparse matrix reordering scheme | LinearAlgebra |
CSRSparisty_ | Datatype for handling sparsity pattern | LinearAlgebra |
SuperLU_ | SuperLU data structure. | LinearAlgebra |
CSRMatrix_ | Compressed sparse row matrix | LinearAlgebra |
IterationData_ | Datatype for storing iteration data | FEM |
VoigtRank2Tensor_ | Rank2 tensor | Tensor |
DeformationGradient_ | Deformation Gradient tensor | Tensor |
LeftCauchyGreen_ | Left Cauchy Green tensor | Tensor |
RightCauchyGreen_ | Right Cauchy Green tensor | Tensor |
Strain_ | Strain tensor | Tensor |
AlmansiStrain_ | Almansi strain | Tensor |
GreenStrain_ | Green strain tensor | Tensor |
SmallStrain_ | Small strain tensor. | Tensor |
ReferenceTopology_ | Data type for handling reference element in FEM | FEM |
ReferenceElement_ | Data type for reference element in FEM | FEM |
ReferencePoint_ | Data type for reference point in FEM | FEM |
ReferenceLine_ | Data type for reference line in FEM | FEM |
ReferenceTriangle_ | Data type for reference triangle in FEM | FEM |
ReferenceQuadrangle_ | Data type for reference quadrangle in FEM | FEM |
ReferenceTetrahedron_ | Data type for reference tetrahedron in FEM | FEM |
ReferenceHexahedron_ | Data type for reference hexahedron in FEM | FEM |
ReferencePrism_ | Data type for reference prism in FEM | FEM |
ReferencePyramid_ | Data type for reference pyramid in FEM | FEM |
KeyValue_ | Poor man's implementation of dic. | Container |
FEVariable_ | Data type for finite element variables. | FEM |
FEVariableConstant_ | Constant finite element variable | FEM |
FEVariableSpace_ | Spatially variable finite element variable | FEM |
FEVariableTime_ | Time variable finite element variable | FEM |
FEVariableSpaceTime_ | Spatially and temporally changing finite element variable | FEM |
FEVariableScalar_ | Scalar finite element variable | FEM |
FEVariableVector_ | Vector finite element variable | FEM |
FEVariableMatrix_ | Matrix finite element variable | FEM |
QuadraturePoint_ | Quadrature points | FEM |
BaseInterpolation_ | Data type for basis interpolation | FEM |
LagrangeInterpolation_ | Lagrange interpolation | FEM |
HermitInterpolation_ | Hermit interpolation | FEM |
SerendipityInterpolation_ | Serendipity interpolation | FEM |
HierarchyInterpolation_ | Hierarchical interpolation | FEM |
BaseContinuity_ | Continuity type of basis functions. | FEM |
H1_ | H1 finite element basis | FEM |
H1DIV_ | H1(Div) finite element basis | FEM |
H1Curl_ | H1(Curl) finite element basis | FEM |
DG_ | Discontinuous Galerkin finite element basis | FEM |
ElementData_ | Data necessary for creating finite element. | FEM |
ShapeData_ | Storage for shape data | FEM |
STShapeData_ | Space-time shape function data | FEM |
ElemshapeData_ | Element shape function data | FEM |
STElemShapeData_ | Space-time element shape data. | FEM |
QualityMeasure_ | Datatype for mesh quality measure | FEM |
Random_ | Data type for random variables | FEM |
OpenMP_ | Data type for OpenMP parallel environment | FEM |
MultiIndices_ | Data type for multi indices | FEM |
BaseMethods
BaseMethods
library contains the modules which defines and implements methods (routines) for data types defined in BaseType
.
At present BaseMethods contains following modules.
Module | Comment | Category |
---|---|---|
String_Class | Defines String class and methods. | String |
String_Method | Additional methods for handling strings. | String |
PENF | For portability. | OS |
BeFoR64 | For portability. | OS |
FACE | Colorful console printing. | IO |
FPL | Fortran parameter list | Utility |
System_Method | Interface to C system libray. | OS |
CInterface | Utility for C-Fortran interface building. | OS |
OpenMP_Method | Methods which uses OpenMP for acceleration. | Misc |
GlobalData | GlobalData for easifem library | Misc |
Hashing32 | Hash functions. | Utility, Crypto |
OGPF | Gnuplot library | Plot |
Test_Method | Unit testing library | Test |
MdEncode_Method | Encoding text into markdown. | IO |
DispModule | Pretty printing on terminal. | IO |
Display_Method | Pretty printing on terminal. | IO |
ErrorHandling | Exception handling. | ExceptionHandling |
Utility | Utility module. | Utility |
PolynomialUtility | Collection of useful routine for polynomial interpolation. | Basis |
BaseType | Collection of user define data types. | Core |
MultiIndices_Method | Methods for MultiIndices_. | Math |
Random_Method | Methods for Random_ data type. | Math |
BoundingBox_Method | Methods for BoundingBox_ data type | Math |
IntVector_Method | Methods for IntVector_ data type | Vector |
IndexValue_Method | Methods for IndexValue_ data type | FEM |
IterationData_Method | Methods for IterationData_ data type. | FEM |
Vector3D_Method | Methods for Vector3D_ data type. | Vector |
RealVector_Method | Methods for RealVector_ data type | Vector |
DOF_Method | Methods for DOF_ data type | FEM |
Geometry_Method | Geometry realted methods. | Math |
QuadraturePoint_Method | Methods for QuadraturePoint_ data type. | FEM |
FEVariable_Method | Methods for FEVariable_ data type | FEM |
ElemshapeData_Method | Methods for ElemshapeData_ data type. | FEM |
RealMatrix_Method | Methods for RealMatrix_ data type. | Matrix |
FEMatrix_Method | Methods for FEMatrix_ data type. | FEM |
FEVector_Method | Methods for FEVector_ data type. | FEM |
Rank2Tensor_Method | Methods for Rank2Tensor_ data type. | Tensor |
VoigtRank2Tensor_Method | Methods for VoigtRank2Tensor_ data type. | Tensor |
CSRSparisty_Method | Methods for CSRSparisty_ data type. | Matrix |
CSRMatrix_Method | Methods for CSRMatrix_ data type. | Matrix |
SuperLUInterface | Fortran interface to SuperLU lib | LinearSolver |
LISInterface | Fortran interface to LIS lib | LinearSolver |
F77_BLAS | F77 interface to BLAS. | LinearAlgebra |
F95_BLAS | Fortran 95 interface to BLAS lib. | LinearAlgebra |
F77_LAPACK | Fortran interface to Lapack. | LinearAlgebra |
F95_LAPACK | Fortran 95 interface to Lapack lib. | LinearAlgebra |
Lapack_Method | Methods for linear algebra by using Lapack. | LinearAlgebra |
EASIFEM_ARPACK | Fortran interface to ARPACK. | LinearAlgebra |
FFTW3 | Fast fourer tranform library | LinearAlgebra |
MetisInterface | Fortran interface to Metis library. | LinearAlgebra |