initialize element where defined

This commit is contained in:
Martin Diehl 2019-01-24 16:50:23 +01:00
parent 42cc9b8d2b
commit ab93a86b3e
2 changed files with 34 additions and 4 deletions

View File

@ -9,11 +9,11 @@ module FEM_Zoo
private
integer(pInt), parameter, public:: &
maxOrder = 5 !< current max interpolation set at cubic (intended to be arbitrary)
real(pReal), dimension(2,3), private, protected :: &
real(pReal), dimension(2,3), private, parameter :: &
triangle = reshape([-1.0_pReal, -1.0_pReal, &
1.0_pReal, -1.0_pReal, &
-1.0_pReal, 1.0_pReal], shape=[2,3])
real(pReal), dimension(3,4), private, protected :: &
real(pReal), dimension(3,4), private, parameter :: &
tetrahedron = reshape([-1.0_pReal, -1.0_pReal, -1.0_pReal, &
1.0_pReal, -1.0_pReal, -1.0_pReal, &
-1.0_pReal, 1.0_pReal, -1.0_pReal, &

View File

@ -12,7 +12,7 @@ module mesh
#include <petsc/finclude/petscis.h>
#include <petsc/finclude/petscdmda.h>
use prec, only: pReal, pInt
use mesh_base
use PETScdmplex
use PETScdmda
use PETScis
@ -80,6 +80,17 @@ use PETScis
integer(pInt), dimension(1_pInt), parameter, public :: FE_NipNeighbors = & !< number of ip neighbors / cell faces in a specific cell type
int([6],pInt)
type, public, extends(tMesh) :: tMesh_FEM
contains
procedure :: init => tMesh_FEM_init
end type tMesh_FEM
type(tMesh_FEM), public, protected :: theMesh
public :: &
mesh_init, &
@ -89,6 +100,23 @@ use PETScis
contains
subroutine tMesh_FEM_init(self,dimen,order)
implicit none
integer(pInt), intent(in) :: dimen,order
class(tMesh_FEM) :: self
if (dimen == 2_pInt) then
if (order == 1_pInt) call self%elem%init(1_pInt)
if (order == 2_pInt) call self%elem%init(2_pInt)
elseif(dimen == 3_pInt) then
if (order == 1_pInt) call self%elem%init(6_pInt)
if (order == 2_pInt) call self%elem%init(8_pInt)
endif
end subroutine tMesh_FEM_init
!--------------------------------------------------------------------------------------------------
!> @brief initializes the mesh by calling all necessary private routines the mesh module
@ -213,6 +241,8 @@ subroutine mesh_init()
FE_Nips(FE_geomtype(1_pInt)) = FEM_Zoo_nQuadrature(dimPlex,integrationOrder)
mesh_maxNips = FE_Nips(1_pInt)
write(6,*) 'mesh_maxNips',mesh_maxNips
call mesh_FEM_build_ipCoordinates(dimPlex,FEM_Zoo_QuadraturePoints(dimPlex,integrationOrder)%p)
call mesh_FEM_build_ipVolumes(dimPlex)
@ -243,7 +273,7 @@ subroutine mesh_init()
mesh_homogenizationAt = mesh_element(3,:)
mesh_microstructureAt = mesh_element(4,:)
!!!!!!!!!!!!!!!!!!!!!!!!
call theMesh%init(dimplex,integrationOrder)
end subroutine mesh_init