FE-Project
Loading...
Searching...
No Matches
Data Types | Functions/Subroutines
scale_element_base Module Reference

module FElib / Element / Base More...

Data Types

type  elementbase
 
type  elementbase1d
 
type  elementbase2d
 
interface  elementbase2d_genintgausslegendreintrpmat
 
type  elementbase3d
 

Functions/Subroutines

subroutine, public elementbase_construct_massmat (v, np, massmat, invmassmat)
 Construct mass matrix M^-1 = V V^T M = ( M^-1 )^-1.
 
subroutine, public elementbase_construct_stiffmat (massmat, invmassmat, dmat, np, stiffmat)
 Construct stiffness matrix StiffMat_i = M^-1 ( M D_xi )^T.
 
subroutine, public elementbase_construct_liftmat (invm, emat, np, nfptot, liftmat)
 Construct stiffness matrix StiffMat_i = M^-1 ( M D_xi )^T.
 
subroutine, public elementbase1d_init (elem, lumpedmat_flag)
 
subroutine, public elementbase1d_final (elem)
 
subroutine, public elementbase2d_init (elem, lumpedmat_flag)
 
subroutine, public elementbase2d_final (elem)
 
subroutine, public elementbase3d_init (elem, lumpedmat_flag)
 
subroutine, public elementbase3d_final (elem)
 

Detailed Description

module FElib / Element / Base

Description
A base module for finite element
Author
Yuta Kawai, Team SCALE

Function/Subroutine Documentation

◆ elementbase_construct_massmat()

subroutine, public scale_element_base::elementbase_construct_massmat ( real(rp), dimension(np,np), intent(in) v,
integer, intent(in) np,
real(rp), dimension(np,np), intent(out) massmat,
real(rp), dimension(np,np), intent(out), optional invmassmat )

Construct mass matrix M^-1 = V V^T M = ( M^-1 )^-1.

Definition at line 205 of file scale_element_base.F90.

208 implicit none
209 integer, intent(in) :: Np
210 real(RP), intent(in) :: V(Np,Np)
211 real(RP), intent(out) :: MassMat(Np,Np)
212 real(RP), intent(out), optional :: invMassMat(Np,Np)
213
214 real(RP) :: tmpMat(Np,Np)
215 real(RP) :: invM(Np,Np)
216 !------------------------------------
217
218 tmpmat(:,:) = transpose(v)
219 invm(:,:) = matmul( v, tmpmat )
220 massmat(:,:) = linalgebra_inv( invm )
221
222 if ( present(invmassmat) ) invmassmat(:,:) = invm(:,:)
223 return
module common / Linear algebra
real(rp) function, dimension(size(a, 1), size(a, 2)), public linalgebra_inv(a)

References scale_linalgebra::linalgebra_inv().

Referenced by scale_element_hexahedral::hexhedralelement_init(), scale_element_base::elementbase::islumpedmatrix(), scale_element_line::lineelement_init(), and scale_element_quadrilateral::quadrilateralelement_init().

◆ elementbase_construct_stiffmat()

subroutine, public scale_element_base::elementbase_construct_stiffmat ( real(rp), dimension(np,np), intent(in) massmat,
real(rp), dimension(np,np), intent(in) invmassmat,
real(rp), dimension(np,np), intent(in) dmat,
integer, intent(in) np,
real(rp), dimension(np,np), intent(out) stiffmat )

Construct stiffness matrix StiffMat_i = M^-1 ( M D_xi )^T.

Definition at line 229 of file scale_element_base.F90.

231 implicit none
232 integer, intent(in) :: Np
233 real(RP), intent(in) :: MassMat(Np,Np)
234 real(RP), intent(in) :: invMassMat(Np,Np)
235 real(RP), intent(in) :: DMat(Np,Np)
236 real(RP), intent(out) :: StiffMat(Np,Np)
237
238 real(RP) :: tmpMat1(Np,Np)
239 real(RP) :: tmpMat2(Np,Np)
240 !------------------------------------
241
242 tmpmat1(:,:) = matmul( massmat, dmat )
243 tmpmat2(:,:) = transpose( tmpmat1 )
244 stiffmat(:,:) = matmul( invmassmat, tmpmat2 )
245
246 return

Referenced by scale_element_hexahedral::hexhedralelement_init(), scale_element_base::elementbase::islumpedmatrix(), scale_element_line::lineelement_init(), and scale_element_quadrilateral::quadrilateralelement_init().

◆ elementbase_construct_liftmat()

subroutine, public scale_element_base::elementbase_construct_liftmat ( real(rp), dimension(np,np), intent(in) invm,
real(rp), dimension(np,nfptot), intent(in) emat,
integer, intent(in) np,
integer, intent(in) nfptot,
real(rp), dimension(np,nfptot), intent(out) liftmat )

Construct stiffness matrix StiffMat_i = M^-1 ( M D_xi )^T.

Definition at line 252 of file scale_element_base.F90.

254 implicit none
255 integer, intent(in) :: Np
256 integer, intent(in) :: NfpTot
257 real(RP), intent(in) :: invM(Np,Np)
258 real(RP), intent(in) :: EMat(Np,NfpTot)
259 real(RP), intent(out) :: LiftMat(Np,NfpTot)
260 !------------------------------------
261
262 liftmat(:,:) = matmul( invm, emat )
263 return

Referenced by scale_element_hexahedral::hexhedralelement_init(), scale_element_base::elementbase::islumpedmatrix(), scale_element_line::lineelement_init(), and scale_element_quadrilateral::quadrilateralelement_init().

◆ elementbase1d_init()

subroutine, public scale_element_base::elementbase1d_init ( class(elementbase1d), intent(inout) elem,
logical, intent(in) lumpedmat_flag )

