Set
Set entries in vector field.
Calling example:
Interface 1
- ܀ Interface
- ️܀ See example
- ↢
INTERFACE
MODULE SUBROUTINE set1(obj, globalNode, VALUE, &
& scale, addContribution)
CLASS(VectorFieldLis_), 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
should be a vector representing the components of a vector.
The size of value
should be same as obj%spaceCompo
.
In simple words it does following.
vector( 1:spaceCompo, globalNode ) = value( 1:spaceCompo )
In this example we test the Set method.
PROGRAM main
USE easifemBase
USE easifemClasses
TYPE( Domain_ ) :: dom
TYPE( VectorFieldLis_ ) :: obj
TYPE( HDF5File_ ) :: meshfile
TYPE( ParameterList_ ) :: param
INTEGER( I4B ) :: ierr
INTEGER( I4B ), PARAMETER :: spaceCompo=2_I4B
CHARACTER(*), PARAMETER :: engine = "LIS_OMP"
REAL( DFP ), allocatable :: value(:)
! 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 SetVectorFieldParam( param=param, &
& fieldType=FIELD_TYPE_NORMAL, &
& name="U", &
& engine=engine, &
& spaceCompo=spaceCompo)
CALL obj%initiate( param, dom )
!! set a single entry
CALL Reallocate(value, spaceCompo)
CALL Random_number(value)
CALL Display(value, "value = ")
CALL obj%set(value=value, globalNode=1)
CALL obj%set(value=value, globalNode=2)
CALL obj%set(value=value, globalNode=3)
CALL obj%Display("obj = ")
CALL obj%Deallocate(); CALL dom%Deallocate()
CALL param%Deallocate(); CALL FPL_FINALIZE()
END PROGRAM main
Results
value =
--------
0.574890
0.598815
# VAR :U
DOF-1 , DOF-2 ,
-------, -------,
0.57489, 0.59881,
0.57489, 0.59881,
0.57489, 0.59881,
Interface 2
INTERFACE
MODULE SUBROUTINE set2(obj, VALUE, scale, addContribution)
CLASS(VectorFieldLis_), 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
- The size of value should be same as the
obj%spaceCompo
vector( 1:spaceCompo, i ) = value( 1:spaceCompo ), for i = 1, tNodes
Interface 3
INTERFACE
MODULE SUBROUTINE set3(obj, VALUE, spaceCompo, scale, addContribution)
CLASS(VectorFieldLis_), INTENT(INOUT) :: obj
REAL(DFP), INTENT(IN) :: VALUE
INTEGER(I4B), INTENT(IN) :: spaceCompo
REAL(DFP), OPTIONAL, INTENT(IN) :: scale
LOGICAL(LGT), OPTIONAL, INTENT(IN) :: addContribution
END SUBROUTINE set3
END INTERFACE
- This routine sets all values of
spaceCompo
component of the vector field to a given scalar valuevalue
.
vector( spaceCompo, i ) = value, for i = 1, tNodes
Interface 4
INTERFACE
MODULE SUBROUTINE set4(obj, VALUE, scale, addContribution)
CLASS(VectorFieldLis_), 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 vector field to given vector
- Here shape of should be
value(1:spaceCompo, tNodes)
.
vector( :, : ) = value( :, : )
Interface 5
INTERFACE
MODULE SUBROUTINE set5(obj, VALUE, spaceCompo, scale, addContribution)
CLASS(VectorFieldLis_), INTENT(INOUT) :: obj
REAL(DFP), INTENT(IN) :: VALUE(:)
INTEGER(I4B), INTENT(IN) :: spaceCompo
REAL(DFP), OPTIONAL, INTENT(IN) :: scale
LOGICAL(LGT), OPTIONAL, INTENT(IN) :: addContribution
END SUBROUTINE set5
END INTERFACE
- This routine sets all entries of the component
spaceCompo
of VectorFieldLis to a given fortran vectorvalue
vector( spaceCompo, : ) = value( : )
- The size of
value
should be equal to the tNodes.
Interface 6
INTERFACE
MODULE SUBROUTINE set6(obj, VALUE, spaceCompo, scale, addContribution)
CLASS(VectorFieldLis_), INTENT(INOUT) :: obj
TYPE(ScalarField_), INTENT(IN) :: VALUE
INTEGER(I4B), INTENT(IN) :: spaceCompo
REAL(DFP), OPTIONAL, INTENT(IN) :: scale
LOGICAL(LGT), OPTIONAL, INTENT(IN) :: addContribution
END SUBROUTINE set6
END INTERFACE
- This routine sets all entries of the component
spaceCompo
of VectorFieldLis to a given ScalarFieldvalue
vector( spaceCompo, : ) = value
Interface 7
INTERFACE
MODULE SUBROUTINE set7(obj, VALUE, globalNode, scale, addContribution)
CLASS(VectorFieldLis_), 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
- This soubroutine sets the selected enties to a vector entry
value( : )
- Size of
value
should be equal to theobj%spaceCompo
Effectively it does the following:
vector( :, globalNode ) = value( : ), for entries in global nodes
Interface 8
INTERFACE
MODULE SUBROUTINE set8(obj, globalNode, VALUE, scale, &
& addContribution)
CLASS(VectorFieldLis_), INTENT(INOUT) :: obj
INTEGER(I4B), INTENT(IN) :: globalNode(:)
REAL(DFP), INTENT(IN) :: VALUE(:, :)
!! value is in value(i,J) format.
REAL(DFP), OPTIONAL, INTENT(IN) :: scale
LOGICAL(LGT), OPTIONAL, INTENT(IN) :: addContribution
END SUBROUTINE set8
END INTERFACE
- This routine sets the selected entries.
vector( :, globalNode ) = value( :, : )
Interface 9
INTERFACE
MODULE SUBROUTINE set9(obj, VALUE, globalNode, spaceCompo, scale, &
& addContribution)
CLASS(VectorFieldLis_), INTENT(INOUT) :: obj
REAL(DFP), INTENT(IN) :: VALUE(:)
INTEGER(I4B), INTENT(IN) :: globalNode(:)
INTEGER(I4B), INTENT(IN) :: spaceCompo
REAL(DFP), OPTIONAL, INTENT(IN) :: scale
LOGICAL(LGT), OPTIONAL, INTENT(IN) :: addContribution
END SUBROUTINE set9
END INTERFACE
- This routine sets the multiple values
- Size of
value
should be equal to size ofglobalNode
vector( spaceCompo, globalNode ) = value( : )
Interface 10
INTERFACE
MODULE SUBROUTINE set10(obj, VALUE, globalNode, spaceCompo, scale, &
& addContribution)
CLASS(VectorFieldLis_), INTENT(INOUT) :: obj
REAL(DFP), INTENT(IN) :: VALUE
INTEGER(I4B), INTENT(IN) :: globalNode
INTEGER(I4B), INTENT(IN) :: spaceCompo
REAL(DFP), OPTIONAL, INTENT(IN) :: scale
LOGICAL(LGT), OPTIONAL, INTENT(IN) :: addContribution
END SUBROUTINE set10
END INTERFACE
- This routine sets a single entry
Interface 11
INTERFACE
MODULE SUBROUTINE set13(obj, VALUE, globalNode, scale, &
& addContribution)
CLASS(VectorFieldLis_), 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
Sets the multiple values using FEVariable.
Interface 12
INTERFACE
MODULE SUBROUTINE set12(obj, VALUE, istart, iend, stride, scale, &
& addContribution)
CLASS(VectorFieldLis_), 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
Interface 13
INTERFACE
MODULE SUBROUTINE set13(obj, VALUE, globalNode, scale, &
& addContribution)
CLASS(VectorFieldLis_), 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
Interface 14
INTERFACE
MODULE SUBROUTINE set14(obj, VALUE, scale, addContribution)
CLASS(VectorFieldLis_), 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