hardcoding '3' is an issue for 2d simulations

This commit is contained in:
Sharan Roongta 2021-06-11 20:39:44 +02:00
parent e2ce882d73
commit c64f9eb805
3 changed files with 7 additions and 9 deletions

@ -1 +1 @@
Subproject commit ddfefc187a4268665b779bb847a41d810aece201
Subproject commit f1fd2f2e8cdb8df36e27f421acbaff0bad22f8c0

View File

@ -80,8 +80,8 @@ subroutine discretization_results
call results_closeGroup(results_addGroup('current/geometry'))
u = discretization_NodeCoords (1:3,:discretization_sharedNodesBegin) &
- discretization_NodeCoords0(1:3,:discretization_sharedNodesBegin)
u = discretization_NodeCoords (:,:discretization_sharedNodesBegin) &
- discretization_NodeCoords0(:,:discretization_sharedNodesBegin)
call results_writeDataset(u,'current/geometry','u_n','displacements of the nodes','m')
u = discretization_IPcoords &

View File

@ -146,10 +146,9 @@ subroutine discretization_mesh_init(restart)
! Get initial nodal coordinates
call DMGetCoordinates(geomMesh,coords_node0,ierr)
CHKERRQ(ierr)
allocate(mesh_node0_temp(dimPlex*mesh_Nnodes))
call VecGetArrayF90(coords_node0, mesh_node0_temp,ierr)
CHKERRQ(ierr)
mesh_maxNips = FEM_nQuadrature(dimPlex,integrationOrder)
call mesh_FEM_build_ipCoordinates(dimPlex,FEM_quadrature_points(dimPlex,integrationOrder)%p)
@ -165,14 +164,13 @@ subroutine discretization_mesh_init(restart)
if (debug_element < 1 .or. debug_element > mesh_NcpElems) call IO_error(602,ext_msg='element')
if (debug_ip < 1 .or. debug_ip > mesh_maxNips) call IO_error(602,ext_msg='IP')
allocate(mesh_node0(3,mesh_Nnodes),source=0.0_pReal)
mesh_node0 = reshape(mesh_node0_temp,[dimPlex,mesh_Nnodes])
call discretization_init(materialAt,&
reshape(mesh_ipCoordinates,[3,mesh_maxNips*mesh_NcpElems]), &
reshape(mesh_ipCoordinates,[dimPlex,mesh_maxNips*mesh_NcpElems]), &
mesh_node0)
call writeGeometry(reshape(mesh_ipCoordinates,[3,mesh_maxNips*mesh_NcpElems]),mesh_node0)
call writeGeometry(reshape(mesh_ipCoordinates,[dimPlex,mesh_maxNips*mesh_NcpElems]),mesh_node0)
end subroutine discretization_mesh_init
@ -216,7 +214,7 @@ subroutine mesh_FEM_build_ipCoordinates(dimPlex,qPoints)
PetscErrorCode :: ierr
allocate(mesh_ipCoordinates(3,mesh_maxNips,mesh_NcpElems),source=0.0_pReal)
allocate(mesh_ipCoordinates(dimPlex,mesh_maxNips,mesh_NcpElems),source=0.0_pReal)
allocate(pV0(dimPlex))
allocatE(pCellJ(dimPlex**2))