FEVariable example 61
!!! note ""
This example tests ABS
operator. Scalar, Nodal Variable.
Use association
- [[FEVariable_]]
Usage
!!! note "Import modules and declare variable"
PROGRAM main
USE easifemBase
IMPLICIT NONE
TYPE(FEVariable_) :: obj
TYPE(FEVariable_) :: ans
!!! note "constant"
obj = ABS(NodalVariable( &
& -2.0_DFP, &
& typeFEVariableScalar, &
& typeFEVariableConstant ))
ans = NodalVariable( 2.0_DFP, &
& typeFEVariableScalar, &
& typeFEVariableConstant )
CALL OK( obj .EQ. ans, "constant:" )
!!! note "space"
obj = ABS(NodalVariable( &
& -arange(1.0_DFP, 3.0_DFP), &
& typeFEVariableScalar, &
& typeFEVariableSpace ) )
ans = NodalVariable( &
& arange(1.0_DFP, 3.0_DFP), &
& typeFEVariableScalar, &
& typeFEVariableSpace )
CALL OK( obj .EQ. ans, "space:" )
!!! note "time"
obj = ABS(NodalVariable( &
& -arange(0.0_DFP, 3.0_DFP), &
& typeFEVariableScalar, &
& typeFEVariableTime ))
ans = NodalVariable( &
& arange(0.0_DFP, 3.0_DFP), &
& typeFEVariableScalar, &
& typeFEVariableTime )
CALL OK( obj .EQ. ans, "time:" )
!!! note "spacetime"
obj = ABS(NodalVariable( &
& reshape(-arange(1.0_DFP, 6.0_DFP), [3,2]), &
& typeFEVariableScalar, &
& typeFEVariableSpaceTime ))
ans = NodalVariable( &
& reshape(arange(1.0_DFP, 6.0_DFP), [3,2]), &
& typeFEVariableScalar, &
& typeFEVariableSpaceTime )
CALL OK( obj .EQ. ans, "spacetime" )
END PROGRAM main