Skip to main content

FEVariable example 54

!!! note "" This example tests POWER (**) operator. Vector, Quadrature

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

!!! note "space"

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

!!! note "time"

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

!!! note "spacetime"

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