11#include "scaleFElib.h"
19 use scale_prc,
only: &
50 integer :: communicator_num
53 procedure :: modelmeshbase_final
54 procedure :: get_communicatorid => modelmeshbase_get_communicatorid
63 class(
meshbase),
pointer,
intent(out) :: ptr_mesh
71 procedure,
public :: modelmeshbase1d_init
72 procedure,
public :: modelmeshbase1d_final
73 procedure,
public :: getmodelmesh => modelmeshbase1d_get_modelmesh
80 procedure,
public :: modelmeshbase2d_init
81 procedure,
public :: modelmeshbase2d_final
82 procedure,
public :: getmodelmesh => modelmeshbase2d_get_modelmesh
90 logical :: initialized_element_operation
92 procedure,
public :: modelmeshbase3d_init
93 procedure,
public :: modelmeshbase3d_final
94 procedure,
public :: prepairelementoperation => modelmeshbase3d_prepair_elementoperation
95 procedure,
public :: getmodelmesh => modelmeshbase3d_get_modelmesh
114 integer,
intent(in) :: nDim
119 this%communicator_num = 0
120 allocate( this%SOptrMat(ndim), this%DOptrMat(ndim) )
126 function modelmeshbase_get_communicatorid( this, max_communicator_num )
result(commid)
129 integer,
intent(in) :: max_communicator_num
133 this%communicator_num = this%communicator_num + 1
134 commid = this%communicator_num
136 if ( commid > max_communicator_num )
then
137 log_error(
'ModelMeshBase_get_communicatorID',*)
'The number of communicator exceeds expectation. Check!'
142 end function modelmeshbase_get_communicatorid
145 subroutine modelmeshbase_final( this )
152 do d = 1,
size(this%DOptrMat)
153 call this%DOptrMat(d)%Final()
154 call this%SOptrMat(d)%Final()
156 deallocate( this%SOptrMat, this%DOptrMat )
158 call this%LiftOptrMat%Final()
161 end subroutine modelmeshbase_final
165 subroutine modelmeshbase1d_init( this, mesh )
171 this%ptr_mesh => mesh
172 call this%ModelMeshBase_Init(1)
175 end subroutine modelmeshbase1d_init
178 subroutine modelmeshbase1d_final( this )
185 nullify( this%ptr_mesh )
186 call this%ModelMeshBase_Final()
189 end subroutine modelmeshbase1d_final
192 subroutine modelmeshbase1d_get_modelmesh( this, ptr_mesh )
195 class(
meshbase),
pointer,
intent(out) :: ptr_mesh
198 ptr_mesh => this%ptr_mesh
201 end subroutine modelmeshbase1d_get_modelmesh
206 subroutine modelmeshbase2d_init( this, mesh )
212 this%ptr_mesh => mesh
213 call this%ModelMeshBase_Init(2)
216 end subroutine modelmeshbase2d_init
219 subroutine modelmeshbase2d_final( this )
224 nullify( this%ptr_mesh )
225 call this%ModelMeshBase_Final()
228 end subroutine modelmeshbase2d_final
231 subroutine modelmeshbase2d_get_modelmesh( this, ptr_mesh )
234 class(
meshbase),
pointer,
intent(out) :: ptr_mesh
237 ptr_mesh => this%ptr_mesh
239 end subroutine modelmeshbase2d_get_modelmesh
244 subroutine modelmeshbase3d_init( this, mesh )
250 this%ptr_mesh => mesh
251 call this%ModelMeshBase_Init(3)
253 this%initialized_element_operation = .false.
256 end subroutine modelmeshbase3d_init
259 subroutine modelmeshbase3d_final( this )
264 if ( this%initialized_element_operation )
then
265 call this%element3D_operation%Final()
268 nullify( this%ptr_mesh )
269 call this%ModelMeshBase_Final()
272 end subroutine modelmeshbase3d_final
275 subroutine modelmeshbase3d_prepair_elementoperation( this, element_operation_type, &
276 SpMV_storage_format_ )
277 use scale_prc,
only: prc_abort
281 character(len=*),
intent(in),
optional :: element_operation_type
282 character(len=*),
intent(in),
optional :: SpMV_storage_format_
284 character(len=H_SHORT) :: element_operation_type_
285 character(len=H_SHORT) :: SpMV_storage_format
290 if (
present(element_operation_type) )
then
291 element_operation_type_ = element_operation_type
293 element_operation_type_ =
"General"
295 spmv_storage_format =
"ELL"
296 elem3d => this%ptr_mesh%refElem3D
297 call this%DOptrMat(1)%Init( elem3d%Dx1, storage_format=spmv_storage_format )
298 call this%DOptrMat(2)%Init( elem3d%Dx2, storage_format=spmv_storage_format )
299 call this%DOptrMat(3)%Init( elem3d%Dx3, storage_format=spmv_storage_format )
301 call this%SOptrMat(1)%Init( elem3d%Sx1, storage_format=spmv_storage_format )
302 call this%SOptrMat(2)%Init( elem3d%Sx2, storage_format=spmv_storage_format )
303 call this%SOptrMat(3)%Init( elem3d%Sx3, storage_format=spmv_storage_format )
305 call this%LiftOptrMat%Init( elem3d%Lift, storage_format=spmv_storage_format )
307 select case(element_operation_type_)
309 call this%element_operation_general%Init( elem3d, this%DOptrMat(1), this%DOptrMat(2), this%DOptrMat(3), this%LiftOptrMat )
310 this%element3D_operation => this%element_operation_general
311 case (
"TensorProd3D")
313 this%element_operation_tensorprod )
314 this%element3D_operation => this%element_operation_tensorprod
316 log_info(
"ModelMeshBase3D_prepair_ElementOperation",*)
"The specified element_operation_type is not supported. Check!", trim(element_operation_type_)
320 this%initialized_element_operation = .true.
323 end subroutine modelmeshbase3d_prepair_elementoperation
326 subroutine modelmeshbase3d_get_modelmesh( this, ptr_mesh )
329 class(
meshbase),
pointer,
intent(out) :: ptr_mesh
332 ptr_mesh => this%ptr_mesh
334 end subroutine modelmeshbase3d_get_modelmesh
module FElib / Element / Base
module FElib / Element / Operation / Base
module FElib / Element / Operation with arbitary elements
module FElib / Element / Operation with 3D tensor product elements
subroutine, public elementoperationtensorprod3d_create(elem3d, obj)
module FElib / Mesh / Base 1D
module FElib / Mesh / Base 2D
module FElib / Mesh / Base 3D
module FElib / Mesh / Base
FElib / model framework / mesh manager (base)
subroutine modelmeshbase_init(this, ndim)
Module common / sparsemat.
Derived type representing a 3D reference element.
Derived type to manage 1D mesh and spatial operators.
Derived type to manage 2D mesh and spatial operators.
Derived type to manage 3D mesh and spatial operators.
Derived type to manage model mesh and spatial operators (base type)
Derived type to manage a sparse matrix.