Definition at line 269 of file scale_element_base.F90.

270 implicit none
271
272 class(ElementBase1D), intent(inout) :: elem
273 logical, intent(in) :: lumpedmat_flag
274 !-----------------------------------------------------------------------------
275
276 call elementbase_init( elem, lumpedmat_flag )
277
278 allocate( elem%x1(elem%Np) )
279 allocate( elem%Fmask(elem%Nfp, elem%Nfaces) )
280
281 allocate( elem%Dx1(elem%Np, elem%Np) )
282 allocate( elem%Sx1(elem%Np, elem%Np) )
283
284 return

Referenced by scale_element_line::lineelement_init().

◆ elementbase1d_final()

subroutine, public scale_element_base::elementbase1d_final ( class(elementbase1d), intent(inout) elem)

Definition at line 288 of file scale_element_base.F90.

289 implicit none
290
291 class(ElementBase1D), intent(inout) :: elem
292 !-----------------------------------------------------------------------------
293
294 if ( allocated( elem%x1 ) ) then
295 deallocate( elem%x1 )
296 deallocate( elem%Dx1 )
297 deallocate( elem%Sx1 )
298 deallocate( elem%Fmask )
299 end if
300
301 call elementbase_final( elem )
302
303 return

Referenced by scale_element_line::lineelement_init().

◆ elementbase2d_init()

subroutine, public scale_element_base::elementbase2d_init ( class(elementbase2d), intent(inout) elem,
logical, intent(in) lumpedmat_flag )

Definition at line 309 of file scale_element_base.F90.

310 implicit none
311
312 class(ElementBase2D), intent(inout) :: elem
313 logical, intent(in) :: lumpedmat_flag
314 !-----------------------------------------------------------------------------
315
316 call elementbase_init( elem, lumpedmat_flag )
317
318 allocate( elem%x1(elem%Np), elem%x2(elem%Np) )
319 allocate( elem%Fmask(elem%Nfp, elem%Nfaces) )
320
321 allocate( elem%Dx1(elem%Np, elem%Np), elem%Dx2(elem%Np, elem%Np) )
322 allocate( elem%Sx1(elem%Np, elem%Np), elem%Sx2(elem%Np, elem%Np) )
323
324 return

Referenced by scale_element_quadrilateral::quadrilateralelement_init().

◆ elementbase2d_final()

subroutine, public scale_element_base::elementbase2d_final ( class(elementbase2d), intent(inout) elem)

Definition at line 328 of file scale_element_base.F90.

329 implicit none
330
331 class(ElementBase2D), intent(inout) :: elem
332 !-----------------------------------------------------------------------------
333
334 if ( allocated( elem%x1 ) ) then
335 deallocate( elem%x1, elem%x2 )
336 deallocate( elem%Fmask )
337
338 deallocate( elem%Dx1, elem%Dx2 )
339 deallocate( elem%Sx1, elem%Sx2 )
340 end if
341
342 call elementbase_final( elem )
343
344 return

Referenced by scale_element_quadrilateral::quadrilateralelement_init().

◆ elementbase3d_init()

subroutine, public scale_element_base::elementbase3d_init ( class(elementbase3d), intent(inout) elem,
logical, intent(in) lumpedmat_flag )

Definition at line 350 of file scale_element_base.F90.

351 implicit none
352
353 class(ElementBase3D), intent(inout) :: elem
354 logical, intent(in) :: lumpedmat_flag
355 !-----------------------------------------------------------------------------
356
357 call elementbase_init( elem, lumpedmat_flag )
358
359 allocate( elem%x1(elem%Np), elem%x2(elem%Np), elem%x3(elem%Np) )
360 allocate( elem%Dx1(elem%Np, elem%Np), elem%Dx2(elem%Np, elem%Np), elem%Dx3(elem%Np, elem%Np) )
361 allocate( elem%Sx1(elem%Np, elem%Np), elem%Sx2(elem%Np, elem%Np), elem%Sx3(elem%Np, elem%Np) )
362 allocate( elem%Fmask_h(elem%Nfp_h, elem%Nfaces_h), elem%Fmask_v(elem%Nfp_v, elem%Nfaces_v) )
363 allocate( elem%Colmask(elem%Nnode_v,elem%Nfp_v))
364 allocate( elem%Hslice(elem%Nfp_v,elem%Nnode_v) )
365 allocate( elem%IndexH2Dto3D(elem%Np) )
366 allocate( elem%IndexH2Dto3D_bnd(elem%NfpTot) )
367 allocate( elem%IndexZ1Dto3D(elem%Np) )
368
369 return

Referenced by scale_element_hexahedral::hexhedralelement_init().

◆ elementbase3d_final()

subroutine, public scale_element_base::elementbase3d_final ( class(elementbase3d), intent(inout) elem)

Definition at line 373 of file scale_element_base.F90.

374 implicit none
375
376 class(ElementBase3D), intent(inout) :: elem
377 !-----------------------------------------------------------------------------
378
379 if ( allocated( elem%x1 ) ) then
380 deallocate( elem%x1, elem%x2, elem%x3 )
381 deallocate( elem%Dx1, elem%Dx2, elem%Dx3 )
382 deallocate( elem%Sx1, elem%Sx2, elem%Sx3 )
383 deallocate( elem%Fmask_h, elem%Fmask_v )
384 deallocate( elem%Colmask, elem%Hslice )
385 deallocate( elem%IndexH2Dto3D, elem%IndexH2Dto3D_bnd )
386 deallocate( elem%IndexZ1Dto3D )
387 end if
388
389 call elementbase_final( elem )
390
391 return

Referenced by scale_element_hexahedral::hexhedralelement_init().