AbstractFunction
To handle analytical functions following abstract functions have been defined in EASIFEM.
AbstractFunction_
all functions are children of this.AbstractFunction1D_
abstract function in one variableAbstractFunction2D_
abstract function of two variablesAbstractFunction3D_
abstract function of three variablesAbstractFunctionND_
abstract function of N variables
Structure
TYPE, ABSTRACT :: AbstractFunction_
CONTAINS
PROCEDURE, PUBLIC, PASS(Obj) :: Deallocate => func_Deallocate
END TYPE AbstractFunction_
- AbstractFunction
- AbstractFunction1D
- AbstractFunction2D
- AbstractFunction3D
- AbstractFunctionND
TYPE, ABSTRACT :: AbstractFunction_
CONTAINS
PROCEDURE, PUBLIC, PASS(Obj) :: Deallocate => func_Deallocate
END TYPE AbstractFunction_
TYPE, ABSTRACT, EXTENDS(AbstractFunction_) :: AbstractFunction1D_
TYPE(String) :: varname
END TYPE AbstractFunction1D_
TYPE, ABSTRACT, EXTENDS(AbstractFunction_) :: AbstractFunction2D_
TYPE(String) :: varname(2)
END TYPE AbstractFunction2D_
TYPE, ABSTRACT, EXTENDS(AbstractFunction_) :: AbstractFunction3D_
TYPE(String) :: varname(3)
END TYPE AbstractFunction3D_
TYPE, ABSTRACT, EXTENDS(AbstractFunction_) :: AbstractFunctionND_
TYPE(String), ALLOCATABLE :: varname(:)
END TYPE AbstractFunctionND_
Following classes are children of Abstract1D_
Methods
AbstractFunctions are equipied with following methdods:
Deallocate()
To deallocate/ destroy the instance/variable.Eval
Evaluate the functionEvalGradient
Evaluate the first gradient.GetVarName
return the name of agrumnets of the function.
Eval
Eval
method evaluates the function. For AbstractFunction1D,2D,3D
it is an ELEMENTAL function. In case of AbstractFunctionND
it is only PURE.
- AbstractFunction1D
- AbstractFunction2D
- AbstractFunction3D
- AbstractFunctionND
Eval
method for AbstractFunction1D_
ABSTRACT INTERFACE
RECURSIVE PURE FUNCTION Eval(obj, x) RESULT(ans)
IMPORT AbstractFunction1D_, DFP
CLASS(AbstractFunction1D_), INTENT(IN) :: obj
REAL(DFP), INTENT(IN) :: x
REAL(DFP) :: ans
END FUNCTION Eval
END INTERFACE
Eval
method for AbstractFunction2D_
ABSTRACT INTERFACE
ELEMENTAL FUNCTION Eval(obj, x, y) RESULT(ans)
IMPORT AbstractFunction2D_, DFP
CLASS(AbstractFunction2D_), INTENT(IN) :: obj
REAL(DFP), INTENT(IN) :: x
REAL(DFP), INTENT(IN) :: y
REAL(DFP) :: ans
END FUNCTION Eval
END INTERFACE
Eval
method for AbstractFunction3D_
ABSTRACT INTERFACE
ELEMENTAL FUNCTION Eval(obj, x, y, z) RESULT(ans)
IMPORT AbstractFunction3D_, DFP
CLASS(AbstractFunction3D_), INTENT(IN) :: obj
REAL(DFP), INTENT(IN) :: x
REAL(DFP), INTENT(IN) :: y
REAL(DFP), INTENT(IN) :: z
REAL(DFP) :: ans
END FUNCTION Eval
END INTERFACE
Eval
method for AbstractFunctionND_
ABSTRACT INTERFACE
PURE FUNCTION Eval(obj, x) RESULT(ans)
IMPORT AbstractFunctionND_, DFP
CLASS(AbstractFunctionND_), INTENT(IN) :: obj
REAL(DFP), INTENT(IN) :: x(:)
REAL(DFP) :: ans
END FUNCTION Eval
END INTERFACE
EvalGradient
EvalGradient
computes the first derivative of the function at given argument.
- AbstractFunction1D
- AbstractFunction2D
- AbstractFunction3D
- AbstractFunctionND
ABSTRACT INTERFACE
RECURSIVE PURE FUNCTION EvalGradient(obj, x) RESULT(ans)
IMPORT AbstractFunction1D_, DFP
CLASS(AbstractFunction1D_), INTENT(IN) :: obj
REAL(DFP), INTENT(IN) :: x
REAL(DFP) :: ans
END FUNCTION EvalGradient
END INTERFACE
EvalGradient method for AbstractFunction1D_
ABSTRACT INTERFACE
ELEMENTAL FUNCTION EvalGradient(obj, x, y, dim) RESULT(ans)
IMPORT AbstractFunction2D_, DFP, I4B
CLASS(AbstractFunction2D_), INTENT(IN) :: obj
REAL(DFP), INTENT(IN) :: x
REAL(DFP), INTENT(IN) :: y
INTEGER(I4B), INTENT(IN) :: dim
REAL(DFP) :: ans
END FUNCTION EvalGradient
END INTERFACE
Here, dim
denotes the argument with respect to which the derivative is computed.
ABSTRACT INTERFACE
ELEMENTAL FUNCTION EvalGradient(obj, x, y, z, dim) &
& RESULT(ans)
IMPORT AbstractFunction3D_, DFP, I4B
CLASS(AbstractFunction3D_), INTENT(IN) :: obj
REAL(DFP), INTENT(IN) :: x
REAL(DFP), INTENT(IN) :: y
REAL(DFP), INTENT(IN) :: z
INTEGER(I4B), INTENT(IN) :: dim
REAL(DFP) :: ans
END FUNCTION EvalGradient
END INTERFACE
Here, dim
denotes the argument with respect to which the derivative is computed.
ABSTRACT INTERFACE
PURE FUNCTION EvalGradient(obj, x, dim) RESULT(ans)
IMPORT AbstractFunctionND_, DFP, I4B
CLASS(AbstractFunctionND_), INTENT(IN) :: obj
REAL(DFP), INTENT(IN) :: x(:)
INTEGER(I4B), INTENT(IN) :: dim
REAL(DFP) :: ans
END FUNCTION EvalGradient
END INTERFACE
Here, dim
denotes the argument with respect to which the derivative is computed.
GetVarName
GetVarName
returns the variable name as an instance of String
.