Set
Set entries of MatrixField.
Calling example:
Set(
MatrixField_::obj
int::globalNode(:)
real::value(:,:)
int::storageFMT
<real::scale>
<bool::addContribution>
)
CALL Set(
MatrixField_::obj
<int::globalNode(:)>
real::value
<int::scale >
<bool::addContribution>
)
CALL Set(
MatrixField_ :: obj
int :: iNodeNum
int :: jNodeNum
int :: idof
int :: jdof
real :: value
<real :: scale>
<bool :: addContribution>
)
Set(
MatrixField_ :: obj
int :: iNodeNum(:)
int :: jNodeNum(:)
int :: ivar
int :: jvar
real:: value(:,:)
<real:: scale>
<bool:: addContribution>
)
CALL Set(
MatrixField_ :: obj
int :: iNodeNum(:)
int :: jNodeNum(:)
int :: ivar
int :: jvar
int :: idof
int :: jdof
real:: value(:,:)
<real:: scale>
<bool:: addContribution>
)
CALL Set(
MatrixField_:: obj
int :: iNodeNum(:)
int :: jNodeNum(:)
int :: ivar
int :: jvar
int :: idof
int :: jdof
real :: value(:,:)
<real :: scale>
<bool :: addContribution>
)
Interface 1
- 𑗍 Set 1
- ️܀ See example
- ↢
INTERFACE
MODULE SUBROUTINE Set( obj, globalNode, value, storageFMT, scale, &
& addContribution )
CLASS( MatrixField_ ), INTENT( INOUT ) :: obj
INTEGER( I4B ), INTENT( IN ) :: globalNode(:)
REAL( DFP ), INTENT( IN ) :: value(:,:)
INTEGER( I4B ), INTENT( IN ) :: storageFMT
REAL( DFP ), OPTIONAL, INTENT( IN ) :: scale
LOGICAL( LGT ), OPTIONAL, INTENT( IN ) :: addContribution
END SUBROUTINE Set
END INTERFACE
IF addContribution and scale is ABSENT then:
- This subroutine sets a block of data to matrix.
- This block data is contained in
value(:,:) - The size of
valueshould betdof *size( globalNode ), wheretdofis the total degrees of freedom globalNodecontains the global node numberstorageFMTis the storage format ofvalue(:,:), it can beDOF_FMT, orFMT_NODES.
If addContribution and scale are present then:
- This subroutine adds a block of data to matrix.
- This block data is contained in
value(:,:) - The size of
valueshould betdof* size( globalNode ) globalNodecontains the global node numberstorageFMTis the storage format ofvalue(:,:), it can beDOF_FMT, orFMT_NODES.scaleis scaling used for value.
This method cannot be called for Rectangle MatrixField
In this example we show how to set entries in MatrixField.
PROGRAM main
USE easifemBase
USE easifemClasses
IMPLICIT NONE
TYPE( Domain_) :: dom
TYPE( MatrixFieldLis_ ) :: obj
TYPE( HDF5File_) :: meshfile
TYPE( ParameterList_ ) :: param
TYPE( RealMatrix_ ) :: realmat
INTEGER( I4B ) :: ierr
REAL( DFP ), ALLOCATABLE :: realVec( : )
CHARACTER(LEN=*), PARAMETER :: filename="./test_4.h5"
CHARACTER(LEN=*), PARAMETER :: engine="LIS_OMP"
CHARACTER( LEN = * ), PARAMETER :: name="K"
CHARACTER( LEN = * ), PARAMETER :: matrixProp="UNSYM"
INTEGER( I4B ), PARAMETER :: spaceCompo = 1
INTEGER( I4B ), PARAMETER :: timeCompo = 1
CALL FPL_INIT(); CALL param%Initiate()
CALL meshfile%Initiate( filename="./mesh.h5", mode="READ" )
CALL meshfile%Open()
CALL dom%Initiate( meshfile, "" ); CALL meshfile%Close()
CALL dom%InitiateNodeToNodes()
CALL meshfile%Deallocate()
CALL SetMatrixFieldParam( &
& param=param, &
& name="K", &
& matrixProp="UNSYM", &
& engine=engine, &
& spaceCompo=spaceCompo, &
& timeCompo=timeCompo, &
& fieldType=FIELD_TYPE_NORMAL )
CALL obj%Initiate( param, dom )
CALL Initiate( realmat, 3, 3 )
CALL SET(realmat, val=[1.0_DFP, 2._DFP, 3._DFP], indx=1, &
& extraOption=MATRIX_ROW)
CALL SET(realmat, val=[4.0_DFP, 5._DFP, 6._DFP], indx=2, &
& extraOption=MATRIX_ROW)
CALL SET(realmat, val=[7.0_DFP, 8._DFP, 9._DFP], indx=3, &
& extraOption=MATRIX_ROW)
CALL Display(realmat, "realmat = ")
CALL obj%Set( &
& globalNode=[1,5,10], &
& value=realmat%val, &
& storageFMT=FMT_NODES )
realmat = obj%mat
CALL Display(MdEncode(realmat%val), "obj%mat = ")
CALL obj%Deallocate()
CALL dom%Deallocate()
CALL param%Deallocate(); CALL FPL_FINALIZE()
END PROGRAM main
Results:
obj%mat =
| 1 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 3 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 4 | 0 | 0 | 0 | 5 | 0 | 0 | 0 | 0 | 6 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 7 | 0 | 0 | 0 | 8 | 0 | 0 | 0 | 0 | 9 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Interface 2
- 𑗍 Set 2
- ️܀ See example
- ↢
INTERFACE
MODULE SUBROUTINE Set( obj, globalNode, value, scale, &
& addContribution )
CLASS( MatrixField_ ), INTENT( INOUT ) :: obj
INTEGER( I4B ), OPTIONAL, INTENT( IN ) :: globalNode(:)
REAL( DFP ), INTENT( IN ) :: value
REAL( DFP ), OPTIONAL, INTENT( IN ) :: scale
LOGICAL( LGT ), OPTIONAL, INTENT( IN ) :: addContribution
END SUBROUTINE Set
END INTERFACE
IF addContribution and scale are ABSENT then:
- This subroutine sets a scalar value
valueto all or selected the entries of the matrix. - If
globalNodeis present then this routine sets a scalar valuevalueto select the entries of the matrix. These entries are spacified by theglobalNode(:)vector, which denotes the global node numbers. Then, symbolically, we performobj(glocalNode)=value. - If
globalNodeis absent then all entries are set to the scalar values. Then, symbolically, we peformobj=value
IF addContribution and scale NOT PRESENT
- If
globalNodeis not present then, this subroutine adds a scalar valuevalueto all the entries of the matrix. Symbolically, we performobj=obj+scale*value - If
globalNodeis present then, This subroutine adds a scalar valuevalueto select the entries of the matrix. These entries are spacified by theglobalNode(:)vector, which denotes the global node numbers. Symbolically, we performobj(glocalNode)=obj(globalNode)+scale*value
globalNode is present, then this method cannot be called for Rectangle MatrixField.In this example we show how to set entries in MatrixField.
PROGRAM main
USE easifemBase
USE easifemClasses
IMPLICIT NONE
TYPE( Domain_) :: dom
TYPE( MatrixFieldLis_ ) :: obj
TYPE( HDF5File_) :: meshfile
TYPE( ParameterList_ ) :: param
TYPE( RealMatrix_ ) :: realmat
INTEGER( I4B ) :: ierr
REAL( DFP ), ALLOCATABLE :: realVec( : )
CHARACTER(LEN=*), PARAMETER :: filename="./test_4.h5"
CHARACTER(LEN=*), PARAMETER :: engine="LIS_OMP"
CHARACTER( LEN = * ), PARAMETER :: name="K"
CHARACTER( LEN = * ), PARAMETER :: matrixProp="UNSYM"
INTEGER( I4B ), PARAMETER :: spaceCompo = 1
INTEGER( I4B ), PARAMETER :: timeCompo = 1
CALL FPL_INIT(); CALL param%Initiate()
CALL meshfile%Initiate( filename="./mesh.h5", mode="READ" )
CALL meshfile%Open()
CALL dom%Initiate( meshfile, "" ); CALL meshfile%Close()
CALL dom%InitiateNodeToNodes()
CALL meshfile%Deallocate()
CALL SetMatrixFieldParam( &
& param=param, &
& name="K", &
& matrixProp="UNSYM", &
& engine=engine, &
& spaceCompo=spaceCompo, &
& timeCompo=timeCompo, &
& fieldType=FIELD_TYPE_NORMAL )
CALL obj%Initiate( param, dom )
CALL obj%Set( &
& globalNode=[1,5,10], &
& value=1.0_DFP )
realmat = obj%mat
CALL Display(MdEncode(realmat%val), "obj%mat = ")
CALL obj%Deallocate()
CALL dom%Deallocate()
CALL param%Deallocate(); CALL FPL_FINALIZE()
END PROGRAM main
results:
obj%mat =
| 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Interface 3
- 𑗍 Set 3
- ️܀ See example
- ↢
INTERFACE
MODULE SUBROUTINE Set( obj, iNodeNum, jNodeNum, idof, &
& jdof, value, scale, addContribution )
CLASS( MatrixField_ ), INTENT( INOUT ) :: obj
INTEGER( I4B ), INTENT( IN ) :: iNodeNum
INTEGER( I4B ), INTENT( IN ) :: jNodeNum
INTEGER( I4B ), INTENT( IN ) :: idof
INTEGER( I4B ), INTENT( IN ) :: jdof
REAL( DFP ), INTENT( IN ) :: value
REAL( DFP ), OPTIONAL, INTENT( IN ) :: scale
LOGICAL( LGT ), OPTIONAL, INTENT( IN ) :: addContribution
END SUBROUTINE Set
END INTERFACE
This routine can be called for rectangle matrix.
- If addContribution and scale not present then
- This subroutine sets a scalar value
valueto a single entry of the matrix. - This entry is specified by the
iNodeNumandjNodeNum, which are global node number. - The exact location of the entry is computed using
iNodeNum,iDOF,jNodeNumandjDOF.
- This subroutine sets a scalar value
- If addContribution and scale present then:
- This subroutine adds a scalar value
valueto a single entry of the matrix. - This entry is specified by the
iNodeNumandjNodeNum. - The exact location of the entry is computed using
iNodeNum,iDOF,jNodeNumandjDOF.
- This subroutine adds a scalar value
In this example we show how to set entries in MatrixField.
PROGRAM main
USE easifemBase
USE easifemClasses
IMPLICIT NONE
TYPE( Domain_) :: dom
TYPE( MatrixFieldLis_ ) :: obj
TYPE( HDF5File_) :: meshfile
TYPE( ParameterList_ ) :: param
TYPE( RealMatrix_ ) :: realmat
INTEGER( I4B ) :: ierr
REAL( DFP ), ALLOCATABLE :: realVec( : )
CHARACTER(LEN=*), PARAMETER :: filename="./test_4.h5"
CHARACTER(LEN=*), PARAMETER :: engine="LIS_OMP"
CHARACTER( LEN = * ), PARAMETER :: name="K"
CHARACTER( LEN = * ), PARAMETER :: matrixProp="UNSYM"
INTEGER( I4B ), PARAMETER :: spaceCompo = 1
INTEGER( I4B ), PARAMETER :: timeCompo = 1
CALL FPL_INIT(); CALL param%Initiate()
CALL meshfile%Initiate( filename="./mesh.h5", mode="READ" )
CALL meshfile%Open()
CALL dom%Initiate( meshfile, "" ); CALL meshfile%Close()
CALL dom%InitiateNodeToNodes()
CALL meshfile%Deallocate()
CALL SetMatrixFieldParam( &
& param=param, &
& name="K", &
& matrixProp="UNSYM", &
& engine=engine, &
& spaceCompo=spaceCompo, &
& timeCompo=timeCompo, &
& fieldType=FIELD_TYPE_NORMAL )
CALL obj%Initiate( param, dom )
CALL obj%Set( &
& iNodeNum=1, &
& jNodeNum=5, &
& idof=1, &
& jdof=1, &
& value=1.0_DFP )
realmat = obj%mat
CALL Display(MdEncode(realmat%val), "obj%mat = ")
CALL obj%Deallocate()
CALL dom%Deallocate()
CALL param%Deallocate(); CALL FPL_FINALIZE()
END PROGRAM main
results:
obj%mat =
| 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Interface 4
- 𑗍 Set 4
- ️܀ See example
- ↢
INTERFACE
MODULE SUBROUTINE Set( obj, iNodeNum, jNodeNum, ivar, &
& jvar, value, scale, addContribution )
CLASS( MatrixField_ ), INTENT( INOUT ) :: obj
INTEGER( I4B ), INTENT( IN ) :: iNodeNum(:)
INTEGER( I4B ), INTENT( IN ) :: jNodeNum(:)
INTEGER( I4B ), INTENT( IN ) :: ivar
INTEGER( I4B ), INTENT( IN ) :: jvar
REAL( DFP ), INTENT( IN ) :: value(:,:)
REAL( DFP ), OPTIONAL, INTENT( IN ) :: scale
LOGICAL( LGT ), OPTIONAL, INTENT( IN ) :: addContribution
END SUBROUTINE Set
END INTERFACE
This routine can be called for rectangle matrix.
- If addContribution and scale not present then
- This subroutine sets a block of data to matrix.
- This block data is contained in
value(:,:). - The number of rows in
valueshould beSIZE( iNodeNum ) * itdof, whereitdofis the total degrees of freedom in row dimension. - The number of columns in
valueshould beSIZE( jNodeNum ) * jtdof, wherejtdofis the total degrees of freedom in column dimension. - globalNode contains the global node number
- This entry is specified by the
iNodeNumandjNodeNum, which are global node number. - The exact location of the entry is computed using
iNodeNum,ivar,jNodeNumandjvar.
- If addContribution and scale present then we add contribution to matrix, instead of setting the value.
Storage format of value should be FMT_NODES because the storage format of MatrixField_ is FMT_NODES.
In this example we show how to set entries in MatrixField.
PROGRAM main
USE easifemBase
USE easifemClasses
IMPLICIT NONE
TYPE( Domain_) :: dom
TYPE( MatrixFieldLis_ ) :: obj
TYPE( HDF5File_) :: meshfile
TYPE( ParameterList_ ) :: param
TYPE( RealMatrix_ ) :: realmat
INTEGER( I4B ) :: ierr
REAL( DFP ), ALLOCATABLE :: realVec( : )
CHARACTER(LEN=*), PARAMETER :: filename="./test_4.h5"
CHARACTER(LEN=*), PARAMETER :: engine="LIS_OMP"
CHARACTER( LEN = * ), PARAMETER :: name="K"
CHARACTER( LEN = * ), PARAMETER :: matrixProp="UNSYM"
INTEGER( I4B ), PARAMETER :: spaceCompo = 1
INTEGER( I4B ), PARAMETER :: timeCompo = 1
CALL FPL_INIT(); CALL param%Initiate()
CALL meshfile%Initiate( filename="./mesh.h5", mode="READ" )
CALL meshfile%Open()
CALL dom%Initiate( meshfile, "" ); CALL meshfile%Close()
CALL dom%InitiateNodeToNodes()
CALL meshfile%Deallocate()
CALL SetMatrixFieldParam( &
& param=param, &
& name="K", &
& matrixProp="UNSYM", &
& engine=engine, &
& spaceCompo=spaceCompo, &
& timeCompo=timeCompo, &
& fieldType=FIELD_TYPE_NORMAL )
CALL obj%Initiate( param, dom )
CALL Initiate( realmat, 3, 3 )
CALL SET(realmat, val=[1.0_DFP, 2._DFP, 3._DFP], indx=1, &
& extraOption=MATRIX_ROW)
CALL SET(realmat, val=[4.0_DFP, 5._DFP, 6._DFP], indx=2, &
& extraOption=MATRIX_ROW)
CALL SET(realmat, val=[7.0_DFP, 8._DFP, 9._DFP], indx=3, &
& extraOption=MATRIX_ROW)
CALL Display(realmat, "realmat = ")
CALL obj%Set( &
& iNodeNum=[1,5,10], &
& jNodeNum=[1,5,10], &
& ivar=1, &
& jvar=1, &
& value=realmat%val )
realmat = obj%mat
CALL Display(MdEncode(realmat%val), "obj%mat = ")
CALL obj%Deallocate()
CALL dom%Deallocate()
CALL param%Deallocate(); CALL FPL_FINALIZE()
END PROGRAM main
results:
obj%mat =
| 1 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 3 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 4 | 0 | 0 | 0 | 5 | 0 | 0 | 0 | 0 | 6 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 7 | 0 | 0 | 0 | 8 | 0 | 0 | 0 | 0 | 9 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Interface 5
- 𑗍 Set 5
- ️܀ See example
- ↢
INTERFACE
MODULE SUBROUTINE Set( obj, iNodeNum, jNodeNum, ivar, &
& jvar, idof, jdof, value, scale, addContribution )
CLASS( MatrixField_ ), INTENT( INOUT ) :: obj
INTEGER( I4B ), INTENT( IN ) :: iNodeNum(:)
INTEGER( I4B ), INTENT( IN ) :: jNodeNum(:)
INTEGER( I4B ), INTENT( IN ) :: ivar
INTEGER( I4B ), INTENT( IN ) :: jvar
INTEGER( I4B ), INTENT( IN ) :: idof
INTEGER( I4B ), INTENT( IN ) :: jdof
REAL( DFP ), INTENT( IN ) :: value(:,:)
REAL( DFP ), OPTIONAL, INTENT( IN ) :: scale
LOGICAL( LGT ), OPTIONAL, INTENT( IN ) :: addContribution
END SUBROUTINE Set
END INTERFACE
This routine can be called for rectangle matrix.
- If addContribution and scale not present then
- This subroutine sets a block of data to matrix.
- This block data is contained in
value(:,:) - The size of
valueshould beSIZE(iNodeNum),SIZE(jNodeNum) - globalNode contains the global node number
- This entry is specified by the
iNodeNumandjNodeNum, which are global node number. - The exact location of the entry is computed using
iNodeNum,ivar,idof,jNodeNumandjvar,jdof.
- If addContribution and scale present then we add contribution to matrix, instead of setting the value.
In this example we show how to set entries in MatrixField.
PROGRAM main
USE easifemBase
USE easifemClasses
IMPLICIT NONE
TYPE( Domain_) :: dom
TYPE( MatrixFieldLis_ ) :: obj
TYPE( HDF5File_) :: meshfile
TYPE( ParameterList_ ) :: param
TYPE( RealMatrix_ ) :: realmat
INTEGER( I4B ) :: ierr
REAL( DFP ), ALLOCATABLE :: realVec( : )
CHARACTER(LEN=*), PARAMETER :: filename="./test_4.h5"
CHARACTER(LEN=*), PARAMETER :: engine="LIS_OMP"
CHARACTER( LEN = * ), PARAMETER :: name="K"
CHARACTER( LEN = * ), PARAMETER :: matrixProp="UNSYM"
INTEGER( I4B ), PARAMETER :: spaceCompo = 1
INTEGER( I4B ), PARAMETER :: timeCompo = 1
CALL FPL_INIT(); CALL param%Initiate()
CALL meshfile%Initiate( filename="./mesh.h5", mode="READ" )
CALL meshfile%Open()
CALL dom%Initiate( meshfile, "" ); CALL meshfile%Close()
CALL dom%InitiateNodeToNodes()
CALL meshfile%Deallocate()
CALL SetMatrixFieldParam( &
& param=param, &
& name="K", &
& matrixProp="UNSYM", &
& engine=engine, &
& spaceCompo=spaceCompo, &
& timeCompo=timeCompo, &
& fieldType=FIELD_TYPE_NORMAL )
CALL obj%Initiate( param, dom )
CALL Initiate( realmat, 3, 3 )
CALL SET(realmat, val=[1.0_DFP, 2._DFP, 3._DFP], indx=1, &
& extraOption=MATRIX_ROW)
CALL SET(realmat, val=[4.0_DFP, 5._DFP, 6._DFP], indx=2, &
& extraOption=MATRIX_ROW)
CALL SET(realmat, val=[7.0_DFP, 8._DFP, 9._DFP], indx=3, &
& extraOption=MATRIX_ROW)
CALL Display(realmat, "realmat = ")
CALL obj%Set( &
& iNodeNum=[1,5,10], &
& jNodeNum=[1,5,10], &
& ivar=1, &
& jvar=1, &
& idof=1, &
& jdof=1, &
& value=realmat%val )
realmat = obj%mat
CALL Display(MdEncode(realmat%val), "obj%mat = ")
CALL obj%Deallocate()
CALL dom%Deallocate()
CALL param%Deallocate(); CALL FPL_FINALIZE()
END PROGRAM main
results:
obj%mat =
| 1 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 3 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 4 | 0 | 0 | 0 | 5 | 0 | 0 | 0 | 0 | 6 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 7 | 0 | 0 | 0 | 8 | 0 | 0 | 0 | 0 | 9 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Interface 6
- 𑗍 Set 6
- ️܀ See example
- ↢
INTERFACE
MODULE SUBROUTINE Set( obj, iNodeNum, jNodeNum, ivar, jvar, &
& idof, jdof, value, scale, addContribution )
CLASS( MatrixField_ ), INTENT( INOUT ) :: obj
INTEGER( I4B ), INTENT( IN ) :: iNodeNum
INTEGER( I4B ), INTENT( IN ) :: jNodeNum
INTEGER( I4B ), INTENT( IN ) :: ivar
INTEGER( I4B ), INTENT( IN ) :: jvar
INTEGER( I4B ), INTENT( IN ) :: idof
INTEGER( I4B ), INTENT( IN ) :: jdof
REAL( DFP ), INTENT( IN ) :: value
REAL( DFP ), OPTIONAL, INTENT( IN ) :: scale
LOGICAL( LGT ), OPTIONAL, INTENT( IN ) :: addContribution
END SUBROUTINE Set
END INTERFACE
If addContribution and scale NOT PRESENT, then:
- This subroutine sets a scalar value
valueto a single entry of the matrix. - This entry is specified by the
iNodeNumandjNodeNum. - The exact location of the entry is computed using
iNodeNum,idof,ivar, andjNodeNum,jdof,jvar.
If addContribution and scale are PRESENT then:
- This subroutine adds a scalar value
valueto a single entry of the matrix. - This entry is specified by the
iNodeNumandjNodeNum. - The exact location of the entry is computed using
iNodeNum,idof,ivar, andjNodeNum,jdof,jvar.
In this example we show how to set entries in MatrixField.
PROGRAM main
USE easifemBase
USE easifemClasses
IMPLICIT NONE
TYPE( Domain_) :: dom
TYPE( MatrixFieldLis_ ) :: obj
TYPE( HDF5File_) :: meshfile
TYPE( ParameterList_ ) :: param
TYPE( RealMatrix_ ) :: realmat
INTEGER( I4B ) :: ierr
REAL( DFP ), ALLOCATABLE :: realVec( : )
CHARACTER(LEN=*), PARAMETER :: filename="./test_4.h5"
CHARACTER(LEN=*), PARAMETER :: engine="LIS_OMP"
CHARACTER( LEN = * ), PARAMETER :: name="K"
CHARACTER( LEN = * ), PARAMETER :: matrixProp="UNSYM"
INTEGER( I4B ), PARAMETER :: spaceCompo = 1
INTEGER( I4B ), PARAMETER :: timeCompo = 1
CALL FPL_INIT(); CALL param%Initiate()
CALL meshfile%Initiate( filename="./mesh.h5", mode="READ" )
CALL meshfile%Open()
CALL dom%Initiate( meshfile, "" ); CALL meshfile%Close()
CALL dom%InitiateNodeToNodes()
CALL meshfile%Deallocate()
CALL SetMatrixFieldParam( &
& param=param, &
& name="K", &
& matrixProp="UNSYM", &
& engine=engine, &
& spaceCompo=spaceCompo, &
& timeCompo=timeCompo, &
& fieldType=FIELD_TYPE_NORMAL )
CALL obj%Initiate( param, dom )
CALL obj%Set( &
& iNodeNum=1, &
& jNodeNum=5, &
& ivar=1, &
& jvar=1, &
& idof=1, &
& jdof=1, &
& value=1.0_DFP )
realmat = obj%mat
CALL Display(MdEncode(realmat%val), "obj%mat = ")
CALL obj%Deallocate()
CALL dom%Deallocate()
CALL param%Deallocate(); CALL FPL_FINALIZE()
END PROGRAM main
results:
obj%mat =
| 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Interface 7
- 𑗍 Set 7
- ️܀ See example
- ↢
INTERFACE
MODULE SUBROUTINE Set( obj, iNodeNum, jNodeNum, ivar, jvar, &
& ispacecompo, itimecompo, jspacecompo, jtimecompo, value, scale, &
& addContribution )
CLASS( MatrixField_ ), INTENT( INOUT ) :: obj
INTEGER( I4B ), INTENT( IN ) :: iNodeNum
INTEGER( I4B ), INTENT( IN ) :: jNodeNum
INTEGER( I4B ), INTENT( IN ) :: ivar
INTEGER( I4B ), INTENT( IN ) :: jvar
INTEGER( I4B ), INTENT( IN ) :: ispacecompo
INTEGER( I4B ), INTENT( IN ) :: itimecompo
INTEGER( I4B ), INTENT( IN ) :: jspacecompo
INTEGER( I4B ), INTENT( IN ) :: jtimecompo
REAL( DFP ), INTENT( IN ) :: value
REAL( DFP ), OPTIONAL, INTENT( IN ) :: scale
LOGICAL( LGT ), OPTIONAL, INTENT( IN ) :: addContribution
END SUBROUTINE Set
END INTERFACE
If addContribution and scale are not present then:
- This subroutine sets a scalar value
valueto a single entry of the matrix. - This entry is specified by the
iNodeNumandjNodeNum. - The exact location of the entry is computed using (
iNodeNum,ivar,ispacecompo,itimecompo) and (jNodeNum,jvar,jspacecompo,jtimecompo).
If addContribution and scale present, then this subroutine adds a scalar value value to a single entry of the matrix.
In this example we show how to set entries in MatrixField.
PROGRAM main
USE easifemBase
USE easifemClasses
IMPLICIT NONE
TYPE( Domain_) :: dom
TYPE( MatrixFieldLis_ ) :: obj
TYPE( HDF5File_) :: meshfile
TYPE( ParameterList_ ) :: param
TYPE( RealMatrix_ ) :: realmat
INTEGER( I4B ) :: ierr
REAL( DFP ), ALLOCATABLE :: realVec( : )
CHARACTER(LEN=*), PARAMETER :: filename="./test_4.h5"
CHARACTER(LEN=*), PARAMETER :: engine="LIS_OMP"
CHARACTER( LEN = * ), PARAMETER :: name="K"
CHARACTER( LEN = * ), PARAMETER :: matrixProp="UNSYM"
INTEGER( I4B ), PARAMETER :: spaceCompo = 1
INTEGER( I4B ), PARAMETER :: timeCompo = 1
CALL FPL_INIT(); CALL param%Initiate()
CALL meshfile%Initiate( filename="./mesh.h5", mode="READ" )
CALL meshfile%Open()
CALL dom%Initiate( meshfile, "" ); CALL meshfile%Close()
CALL dom%InitiateNodeToNodes()
CALL meshfile%Deallocate()
CALL SetMatrixFieldParam( &
& param=param, &
& name="K", &
& matrixProp="UNSYM", &
& engine=engine, &
& spaceCompo=spaceCompo, &
& timeCompo=timeCompo, &
& fieldType=FIELD_TYPE_NORMAL )
CALL obj%Initiate( param, dom )
CALL obj%Set( &
& iNodeNum=1, &
& jNodeNum=5, &
& ivar=1, &
& jvar=1, &
& ispaceCompo=1, &
& itimeCompo=1, &
& jspaceCompo=1, &
& jtimeCompo=1, &
& value=1.0_DFP )
realmat = obj%mat
CALL Display(MdEncode(realmat%val), "obj%mat = ")
CALL obj%Deallocate()
CALL dom%Deallocate()
CALL param%Deallocate(); CALL FPL_FINALIZE()
END PROGRAM main
results:
obj%mat =
| 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Interface 8
- 𑗍 Set 8
- ️܀ See example
- ↢
INTERFACE
MODULE SUBROUTINE Set( obj, iNodeNum, jNodeNum, ivar, jvar, &
& ispacecompo, itimecompo, jspacecompo, jtimecompo, value, scale, &
& addContribution )
CLASS( MatrixField_ ), INTENT( INOUT ) :: obj
INTEGER( I4B ), INTENT( IN ) :: iNodeNum(:)
INTEGER( I4B ), INTENT( IN ) :: jNodeNum(:)
INTEGER( I4B ), INTENT( IN ) :: ivar
INTEGER( I4B ), INTENT( IN ) :: jvar
INTEGER( I4B ), INTENT( IN ) :: ispacecompo
INTEGER( I4B ), INTENT( IN ) :: itimecompo
INTEGER( I4B ), INTENT( IN ) :: jspacecompo
INTEGER( I4B ), INTENT( IN ) :: jtimecompo
REAL( DFP ), INTENT( IN ) :: value
REAL( DFP ), OPTIONAL, INTENT( IN ) :: scale
LOGICAL( LGT ), OPTIONAL, INTENT( IN ) :: addContribution
END SUBROUTINE Set
END INTERFACE
If addContribution and scale are not present then:
- This subroutine sets
valueto the matrix. - This entry is specified by the
iNodeNumandjNodeNum. - The exact location of the entry is computed using (
iNodeNum,ivar,ispacecompo,itimecompo) and (jNodeNum,jvar,jspacecompo,jtimecompo).
If addContribution and scale present, then this subroutine adds value to the matrix.
In this example we show how to set entries in MatrixField.
PROGRAM main
USE easifemBase
USE easifemClasses
IMPLICIT NONE
TYPE( Domain_) :: dom
TYPE( MatrixFieldLis_ ) :: obj
TYPE( HDF5File_) :: meshfile
TYPE( ParameterList_ ) :: param
TYPE( RealMatrix_ ) :: realmat
INTEGER( I4B ) :: ierr
REAL( DFP ), ALLOCATABLE :: realVec( : )
CHARACTER(LEN=*), PARAMETER :: filename="./test_4.h5"
CHARACTER(LEN=*), PARAMETER :: engine="LIS_OMP"
CHARACTER( LEN = * ), PARAMETER :: name="K"
CHARACTER( LEN = * ), PARAMETER :: matrixProp="UNSYM"
INTEGER( I4B ), PARAMETER :: spaceCompo = 1
INTEGER( I4B ), PARAMETER :: timeCompo = 1
CALL FPL_INIT(); CALL param%Initiate()
CALL meshfile%Initiate( filename="./mesh.h5", mode="READ" )
CALL meshfile%Open()
CALL dom%Initiate( meshfile, "" ); CALL meshfile%Close()
CALL dom%InitiateNodeToNodes()
CALL meshfile%Deallocate()
CALL SetMatrixFieldParam( &
& param=param, &
& name="K", &
& matrixProp="UNSYM", &
& engine=engine, &
& spaceCompo=spaceCompo, &
& timeCompo=timeCompo, &
& fieldType=FIELD_TYPE_NORMAL )
CALL obj%Initiate( param, dom )
CALL obj%Set( &
& iNodeNum=[1,5,10], &
& jNodeNum=[1,5,10], &
& ivar=1, &
& jvar=1, &
& ispaceCompo=1, &
& itimeCompo=1, &
& jspaceCompo=1, &
& jtimeCompo=1, &
& value=1.0_DFP )
realmat = obj%mat
CALL Display(MdEncode(realmat%val), "obj%mat = ")
CALL obj%Deallocate()
CALL dom%Deallocate()
CALL param%Deallocate(); CALL FPL_FINALIZE()
END PROGRAM main
results:
obj%mat =
| 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Interface 9
- 𑗍 Set 9
- ️܀ See example
- ↢
INTERFACE
MODULE SUBROUTINE Set( obj, iNodeNum, jNodeNum, ivar, jvar, &
& ispacecompo, itimecompo, jspacecompo, jtimecompo, value, scale, &
& addContribution )
CLASS( MatrixField_ ), INTENT( INOUT ) :: obj
INTEGER( I4B ), INTENT( IN ) :: iNodeNum(:)
INTEGER( I4B ), INTENT( IN ) :: jNodeNum(:)
INTEGER( I4B ), INTENT( IN ) :: ivar
INTEGER( I4B ), INTENT( IN ) :: jvar
INTEGER( I4B ), INTENT( IN ) :: ispacecompo
INTEGER( I4B ), INTENT( IN ) :: itimecompo(:)
INTEGER( I4B ), INTENT( IN ) :: jspacecompo
INTEGER( I4B ), INTENT( IN ) :: jtimecompo(:)
REAL( DFP ), INTENT( IN ) :: value
REAL( DFP ), OPTIONAL, INTENT( IN ) :: scale
LOGICAL( LGT ), OPTIONAL, INTENT( IN ) :: addContribution
END SUBROUTINE Set
END INTERFACE
If addContribution and scale are not present then:
- This subroutine sets
valueto the matrix. - This entry is specified by the
iNodeNumandjNodeNum. - The exact location of the entry is computed using (
iNodeNum,ivar,ispacecompo,itimecompo) and (jNodeNum,jvar,jspacecompo,jtimecompo).
If addContribution and scale present, then this subroutine adds value to the matrix.
In this example we show how to set entries in MatrixField.
PROGRAM main
USE easifemBase
USE easifemClasses
IMPLICIT NONE
TYPE( Domain_) :: dom
TYPE( MatrixFieldLis_ ) :: obj
TYPE( HDF5File_) :: meshfile
TYPE( ParameterList_ ) :: param
TYPE( RealMatrix_ ) :: realmat
INTEGER( I4B ) :: ierr
REAL( DFP ), ALLOCATABLE :: realVec( : )
CHARACTER(LEN=*), PARAMETER :: filename="./test_4.h5"
CHARACTER(LEN=*), PARAMETER :: engine="LIS_OMP"
CHARACTER( LEN = * ), PARAMETER :: name="K"
CHARACTER( LEN = * ), PARAMETER :: matrixProp="UNSYM"
INTEGER( I4B ), PARAMETER :: spaceCompo = 1
INTEGER( I4B ), PARAMETER :: timeCompo = 1
CALL FPL_INIT(); CALL param%Initiate()
CALL meshfile%Initiate( filename="./mesh.h5", mode="READ" )
CALL meshfile%Open()
CALL dom%Initiate( meshfile, "" ); CALL meshfile%Close()
CALL dom%InitiateNodeToNodes()
CALL meshfile%Deallocate()
CALL SetMatrixFieldParam( &
& param=param, &
& name="K", &
& matrixProp="UNSYM", &
& engine=engine, &
& spaceCompo=spaceCompo, &
& timeCompo=timeCompo, &
& fieldType=FIELD_TYPE_NORMAL )
CALL obj%Initiate( param, dom )
CALL obj%Set( &
& iNodeNum=[1,5,10], &
& jNodeNum=[1,5,10], &
& ivar=1, &
& jvar=1, &
& ispaceCompo=1, &
& itimeCompo=[1], &
& jspaceCompo=1, &
& jtimeCompo=[1], &
& value=1.0_DFP )
realmat = obj%mat
CALL Display(MdEncode(realmat%val), "obj%mat = ")
CALL obj%Deallocate()
CALL dom%Deallocate()
CALL param%Deallocate(); CALL FPL_FINALIZE()
END PROGRAM main
results:
obj%mat =
| 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Interface 10
- 𑗍 Set 10
- ️܀ See example
- ↢
INTERFACE
MODULE SUBROUTINE Set( obj, iNodeNum, jNodeNum, ivar, jvar, &
& ispacecompo, itimecompo, jspacecompo, jtimecompo, value, scale, &
& addContribution )
CLASS( MatrixField_ ), INTENT( INOUT ) :: obj
INTEGER( I4B ), INTENT( IN ) :: iNodeNum(:)
INTEGER( I4B ), INTENT( IN ) :: jNodeNum(:)
INTEGER( I4B ), INTENT( IN ) :: ivar
INTEGER( I4B ), INTENT( IN ) :: jvar
INTEGER( I4B ), INTENT( IN ) :: ispacecompo(:)
INTEGER( I4B ), INTENT( IN ) :: itimecompo
INTEGER( I4B ), INTENT( IN ) :: jspacecompo(:)
INTEGER( I4B ), INTENT( IN ) :: jtimecompo
REAL( DFP ), INTENT( IN ) :: value
REAL( DFP ), OPTIONAL, INTENT( IN ) :: scale
LOGICAL( LGT ), OPTIONAL, INTENT( IN ) :: addContribution
END SUBROUTINE Set
END INTERFACE
If addContribution and scale are not present then:
- This subroutine sets
valueto the matrix. - This entry is specified by the
iNodeNumandjNodeNum. - The exact location of the entry is computed using (
iNodeNum,ivar,ispacecompo,itimecompo) and (jNodeNum,jvar,jspacecompo,jtimecompo).
If addContribution and scale present, then this subroutine adds value to the matrix.
In this example we show how to set entries in MatrixField.
PROGRAM main
USE easifemBase
USE easifemClasses
IMPLICIT NONE
TYPE( Domain_) :: dom
TYPE( MatrixFieldLis_ ) :: obj
TYPE( HDF5File_) :: meshfile
TYPE( ParameterList_ ) :: param
TYPE( RealMatrix_ ) :: realmat
INTEGER( I4B ) :: ierr
REAL( DFP ), ALLOCATABLE :: realVec( : )
CHARACTER(LEN=*), PARAMETER :: filename="./test_4.h5"
CHARACTER(LEN=*), PARAMETER :: engine="LIS_OMP"
CHARACTER( LEN = * ), PARAMETER :: name="K"
CHARACTER( LEN = * ), PARAMETER :: matrixProp="UNSYM"
INTEGER( I4B ), PARAMETER :: spaceCompo = 1
INTEGER( I4B ), PARAMETER :: timeCompo = 1
CALL FPL_INIT(); CALL param%Initiate()
CALL meshfile%Initiate( filename="./mesh.h5", mode="READ" )
CALL meshfile%Open()
CALL dom%Initiate( meshfile, "" ); CALL meshfile%Close()
CALL dom%InitiateNodeToNodes()
CALL meshfile%Deallocate()
CALL SetMatrixFieldParam( &
& param=param, &
& name="K", &
& matrixProp="UNSYM", &
& engine=engine, &
& spaceCompo=spaceCompo, &
& timeCompo=timeCompo, &
& fieldType=FIELD_TYPE_NORMAL )
CALL obj%Initiate( param, dom )
CALL obj%Set( &
& iNodeNum=[1,5,10], &
& jNodeNum=[1,5,10], &
& ivar=1, &
& jvar=1, &
& ispaceCompo=[1], &
& itimeCompo=1, &
& jspaceCompo=[1], &
& jtimeCompo=1, &
& value=1.0_DFP )
realmat = obj%mat
CALL Display(MdEncode(realmat%val), "obj%mat = ")
CALL obj%Deallocate()
CALL dom%Deallocate()
CALL param%Deallocate(); CALL FPL_FINALIZE()
END PROGRAM main
results:
obj%mat =
| 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |