From f2d1343cdf5045b3c022d762a50b75dbd07c03aa Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 13 May 2020 12:58:39 +0200 Subject: [PATCH 1/4] need to select the whole mesh --- src/mesh/mesh_mech_FEM.f90 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/mesh/mesh_mech_FEM.f90 b/src/mesh/mesh_mech_FEM.f90 index 8206f4174..0deca3e03 100644 --- a/src/mesh/mesh_mech_FEM.f90 +++ b/src/mesh/mesh_mech_FEM.f90 @@ -73,7 +73,7 @@ subroutine FEM_mech_init(fieldBC) PetscQuadrature :: mechQuad, functional PetscDS :: mechDS PetscDualSpace :: mechDualSpace - DMLabel, dimension(:),pointer :: pBCLabel + DMLabel, dimension(:),pointer :: nolabel=> NULL() DMLabel :: BCLabel PetscInt, dimension(:), pointer :: pNumComp, pNumDof, pBcField, pBcPoint @@ -182,8 +182,7 @@ subroutine FEM_mech_init(fieldBC) call DMPlexCreateSection(mech_mesh,dimPlex,1,pNumComp,pNumDof, & numBC,pBcField,pBcComps,pBcPoints,PETSC_NULL_IS,section,ierr) #else - allocate(pBClabel(1),source=BClabel) - call DMPlexCreateSection(mech_mesh,pBClabel,pNumComp,pNumDof, & + call DMPlexCreateSection(mech_mesh,nolabel,pNumComp,pNumDof, & numBC,pBcField,pBcComps,pBcPoints,PETSC_NULL_IS,section,ierr) #endif From 530623a2b395c66164a665f23d2d08d87c4c4fb9 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 13 May 2020 13:15:37 +0200 Subject: [PATCH 2/4] function was only renamed in PETSc 3.12 --- src/mesh/mesh_mech_FEM.f90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mesh/mesh_mech_FEM.f90 b/src/mesh/mesh_mech_FEM.f90 index 0deca3e03..60c7fd942 100644 --- a/src/mesh/mesh_mech_FEM.f90 +++ b/src/mesh/mesh_mech_FEM.f90 @@ -136,7 +136,7 @@ subroutine FEM_mech_init(fieldBC) ! Setup FEM mech boundary conditions call DMGetLabel(mech_mesh,'Face Sets',BCLabel,ierr); CHKERRQ(ierr) call DMPlexLabelComplete(mech_mesh,BCLabel,ierr); CHKERRQ(ierr) -#if (PETSC_VERSION_MINOR < 11) +#if (PETSC_VERSION_MINOR < 12) call DMGetSection(mech_mesh,section,ierr); CHKERRQ(ierr) #else call DMGetLocalSection(mech_mesh,section,ierr); CHKERRQ(ierr) @@ -329,7 +329,7 @@ subroutine FEM_mech_formResidual(dm_local,xx_local,f_local,dummy,ierr) allocate(pinvcellJ(dimPlex**2)) allocate(x_scal(cellDof)) -#if (PETSC_VERSION_MINOR < 11) +#if (PETSC_VERSION_MINOR < 12) call DMGetSection(dm_local,section,ierr); CHKERRQ(ierr) #else call DMGetLocalSection(dm_local,section,ierr); CHKERRQ(ierr) @@ -483,7 +483,7 @@ subroutine FEM_mech_formJacobian(dm_local,xx_local,Jac_pre,Jac,dummy,ierr) call MatZeroEntries(Jac,ierr); CHKERRQ(ierr) call DMGetDS(dm_local,prob,ierr); CHKERRQ(ierr) call PetscDSGetTabulation(prob,0,basisField,basisFieldDer,ierr) -#if (PETSC_VERSION_MINOR < 11) +#if (PETSC_VERSION_MINOR < 12) call DMGetSection(dm_local,section,ierr); CHKERRQ(ierr) #else call DMGetLocalSection(dm_local,section,ierr); CHKERRQ(ierr) From 1885a701facf0668e5dc9a4f844f2bcc8e87fd22 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 13 May 2020 13:39:23 +0200 Subject: [PATCH 3/4] nothing to debug here --- src/mesh/mesh_mech_FEM.f90 | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/mesh/mesh_mech_FEM.f90 b/src/mesh/mesh_mech_FEM.f90 index 60c7fd942..404238453 100644 --- a/src/mesh/mesh_mech_FEM.f90 +++ b/src/mesh/mesh_mech_FEM.f90 @@ -357,14 +357,10 @@ subroutine FEM_mech_formResidual(dm_local,xx_local,f_local,dummy,ierr) ! evaluate field derivatives do cell = cellStart, cellEnd-1 !< loop over all elements - ! BEGIN DEBUG call PetscSectionGetNumFields(section,numFields,ierr) CHKERRQ(ierr) - write(6,*) 'numFields', numFields call DMPlexGetDepth(dm_local,depth,ierr) CHKERRQ(ierr) - write(6,*) 'depth', depth - ! END DEBUG call DMPlexVecGetClosure(dm_local,section,x_local,cell,x_scal,ierr) !< get Dofs belonging to element CHKERRQ(ierr) From 431284aa95db1633be5ae4d1c56a754023767154 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 1 Jun 2020 18:23:01 +0200 Subject: [PATCH 4/4] not needed --- src/mesh/mesh_mech_FEM.f90 | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/mesh/mesh_mech_FEM.f90 b/src/mesh/mesh_mech_FEM.f90 index 71292b156..5038d5f07 100644 --- a/src/mesh/mesh_mech_FEM.f90 +++ b/src/mesh/mesh_mech_FEM.f90 @@ -314,7 +314,7 @@ subroutine FEM_mech_formResidual(dm_local,xx_local,f_local,dummy,ierr) PetscReal, pointer,dimension(:) :: pV0, pCellJ, pInvcellJ, basisField, basisFieldDer PetscInt :: cellStart, cellEnd, cell, field, face, & qPt, basis, comp, cidx, & - numFields, depth ! < DEBUG + numFields PetscReal :: detFAvg PetscReal :: BMat(dimPlex*dimPlex,cellDof) @@ -357,9 +357,6 @@ subroutine FEM_mech_formResidual(dm_local,xx_local,f_local,dummy,ierr) call PetscSectionGetNumFields(section,numFields,ierr) CHKERRQ(ierr) - call DMPlexGetDepth(dm_local,depth,ierr) - CHKERRQ(ierr) - call DMPlexVecGetClosure(dm_local,section,x_local,cell,x_scal,ierr) !< get Dofs belonging to element CHKERRQ(ierr) call DMPlexComputeCellGeometryAffineFEM(dm_local,cell,pV0,pCellJ,pInvcellJ,detJ,ierr)