GetSym
Make sparse matrix symmetric.
Calling example:
CALL GetSym(CSRSparsity_::obj, CSRSparsity_::symObj, char(1)::from)
- ܀ GetSym(obj, symobj, from)
- ܀ See Example
- ↢
INTERFACE
MODULE SUBROUTINE GetSym(obj, symObj, from)
TYPE(CSRSparsity_), INTENT(IN) :: obj
TYPE(CSRSparsity_), INTENT(INOUT) :: symObj
CHARACTER(1), INTENT(IN) :: from
END SUBROUTINE GetSym
END INTERFACE
- If
from="L"
, then lower part of csrmatrix is used - If
from="U"
, then upper part of csrmatrix is used
PROGRAM main
USE easifemBase
IMPLICIT NONE
TYPE(CSRSparsity_) :: obj, symobj
TYPE(DOF_) :: dofobj
INTEGER(I4B) :: i
CALL Initiate( &
& obj=dofobj, &
& tNodes=[5], &
& names=['K'], &
& spaceCompo=[1], &
& timeCompo=[1], &
& storageFMT=FMT_DOF)
CALL Initiate( &
& obj, &
& ncol=(.tnodes.dofobj), &
& nrow=(.tNodes.dofobj), &
& idof=dofobj, &
& jdof=dofobj)
CALL setSparsity(obj=obj, row=1, col=[1, 3, 4], ivar=1, jvar=1)
CALL setSparsity(obj=obj, row=2, col=[1, 2], ivar=1, jvar=1)
CALL setSparsity(obj=obj, row=3, col=[2, 3], ivar=1, jvar=1)
CALL setSparsity(obj=obj, row=4, col=[4, 5], ivar=1, jvar=1)
CALL setSparsity(obj=obj, row=5, col=[1, 2, 5], ivar=1, jvar=1)
CALL setSparsity(obj)
CALL Display(obj, "obj = ")
CALL GetSym(obj=obj, symobj=symobj, from="U")
CALL Display(symobj, "symobj = ")
CALL DEALLOCATE (dofobj)
CALL DEALLOCATE (obj)
CALL DEALLOCATE (symobj)
END PROGRAM main
- GetSym(obj, from)
- ܀ See example
- ↢
INTERFACE
MODULE SUBROUTINE GetSym(obj, from)
TYPE(CSRSparsity_), INTENT(INOUT) :: obj
CHARACTER(1), INTENT(IN) :: from
END SUBROUTINE GetSym
END INTERFACE
- If
from="L"
, then lower part of csrmatrix is used - If
from="U"
, then upper part of csrmatrix is used
TODO