Skip to main content

FEVariable example 63

!!! note "" This example tests ABS operator. Vector, Nodal

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( &
& -arange(1.0_DFP, 3.0_DFP), &
& typeFEVariableVector, &
& typeFEVariableConstant ))
ans = NodalVariable( &
& arange(1.0_DFP, 3.0_DFP), &
& typeFEVariableVector, &
& typeFEVariableConstant )
CALL OK( obj .EQ. ans, "constant:" )

!!! note "space"

  obj = ABS(NodalVariable( &
& reshape(-arange(1.0_DFP, 6.0_DFP), [3,2]), &
& typeFEVariableVector, &
& typeFEVariableSpace ))
ans = NodalVariable( &
& reshape(arange(1.0_DFP, 6.0_DFP), [3,2]), &
& typeFEVariableVector, &
& typeFEVariableSpace )
CALL OK( obj .EQ. ans, "space:" )

!!! note "time"

  obj = ABS(NodalVariable( &
& reshape(-arange(1.0_DFP, 6.0_DFP), [3,2]), &
& typeFEVariableVector, &
& typeFEVariableTime ))
ans = NodalVariable( &
& reshape(arange(1.0_DFP, 6.0_DFP), [3,2]), &
& typeFEVariableVector, &
& typeFEVariableTime )
CALL OK( obj .EQ. ans, "time:" )

!!! note "spacetime"

  obj = ABS(NodalVariable( &
& reshape(-arange(1.0_DFP, 12.0_DFP), [3,2,2]), &
& typeFEVariableVector, &
& typeFEVariableSpaceTime ))
ans = NodalVariable( &
& reshape(arange(1.0_DFP, 12.0_DFP), [3,2,2]), &
& typeFEVariableVector, &
& typeFEVariableSpaceTime )
CALL OK( obj .EQ. ans, "spacetime:" )
END PROGRAM main