Set
Set entries in vector field
Calling example:
Interface 1
- ܀ Interface
- ️܀ See example
- ↢
INTERFACE
MODULE SUBROUTINE Set1(obj, globalNode, VALUE, scale, &
& addContribution)
CLASS(STVectorField_), INTENT(INOUT) :: obj
INTEGER(I4B), INTENT(IN) :: globalNode
REAL(DFP), INTENT(IN) :: VALUE(:, :)
REAL(DFP), OPTIONAL, INTENT(IN) :: scale
LOGICAL(LGT), OPTIONAL, INTENT(IN) :: addContribution
END SUBROUTINE Set1
END INTERFACE
- This routine sets the single entry of the vector field.
- Here,
value
represents the space-time values at a node. - The shape of
value
should be same as (obj%spaceCompo
,obj%timeCompo
).
In this example we test the Set method.
PROGRAM main
USE easifemBase
USE easifemClasses
TYPE( Domain_ ) :: dom
TYPE( STVectorField_ ) :: obj
TYPE( HDF5File_ ) :: meshfile
TYPE( ParameterList_ ) :: param
INTEGER( I4B ) :: ierr
INTEGER( I4B ), PARAMETER :: spaceCompo=2_I4B
INTEGER( I4B ), PARAMETER :: timeCompo=2_I4B
REAL( DFP ), allocatable :: value(:,:)
CHARACTER(*), PARAMETER :: engine = "NATIVE_SERIAL"
! import domain
CALL meshfile%initiate( filename="./mesh.h5", mode="READ" )
CALL meshfile%open()
CALL dom%initiate( hdf5=meshfile, group="" )
CALL meshfile%Deallocate()
! set parameters for VectorField_
CALL FPL_INIT()
CALL param%initiate()
CALL SetSTVectorFieldParam( &
& param=param, &
& fieldType=FIELD_TYPE_NORMAL, &
& name="U", &
& engine=engine, &
& spaceCompo=spaceCompo, &
& timeCompo=timeCompo)
CALL obj%initiate( param, dom )
call reallocate(value, spaceCompo, timeCompo)
call random_number(value)
call obj%set(value=value, globalNode=1)
CALL obj%Display("obj = ")
call display(value, "value = ")
CALL obj%Deallocate(); CALL dom%Deallocate()
CALL param%Deallocate(); CALL FPL_FINALIZE()
END PROGRAM main
# VAR :U
DOF-1 , DOF-2 , DOF-3 , DOF-4 ,
-------, -------, -------, -------,
0.34965, 0.85832, 0.58169, 0.51880,
value =
------------------
0.349652 0.581689
0.858322 0.518797
Interface 2
- ܀ Interface
- ️܀ See example
- ↢
INTERFACE
MODULE SUBROUTINE Set2(obj, VALUE, scale, addContribution)
CLASS(STVectorField_), TARGET, INTENT(INOUT) :: obj
REAL(DFP), INTENT(IN) :: VALUE(:, :)
REAL(DFP), OPTIONAL, INTENT(IN) :: scale
LOGICAL(LGT), OPTIONAL, INTENT(IN) :: addContribution
END SUBROUTINE Set2
END INTERFACE
- This method sets all the nodal values to
value
- Here,
value
represents the space-time values at a node. - The shape of
value
should be same as (obj%spaceCompo
,obj%timeCompo
).
In this example we test the Set method.
PROGRAM main
USE easifemBase
USE easifemClasses
TYPE( Domain_ ) :: dom
TYPE( STVectorField_ ) :: obj
TYPE( HDF5File_ ) :: meshfile
TYPE( ParameterList_ ) :: param
INTEGER( I4B ) :: ierr
INTEGER( I4B ), PARAMETER :: spaceCompo=2_I4B
INTEGER( I4B ), PARAMETER :: timeCompo=2_I4B
REAL( DFP ), allocatable :: value(:,:)
CHARACTER(*), PARAMETER :: engine = "NATIVE_SERIAL"
! import domain
CALL meshfile%initiate( filename="./mesh.h5", mode="READ" )
CALL meshfile%open()
CALL dom%initiate( hdf5=meshfile, group="" )
CALL meshfile%Deallocate()
! set parameters for VectorField_
CALL FPL_INIT()
CALL param%initiate()
CALL SetSTVectorFieldParam( &
& param=param, &
& fieldType=FIELD_TYPE_NORMAL, &
& name="U", &
& engine=engine, &
& spaceCompo=spaceCompo, &
& timeCompo=timeCompo)
CALL obj%initiate( param, dom )
call reallocate(value, spaceCompo, timeCompo)
call random_number(value)
call obj%set(value=value)
CALL obj%Display("obj = ")
call display(value, "value = ")
CALL obj%Deallocate(); CALL dom%Deallocate()
CALL param%Deallocate(); CALL FPL_FINALIZE()
END PROGRAM main
# VAR :U
DOF-1 , DOF-2 , DOF-3 , DOF-4 ,
--------, --------, --------, --------,
0.528645, 0.580276, 0.587390, 0.497406,
0.528645, 0.580276, 0.587390, 0.497406,
0.528645, 0.580276, 0.587390, 0.497406,
# spaceCompo = 2
# timeCompo = 2
value =
------------------
0.528645 0.587390
0.580276 0.497406
Interface 3
INTERFACE
MODULE SUBROUTINE Set3(obj, VALUE, spaceCompo, timeCompo, &
& scale, addContribution)
CLASS(STVectorField_), INTENT(INOUT) :: obj
REAL(DFP), INTENT(IN) :: VALUE
INTEGER(I4B), INTENT(IN) :: spaceCompo
INTEGER(I4B), INTENT(IN) :: timeCompo
REAL(DFP), OPTIONAL, INTENT(IN) :: scale
LOGICAL(LGT), OPTIONAL, INTENT(IN) :: addContribution
END SUBROUTINE Set3
END INTERFACE
- This method sets all the nodal values to
value
- Here,
value
represents the value of space-time component.
Interface 4
- ܀ Interface
- ️܀ See example
- ↢
INTERFACE
MODULE SUBROUTINE Set4(obj, VALUE, scale, addContribution)
CLASS(STVectorField_), INTENT(INOUT) :: obj
REAL(DFP), INTENT(IN) :: VALUE(:, :, :)
REAL(DFP), OPTIONAL, INTENT(IN) :: scale
LOGICAL(LGT), OPTIONAL, INTENT(IN) :: addContribution
END SUBROUTINE Set4
END INTERFACE
- This routine set all entries of space-time vector field.
- All spatial values of all space-time components are set.
value
denotes the space-time nodal vector.- shape of
value
is(spaceCompo, timeCompo, tNodes)
.
In this example we test the Set method.
PROGRAM main
USE easifemBase
USE easifemClasses
TYPE( Domain_ ) :: dom
TYPE( STVectorField_ ) :: obj
TYPE( HDF5File_ ) :: meshfile
TYPE( ParameterList_ ) :: param
INTEGER( I4B ) :: ierr
INTEGER( I4B ), PARAMETER :: spaceCompo=2_I4B
INTEGER( I4B ), PARAMETER :: timeCompo=2_I4B
REAL( DFP ), allocatable :: value(:,:,:)
CHARACTER(*), PARAMETER :: engine = "NATIVE_SERIAL"
INTEGER( I4B ) :: tnodes
! import domain
CALL meshfile%initiate( filename="./mesh.h5", mode="READ" )
CALL meshfile%open()
CALL dom%initiate( hdf5=meshfile, group="" )
CALL meshfile%Deallocate()
! set parameters for VectorField_
CALL FPL_INIT()
CALL param%initiate()
CALL SetSTVectorFieldParam( &
& param=param, &
& fieldType=FIELD_TYPE_NORMAL, &
& name="U", &
& engine=engine, &
& spaceCompo=spaceCompo, &
& timeCompo=timeCompo)
CALL obj%initiate( param, dom )
tnodes = dom%getTotalNodes()
call reallocate(value, spaceCompo, timeCompo, tnodes)
call random_number(value)
call obj%set(value=value)
CALL obj%Display("obj = ")
call display(value(:,:,1:3), "value = ")
CALL obj%Deallocate(); CALL dom%Deallocate()
CALL param%Deallocate(); CALL FPL_FINALIZE()
END PROGRAM main
# VAR :U
DOF-1 , DOF-2 , DOF-3 , DOF-4 ,
--------, --------, --------, --------,
0.468014, 0.193133, 0.825314, 0.189746,
0.870013, 0.165566, 0.767453, 0.480631,
0.544904, 0.097415, 0.914453, 0.895436,
# spaceCompo = 2
# timeCompo = 2
value =( :, :, 1 ) =
---------------------
0.468014 0.825314
0.193133 0.189746
value =( :, :, 2 ) =
---------------------
0.870013 0.767453
0.165566 0.480631
value =( :, :, 3 ) =
---------------------
0.544904 0.914453
0.097415 0.895436
Interface 5
- ܀ Interface
- ️܀ See example
- ↢
INTERFACE
MODULE SUBROUTINE Set5(obj, VALUE, spaceCompo, timeCompo, &
& scale, addContribution)
CLASS(STVectorField_), INTENT(INOUT) :: obj
REAL(DFP), INTENT(IN) :: VALUE(:)
INTEGER(I4B), INTENT(IN) :: spaceCompo
INTEGER(I4B), INTENT(IN) :: timeCompo
REAL(DFP), OPTIONAL, INTENT(IN) :: scale
LOGICAL(LGT), OPTIONAL, INTENT(IN) :: addContribution
END SUBROUTINE Set5
END INTERFACE
- This routine sets all entries
- The entries are selected by specifying
spaceCompo
andtimeCompo
- Size of value should be equal to the
tNodes
In this example we test the Set method.
PROGRAM main
USE easifemBase
USE easifemClasses
TYPE( Domain_ ) :: dom
TYPE( STVectorField_ ) :: obj
TYPE( HDF5File_ ) :: meshfile
TYPE( ParameterList_ ) :: param
INTEGER( I4B ) :: ierr
INTEGER( I4B ), PARAMETER :: spaceCompo=2_I4B
INTEGER( I4B ), PARAMETER :: timeCompo=2_I4B
REAL( DFP ), allocatable :: value(:)
CHARACTER(*), PARAMETER :: engine = "NATIVE_SERIAL"
INTEGER( I4B ) :: tnodes
! import domain
CALL meshfile%initiate( filename="./mesh.h5", mode="READ" )
CALL meshfile%open()
CALL dom%initiate( hdf5=meshfile, group="" )
CALL meshfile%Deallocate()
! set parameters for VectorField_
CALL FPL_INIT()
CALL param%initiate()
CALL SetSTVectorFieldParam( &
& param=param, &
& fieldType=FIELD_TYPE_NORMAL, &
& name="U", &
& engine=engine, &
& spaceCompo=spaceCompo, &
& timeCompo=timeCompo)
CALL obj%initiate( param, dom )
tnodes = dom%getTotalNodes()
call reallocate(value, tnodes)
call random_number(value)
call obj%set(value=value, spaceCompo=2, timeCompo=2)
CALL obj%Display("obj = ")
call display(value(1:3), "value = ")
CALL obj%Deallocate(); CALL dom%Deallocate()
CALL param%Deallocate(); CALL FPL_FINALIZE()
END PROGRAM main
# VAR :U
DOF-1 , DOF-2 , DOF-3 , DOF-4 ,
-------, -------, -------, --------,
0.00000, 0.00000, 0.00000, 0.240216,
0.00000, 0.00000, 0.00000, 0.725414,
0.00000, 0.00000, 0.00000, 0.490273,
.
.
.
# spaceCompo = 2
# timeCompo = 2
value =
--------
0.240216
0.725414
0.490273
Interface 6
- ܀ Interface
- ️܀ See example
- ↢
INTERFACE
MODULE SUBROUTINE Set6(obj, VALUE, spaceCompo, timeCompo, &
& scale, addContribution)
CLASS(STVectorField_), INTENT(INOUT) :: obj
CLASS(ScalarField_), INTENT(IN) :: VALUE
INTEGER(I4B), INTENT(IN) :: spaceCompo
INTEGER(I4B), INTENT(IN) :: timeCompo
REAL(DFP), OPTIONAL, INTENT(IN) :: scale
LOGICAL(LGT), OPTIONAL, INTENT(IN) :: addContribution
END SUBROUTINE Set6
END INTERFACE
- This routine sets all entries
- The entries are selected by specifying
spaceCompo
andtimeCompo
- Size of value should be equal to the
tNodes
- Value can be an instance of child of ScalarField.
In this example we test the Set method.
PROGRAM main
USE easifemBase
USE easifemClasses
TYPE( Domain_ ) :: dom
TYPE( STVectorField_ ) :: obj
TYPE( ScalarField_ ) :: sfield
TYPE( HDF5File_ ) :: meshfile
TYPE( ParameterList_ ) :: param
INTEGER( I4B ) :: ierr
INTEGER( I4B ), PARAMETER :: spaceCompo=2_I4B
INTEGER( I4B ), PARAMETER :: timeCompo=2_I4B
REAL( DFP ), allocatable :: value(:)
CHARACTER(*), PARAMETER :: engine = "NATIVE_SERIAL"
INTEGER( I4B ) :: tnodes
! import domain
CALL meshfile%initiate( filename="./mesh.h5", mode="READ" )
CALL meshfile%open()
CALL dom%initiate( hdf5=meshfile, group="" )
CALL meshfile%Deallocate()
! set parameters for VectorField_
CALL FPL_INIT()
CALL param%initiate()
CALL SetSTVectorFieldParam( &
& param=param, &
& fieldType=FIELD_TYPE_NORMAL, &
& name="U", &
& engine=engine, &
& spaceCompo=spaceCompo, &
& timeCompo=timeCompo)
CALL obj%initiate( param, dom )
CALL SetScalarFieldParam( &
& param=param, &
& fieldType=FIELD_TYPE_NORMAL, &
& name="U", &
& engine='NATIVE_SERIAL')
CALL sfield%initiate( param, dom )
tnodes = dom%getTotalNodes()
call reallocate(value, tnodes)
call random_number(value)
call sfield%set(value)
call obj%set(value=sfield, spaceCompo=2, timeCompo=2)
CALL obj%Display("obj = ")
call display(value(1:3), "value = ")
call sfield%deallocate()
CALL obj%Deallocate(); CALL dom%Deallocate()
CALL param%Deallocate(); CALL FPL_FINALIZE()
END PROGRAM main
# VAR :U
DOF-1 , DOF-2 , DOF-3 , DOF-4 ,
-------, -------, -------, --------,
0.00000, 0.00000, 0.00000, 0.078799,
0.00000, 0.00000, 0.00000, 0.013620,
0.00000, 0.00000, 0.00000, 0.196062,
# spaceCompo = 2
# timeCompo = 2
value =
--------
0.078799
0.013620
0.196062
Interface 7
- ܀ Interface
- ️܀ See example
- ↢
INTERFACE
MODULE SUBROUTINE Set7(obj, VALUE, globalNode, scale, &
& addContribution)
CLASS(STVectorField_), INTENT(INOUT) :: obj
INTEGER(I4B), INTENT(IN) :: globalNode(:)
REAL(DFP), INTENT(IN) :: VALUE(:, :)
REAL(DFP), OPTIONAL, INTENT(IN) :: scale
LOGICAL(LGT), OPTIONAL, INTENT(IN) :: addContribution
END SUBROUTINE Set7
END INTERFACE
- Set multiple entries to constant space-time values
value
denotes the space-time value at a node- shape of
value
should be(spaceCompo, timeCompo)
In this example we test the Set method.
PROGRAM main
USE easifemBase
USE easifemClasses
TYPE( Domain_ ) :: dom
TYPE( STVectorField_ ) :: obj
TYPE( HDF5File_ ) :: meshfile
TYPE( ParameterList_ ) :: param
INTEGER( I4B ) :: ierr
INTEGER( I4B ), PARAMETER :: spaceCompo=2_I4B
INTEGER( I4B ), PARAMETER :: timeCompo=2_I4B
REAL( DFP ), allocatable :: value(:,:)
CHARACTER(*), PARAMETER :: engine = "NATIVE_SERIAL"
INTEGER( I4B ) :: tnodes
! import domain
CALL meshfile%initiate( filename="./mesh.h5", mode="READ" )
CALL meshfile%open()
CALL dom%initiate( hdf5=meshfile, group="" )
CALL meshfile%Deallocate()
! set parameters for VectorField_
CALL FPL_INIT()
CALL param%initiate()
CALL SetSTVectorFieldParam( &
& param=param, &
& fieldType=FIELD_TYPE_NORMAL, &
& name="U", &
& engine=engine, &
& spaceCompo=spaceCompo, &
& timeCompo=timeCompo)
CALL obj%initiate( param, dom )
tnodes = dom%getTotalNodes()
call reallocate(value, spaceCompo, timeCompo)
call random_number(value)
call obj%set(value=value, globalNode=arange(1,3,1))
CALL obj%Display("obj = ")
call display(value, "value = ")
CALL obj%Deallocate(); CALL dom%Deallocate()
CALL param%Deallocate(); CALL FPL_FINALIZE()
END PROGRAM main
# VAR :U
DOF-1 , DOF-2 , DOF-3 , DOF-4 ,
-------, -------, -------, -------,
0.67445, 0.46107, 0.49075, 0.28486,
0.67445, 0.46107, 0.49075, 0.28486,
0.67445, 0.46107, 0.49075, 0.28486,
0.00000, 0.00000, 0.00000, 0.00000,
# spaceCompo = 2
# timeCompo = 2
value =
------------------
0.674452 0.490747
0.461071 0.284857
Interface 8
- ܀ Interface
- ️܀ See example
- ↢
INTERFACE
MODULE SUBROUTINE Set8(obj, globalNode, VALUE, scale, &
& addContribution)
CLASS(STVectorField_), INTENT(INOUT) :: obj
INTEGER(I4B), INTENT(IN) :: globalNode(:)
REAL(DFP), INTENT(IN) :: VALUE(:, :, :)
REAL(DFP), OPTIONAL, INTENT(IN) :: scale
LOGICAL(LGT), OPTIONAL, INTENT(IN) :: addContribution
END SUBROUTINE Set8
END INTERFACE
This routine sets selected entries of space-time vector field. Here
globalNode
contains the list of global nodes where values will be changed.
value
is a rank-3 array iniaJ
format.- Its first index denotes the space component,
- second index denotes the time components
- third component denotes the space node number.
The size of dimension should be equal to the size of globalNode.
- This routine sets the selected entries.
- Size of globalNode should be same as
size(value, 3)
. value
denotes the spacet-time nodal values ofglobalNode
.- number of rows in
value
should bespaceCompo
. - number of columns in
value
should betimeCompo
.
In this example we test the Set method.
PROGRAM main
USE easifemBase
USE easifemClasses
TYPE( Domain_ ) :: dom
TYPE( STVectorField_ ) :: obj
TYPE( HDF5File_ ) :: meshfile
TYPE( ParameterList_ ) :: param
INTEGER( I4B ) :: ierr
INTEGER( I4B ), PARAMETER :: spaceCompo=2_I4B
INTEGER( I4B ), PARAMETER :: timeCompo=2_I4B
REAL( DFP ), allocatable :: value(:,:,:)
CHARACTER(*), PARAMETER :: engine = "NATIVE_SERIAL"
INTEGER( I4B ) :: tnodes
! import domain
CALL meshfile%initiate( filename="./mesh.h5", mode="READ" )
CALL meshfile%open()
CALL dom%initiate( hdf5=meshfile, group="" )
CALL meshfile%Deallocate()
! set parameters for VectorField_
CALL FPL_INIT()
CALL param%initiate()
CALL SetSTVectorFieldParam( &
& param=param, &
& fieldType=FIELD_TYPE_NORMAL, &
& name="U", &
& engine=engine, &
& spaceCompo=spaceCompo, &
& timeCompo=timeCompo)
CALL obj%initiate( param, dom )
tnodes = dom%getTotalNodes()
call reallocate(value, spaceCompo, timeCompo, 3)
call random_number(value)
call obj%set(value=value, globalNode=arange(1,3,1))
CALL obj%Display("obj = ")
call display(value, "value = ")
CALL obj%Deallocate(); CALL dom%Deallocate()
CALL param%Deallocate(); CALL FPL_FINALIZE()
END PROGRAM main
# VAR :U
DOF-1 , DOF-2 , DOF-3 , DOF-4 ,
-------, -------, -------, -------,
0.46750, 0.55129, 0.07768, 0.45851,
0.81421, 0.06531, 0.97146, 0.55950,
0.07182, 0.96061, 0.15547, 0.89446,
# spaceCompo = 2
# timeCompo = 2
value =( :, :, 1 ) =
---------------------
0.467503 0.077684
0.551291 0.458512
value =( :, :, 2 ) =
---------------------
0.814213 0.971461
0.065310 0.559495
value =( :, :, 3 ) =
---------------------
0.071824 0.155473
0.960612 0.894463
Interface 9
- ܀ Interface
- ️܀ See example
- ↢
INTERFACE
MODULE SUBROUTINE Set9(obj, VALUE, globalNode, spaceCompo, &
& timeCompo, scale, addContribution)
CLASS(STVectorField_), INTENT(INOUT) :: obj
REAL(DFP), INTENT(IN) :: VALUE(:)
INTEGER(I4B), INTENT(IN) :: globalNode(:)
INTEGER(I4B), INTENT(IN) :: spaceCompo
INTEGER(I4B), INTENT(IN) :: timeCompo
REAL(DFP), OPTIONAL, INTENT(IN) :: scale
LOGICAL(LGT), OPTIONAL, INTENT(IN) :: addContribution
END SUBROUTINE Set9
END INTERFACE
- This routine sets the multiple values of a space-time component.
- Size of
value
should be equal to size ofglobalNode
.
In this example we test the Set method.
PROGRAM main
USE easifemBase
USE easifemClasses
TYPE( Domain_ ) :: dom
TYPE( STVectorField_ ) :: obj
TYPE( HDF5File_ ) :: meshfile
TYPE( ParameterList_ ) :: param
INTEGER( I4B ) :: ierr
INTEGER( I4B ), PARAMETER :: spaceCompo=2_I4B
INTEGER( I4B ), PARAMETER :: timeCompo=2_I4B
REAL( DFP ), allocatable :: value(:,:,:)
CHARACTER(*), PARAMETER :: engine = "NATIVE_SERIAL"
INTEGER( I4B ) :: tnodes
! import domain
CALL meshfile%initiate( filename="./mesh.h5", mode="READ" )
CALL meshfile%open()
CALL dom%initiate( hdf5=meshfile, group="" )
CALL meshfile%Deallocate()
! set parameters for VectorField_
CALL FPL_INIT()
CALL param%initiate()
CALL SetSTVectorFieldParam( &
& param=param, &
& fieldType=FIELD_TYPE_NORMAL, &
& name="U", &
& engine=engine, &
& spaceCompo=spaceCompo, &
& timeCompo=timeCompo)
CALL obj%initiate( param, dom )
tnodes = dom%getTotalNodes()
call reallocate(value, spaceCompo, timeCompo, 3)
call random_number(value)
call obj%set(value=value(1,1,:), globalNode=arange(1,3,1), spaceCompo=1, timeCompo=1)
call obj%set(value=value(1,2,:), globalNode=arange(1,3,1), spaceCompo=1, timeCompo=2)
call obj%set(value=value(2,1,:), globalNode=arange(1,3,1), spaceCompo=2, timeCompo=1)
call obj%set(value=value(2,2,:), globalNode=arange(1,3,1), spaceCompo=2, timeCompo=2)
CALL obj%Display("obj = ")
call display(value, "value = ")
CALL obj%Deallocate(); CALL dom%Deallocate()
CALL param%Deallocate(); CALL FPL_FINALIZE()
END PROGRAM main
# VAR :U
DOF-1 , DOF-2 , DOF-3 , DOF-4 ,
-------, -------, -------, -------,
0.39222, 0.32577, 0.38798, 0.37918,
0.40475, 0.43177, 0.77874, 0.58285,
0.01328, 0.98929, 0.60267, 0.96886,
# spaceCompo = 2
# timeCompo = 2
value =( :, :, 1 ) =
---------------------
0.392217 0.387975
0.325772 0.379176
value =( :, :, 2 ) =
---------------------
0.404755 0.778743
0.431771 0.582854
value =( :, :, 3 ) =
---------------------
0.013282 0.602673
0.989292 0.968863
Interface 10
- ܀ Interface
- ️܀ See example
- ↢
INTERFACE
MODULE SUBROUTINE Set10(obj, VALUE, globalNode, spaceCompo, &
& timeCompo, scale, addContribution)
CLASS(STVectorField_), INTENT(INOUT) :: obj
REAL(DFP), INTENT(IN) :: VALUE
INTEGER(I4B), INTENT(IN) :: globalNode
INTEGER(I4B), INTENT(IN) :: spaceCompo
INTEGER(I4B), INTENT(IN) :: timeCompo
REAL(DFP), OPTIONAL, INTENT(IN) :: scale
LOGICAL(LGT), OPTIONAL, INTENT(IN) :: addContribution
END SUBROUTINE Set10
END INTERFACE
- This routine sets a single entry of space-time component
In this example we test the Set method.
PROGRAM main
USE easifemBase
USE easifemClasses
TYPE( Domain_ ) :: dom
TYPE( STVectorField_ ) :: obj
TYPE( HDF5File_ ) :: meshfile
TYPE( ParameterList_ ) :: param
INTEGER( I4B ) :: ierr
INTEGER( I4B ), PARAMETER :: spaceCompo=2_I4B
INTEGER( I4B ), PARAMETER :: timeCompo=2_I4B
REAL( DFP ), allocatable :: value(:,:)
CHARACTER(*), PARAMETER :: engine = "NATIVE_SERIAL"
INTEGER( I4B ) :: tnodes
! import domain
CALL meshfile%initiate( filename="./mesh.h5", mode="READ" )
CALL meshfile%open()
CALL dom%initiate( hdf5=meshfile, group="" )
CALL meshfile%Deallocate()
! set parameters for VectorField_
CALL FPL_INIT()
CALL param%initiate()
CALL SetSTVectorFieldParam( &
& param=param, &
& fieldType=FIELD_TYPE_NORMAL, &
& name="U", &
& engine=engine, &
& spaceCompo=spaceCompo, &
& timeCompo=timeCompo)
CALL obj%initiate( param, dom )
tnodes = dom%getTotalNodes()
call reallocate(value, spaceCompo, timeCompo)
call random_number(value)
call obj%set(value=value(1,1), globalNode=1, spaceCompo=1, timeCompo=1)
call obj%set(value=value(1,2), globalNode=1, spaceCompo=1, timeCompo=2)
call obj%set(value=value(2,1), globalNode=1, spaceCompo=2, timeCompo=1)
call obj%set(value=value(2,2), globalNode=1, spaceCompo=2, timeCompo=2)
CALL obj%Display("obj = ")
call display(value, "value = ")
CALL obj%Deallocate(); CALL dom%Deallocate()
CALL param%Deallocate(); CALL FPL_FINALIZE()
END PROGRAM main
# VAR :U
DOF-1 , DOF-2 , DOF-3 , DOF-4 ,
-------, -------, -------, -------,
0.37009, 0.06559, 0.60917, 0.68589,
0.00000, 0.00000, 0.00000, 0.00000,
# spaceCompo = 2
# timeCompo = 2
value =
------------------
0.370091 0.609166
0.065591 0.685886
Interface 11
- ܀ Interface
- ️܀ See example
- ↢
INTERFACE
MODULE SUBROUTINE Set11(obj, VALUE, istart, iend, stride, &
& scale, addContribution)
CLASS(STVectorField_), INTENT(INOUT) :: obj
INTEGER(I4B), INTENT(IN) :: istart
INTEGER(I4B), INTENT(IN) :: iend
INTEGER(I4B), INTENT(IN) :: stride
REAL(DFP), INTENT(IN) :: VALUE(:, :)
REAL(DFP), OPTIONAL, INTENT(IN) :: scale
LOGICAL(LGT), OPTIONAL, INTENT(IN) :: addContribution
END SUBROUTINE Set11
END INTERFACE
- Sets multiple values using triplets.
value
denotes the space-time values at a single node.- Shape of
value
should be (spaceCompo, timeCompo
).
In this example we test the Set method.
PROGRAM main
USE easifemBase
USE easifemClasses
TYPE( Domain_ ) :: dom
TYPE( STVectorField_ ) :: obj
TYPE( HDF5File_ ) :: meshfile
TYPE( ParameterList_ ) :: param
INTEGER( I4B ) :: ierr
INTEGER( I4B ), PARAMETER :: spaceCompo=2_I4B
INTEGER( I4B ), PARAMETER :: timeCompo=2_I4B
REAL( DFP ), allocatable :: value(:,:)
CHARACTER(*), PARAMETER :: engine = "NATIVE_SERIAL"
INTEGER( I4B ) :: tnodes
! import domain
CALL meshfile%initiate( filename="./mesh.h5", mode="READ" )
CALL meshfile%open()
CALL dom%initiate( hdf5=meshfile, group="" )
CALL meshfile%Deallocate()
! set parameters for VectorField_
CALL FPL_INIT()
CALL param%initiate()
CALL SetSTVectorFieldParam( &
& param=param, &
& fieldType=FIELD_TYPE_NORMAL, &
& name="U", &
& engine=engine, &
& spaceCompo=spaceCompo, &
& timeCompo=timeCompo)
CALL obj%initiate( param, dom )
tnodes = dom%getTotalNodes()
call reallocate(value, spaceCompo, timeCompo)
call random_number(value)
call obj%set(value=value, istart=1, iend=3, stride=1)
CALL obj%Display("obj = ")
call display(value, "value = ")
CALL obj%Deallocate(); CALL dom%Deallocate()
CALL param%Deallocate(); CALL FPL_FINALIZE()
END PROGRAM main
# VAR :U
DOF-1 , DOF-2 , DOF-3 , DOF-4 ,
-------, -------, -------, -------,
0.90636, 0.66777, 0.07872, 0.91638,
0.90636, 0.66777, 0.07872, 0.91638,
0.90636, 0.66777, 0.07872, 0.91638,
# spaceCompo = 2
# timeCompo = 2
value =
------------------
0.906358 0.078718
0.667770 0.916383
Interface 12
- ܀ Interface
- ️܀ See example
- ↢
INTERFACE
MODULE SUBROUTINE Set12(obj, VALUE, istart, iend, stride, &
& scale, addContribution)
CLASS(STVectorField_), INTENT(INOUT) :: obj
REAL(DFP), INTENT(IN) :: VALUE(:, :, :)
INTEGER(I4B), INTENT(IN) :: istart
INTEGER(I4B), INTENT(IN) :: iend
INTEGER(I4B), INTENT(IN) :: stride
REAL(DFP), OPTIONAL, INTENT(IN) :: scale
LOGICAL(LGT), OPTIONAL, INTENT(IN) :: addContribution
END SUBROUTINE Set12
END INTERFACE
- Sets multiple values using triplets.
value
denotes the space-time values at several nodes.value(:,:,i)
denotes the space-time value at ith node.- Shape of
value(:,:,i)
should be (spaceCompo, timeCompo
).
In this example we test the Set method.
PROGRAM main
USE easifemBase
USE easifemClasses
TYPE( Domain_ ) :: dom
TYPE( STVectorField_ ) :: obj
TYPE( HDF5File_ ) :: meshfile
TYPE( ParameterList_ ) :: param
INTEGER( I4B ) :: ierr
INTEGER( I4B ), PARAMETER :: spaceCompo=2_I4B
INTEGER( I4B ), PARAMETER :: timeCompo=2_I4B
REAL( DFP ), allocatable :: value(:,:,:)
CHARACTER(*), PARAMETER :: engine = "NATIVE_SERIAL"
INTEGER( I4B ) :: tnodes
! import domain
CALL meshfile%initiate( filename="./mesh.h5", mode="READ" )
CALL meshfile%open()
CALL dom%initiate( hdf5=meshfile, group="" )
CALL meshfile%Deallocate()
! set parameters for VectorField_
CALL FPL_INIT()
CALL param%initiate()
CALL SetSTVectorFieldParam( &
& param=param, &
& fieldType=FIELD_TYPE_NORMAL, &
& name="U", &
& engine=engine, &
& spaceCompo=spaceCompo, &
& timeCompo=timeCompo)
CALL obj%initiate( param, dom )
tnodes = dom%getTotalNodes()
call reallocate(value, spaceCompo, timeCompo, 3)
call random_number(value)
call obj%set(value=value, istart=1, iend=3, stride=1)
CALL obj%Display("obj = ")
call display(value, "value = ")
CALL obj%Deallocate(); CALL dom%Deallocate()
CALL param%Deallocate(); CALL FPL_FINALIZE()
END PROGRAM main
# VAR :U
DOF-1 , DOF-2 , DOF-3 , DOF-4 ,
-------, -------, -------, -------,
0.06771, 0.75442, 0.55908, 0.83616,
0.01938, 0.87443, 0.81103, 0.40416,
0.28662, 0.20294, 0.19123, 0.15446,
# spaceCompo = 2
# timeCompo = 2
value =( :, :, 1 ) =
---------------------
0.067713 0.559079
0.754420 0.836164
value =( :, :, 2 ) =
---------------------
0.019376 0.811034
0.874427 0.404164
value =( :, :, 3 ) =
---------------------
0.286623 0.191233
0.202942 0.154461
Interface 13
- ܀ Interface
- ️܀ See example
- ↢
INTERFACE
MODULE SUBROUTINE Set13(obj, VALUE, globalNode, scale, &
& addContribution)
CLASS(STVectorField_), INTENT(INOUT) :: obj
TYPE(FEVariable_), INTENT(IN) :: VALUE
INTEGER(I4B), INTENT(IN) :: globalNode(:)
REAL(DFP), OPTIONAL, INTENT(IN) :: scale
LOGICAL(LGT), OPTIONAL, INTENT(IN) :: addContribution
END SUBROUTINE Set13
END INTERFACE
- Set multiple values by using FEVariable.
- FEVariable,
value
, should be ofSpaceTime
type
In this example we test the Set method.
PROGRAM main
USE easifemBase
USE easifemClasses
TYPE( Domain_ ) :: dom
TYPE( STVectorField_ ) :: obj
TYPE( HDF5File_ ) :: meshfile
TYPE( ParameterList_ ) :: param
INTEGER( I4B ) :: ierr
INTEGER( I4B ), PARAMETER :: spaceCompo=2_I4B
INTEGER( I4B ), PARAMETER :: timeCompo=2_I4B
REAL( DFP ), allocatable :: value(:,:,:)
CHARACTER(*), PARAMETER :: engine = "NATIVE_SERIAL"
INTEGER( I4B ) :: tnodes
TYPE(FEVariable_) :: fevar
! import domain
CALL meshfile%initiate( filename="./mesh.h5", mode="READ" )
CALL meshfile%open()
CALL dom%initiate( hdf5=meshfile, group="" )
CALL meshfile%Deallocate()
! set parameters for VectorField_
CALL FPL_INIT()
CALL param%initiate()
CALL SetSTVectorFieldParam( &
& param=param, &
& fieldType=FIELD_TYPE_NORMAL, &
& name="U", &
& engine=engine, &
& spaceCompo=spaceCompo, &
& timeCompo=timeCompo)
CALL obj%initiate( param, dom )
tnodes = dom%getTotalNodes()
call reallocate(value, spaceCompo, timeCompo, 3)
call random_number(value)
fevar = NodalVariable(value, TypeFEVariableVector, TypeFEVariableSpaceTime)
call obj%set(value=fevar, globalNode=arange(1,3,1))
CALL obj%Display("obj = ")
call display(value, "value = ")
CALL obj%Deallocate(); CALL dom%Deallocate()
CALL param%Deallocate(); CALL FPL_FINALIZE()
END PROGRAM main
DOF-1 , DOF-2 , DOF-3 , DOF-4 ,
-------, -------, -------, -------,
0.90416, 0.77363, 0.66872, 0.70278,
0.70275, 0.77907, 0.21098, 0.01168,
0.82073, 0.79908, 0.09018, 0.52359,
# spaceCompo = 2
# timeCompo = 2
value =( :, :, 1 ) =
---------------------
0.904156 0.668723
0.773634 0.702783
value =( :, :, 2 ) =
---------------------
0.702748 0.210977
0.779073 0.011683
value =( :, :, 3 ) =
---------------------
0.820733 0.090183
0.799077 0.523587
Interface 14
- ܀ Interface
- ️܀ See example
- ↢
INTERFACE
MODULE SUBROUTINE Set14(obj, VALUE, scale, addContribution)
CLASS(STVectorField_), INTENT(INOUT) :: obj
REAL(DFP), INTENT(IN) :: VALUE
REAL(DFP), OPTIONAL, INTENT(IN) :: scale
LOGICAL(LGT), OPTIONAL, INTENT(IN) :: addContribution
END SUBROUTINE Set14
END INTERFACE
- Sets all values to a given scalar value.
In this example we test the Set method.
PROGRAM main
USE easifemBase
USE easifemClasses
TYPE( Domain_ ) :: dom
TYPE( STVectorField_ ) :: obj
TYPE( HDF5File_ ) :: meshfile
TYPE( ParameterList_ ) :: param
INTEGER( I4B ) :: ierr
INTEGER( I4B ), PARAMETER :: spaceCompo=2_I4B
INTEGER( I4B ), PARAMETER :: timeCompo=2_I4B
REAL( DFP ) :: value
CHARACTER(*), PARAMETER :: engine = "NATIVE_SERIAL"
INTEGER( I4B ) :: tnodes
! import domain
CALL meshfile%initiate( filename="./mesh.h5", mode="READ" )
CALL meshfile%open()
CALL dom%initiate( hdf5=meshfile, group="" )
CALL meshfile%Deallocate()
! set parameters for VectorField_
CALL FPL_INIT()
CALL param%initiate()
CALL SetSTVectorFieldParam( &
& param=param, &
& fieldType=FIELD_TYPE_NORMAL, &
& name="U", &
& engine=engine, &
& spaceCompo=spaceCompo, &
& timeCompo=timeCompo)
CALL obj%initiate( param, dom )
tnodes = dom%getTotalNodes()
call random_number(value)
call obj%set(value=value)
CALL obj%Display("obj = ")
call display(value, "value = ")
CALL obj%Deallocate(); CALL dom%Deallocate()
CALL param%Deallocate(); CALL FPL_FINALIZE()
END PROGRAM main
# VAR :U
DOF-1 , DOF-2 , DOF-3 , DOF-4 ,
--------, --------, --------, --------,
0.720954, 0.720954, 0.720954, 0.720954,
0.720954, 0.720954, 0.720954, 0.720954,
0.720954, 0.720954, 0.720954, 0.720954,
# spaceCompo = 2
# timeCompo = 2
value = 0.720954