Skip to content

Commit

Permalink
Revert edges and faces is not needed.
Browse files Browse the repository at this point in the history
  • Loading branch information
raback committed Jan 31, 2025
1 parent 29022a3 commit 9ab45a5
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 19 deletions.
15 changes: 10 additions & 5 deletions fem/src/MeshUtils.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2969,7 +2969,7 @@ SUBROUTINE PrepareMesh( Model, Mesh, Parallel, Def_Dofs, mySolver, InitOnly)
! So we can do just partial initializations and leave early.
IF(PRESENT(InitOnly)) THEN
IF(InitOnly) THEN
CALL NonNodalElements()
!CALL NonNodalElements()
!CALL EnlargeCoordinates( Mesh )
CALL Info(Caller,'Skipping rest of mesh preparation!',Found )
RETURN
Expand Down Expand Up @@ -3484,10 +3484,6 @@ SUBROUTINE NonNodalElements()
IF(PRESENT(mySolver)) THEN
Stat = ListGetLogical(Model % Solvers(mySolver) % Values, 'Need Edges', Found)
IF(Found) NeedEdges = Stat

IF( ListGetLogical(Model % Solvers(mySolver) % Values, 'NeedEdges', Found) ) THEN
IF(.NOT. NeedEdges) CALL Fatal('NonNodalElements','Use "Need Edges" instead of "NeedEdges"')
END IF
END IF

IF( Mesh % MeshDim == 2 ) THEN
Expand Down Expand Up @@ -3520,6 +3516,15 @@ SUBROUTINE NonNodalElements()
CALL Info('NonNodalElements','Element dofs max: '//I2S(Mesh % MaxElementDofs),Level=12)
END IF


IF( Mesh % MaxFaceDofs + Mesh % MaxEdgeDofs == 0 ) THEN
CALL Info('NonNodalElements','Why the heck did we allocate the edges and faces?!')
CALL ReleaseMeshEdgeTables( Mesh )
CALL ReleaseMeshFaceTables( Mesh )
END IF



END SUBROUTINE NonNodalElements


Expand Down
28 changes: 14 additions & 14 deletions fem/src/ModelDescription.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2535,9 +2535,9 @@ FUNCTION LoadModel( ModelName,BoundariesOnly,numprocs,mype,MeshIndex) RESULT( Mo
TYPE(Model_t), POINTER :: Model
!------------------------------------------------------------------------------
TYPE(Mesh_t), POINTER :: Mesh,Mesh1,NewMesh,OldMesh,SerialMesh
INTEGER :: i,j,k,s,nlen,eqn,MeshKeep,MeshLevels,nprocs,ModuloMesh,iostat
INTEGER :: i,j,k,s,nlen,eqn,MeshKeep,MeshLevels,nprocs,ModuloMesh,iostat,iLevel
LOGICAL :: GotIt,GotMesh,found,OneMeshName, OpenFile, Transient
LOGICAL :: stat, single, MeshGrading
LOGICAL :: stat, single, MeshGrading, Split
TYPE(Solver_t), POINTER :: Solver
INTEGER(KIND=AddrInt) :: InitProc
INTEGER, TARGET :: Def_Dofs(10,6)
Expand Down Expand Up @@ -2924,7 +2924,7 @@ FUNCTION LoadModel( ModelName,BoundariesOnly,numprocs,mype,MeshIndex) RESULT( Mo
MeshPower = ListGetConstReal( Model % Simulation, 'Mesh Grading Power',GotIt)
MeshGrading = ListGetLogical( Model % Simulation, 'Mesh Keep Grading', GotIt)

DO i=2,MeshLevels
DO iLevel=2,MeshLevels
OldMesh => Model % Meshes

IF (MeshGrading) THEN
Expand Down Expand Up @@ -2954,7 +2954,7 @@ FUNCTION LoadModel( ModelName,BoundariesOnly,numprocs,mype,MeshIndex) RESULT( Mo
CALL SetMeshMaxDofs(NewMesh)
END IF

IF ( i>MeshLevels-MeshKeep+1 ) THEN
IF ( iLevel > MeshLevels-MeshKeep+1 ) THEN
NewMesh % Next => OldMesh
NewMesh % Parent => OldMesh
OldMesh % Child => NewMesh
Expand All @@ -2963,16 +2963,12 @@ FUNCTION LoadModel( ModelName,BoundariesOnly,numprocs,mype,MeshIndex) RESULT( Mo
ELSE
CALL ReleaseMesh(OldMesh)
END IF
Model % Meshes => NewMesh

IF( ListCheckPresentAnyBC( Model,'Conforming BC' ) ) THEN
CALL GeneratePeriodicProjectors( Model, NewMesh )
END IF

Model % Meshes => NewMesh
END DO


IF( ListGetLogical( Model % Simulation,'Mesh Split Levelset', GotIt) ) THEN
Split = ListGetLogical( Model % Simulation,'Mesh Split Levelset', GotIt)
IF( Split ) THEN
OldMesh => Model % Meshes
NewMesh => SplitMeshLevelset(OldMesh,Model % Simulation)
IF(ASSOCIATED(NewMesh) ) THEN
Expand All @@ -2982,10 +2978,14 @@ FUNCTION LoadModel( ModelName,BoundariesOnly,numprocs,mype,MeshIndex) RESULT( Mo
END IF
END IF

IF( MeshLevels > 1 ) THEN
IF( MeshLevels > 1 .OR. Split ) THEN
! This has been commented out, but is needed. There may be some issues in parallel still...
IF(ListGetLogical(Model % Simulation,'Prepare Mesh Before Split',GotIt) ) THEN
CALL PrepareMesh( Model, NewMesh, ParEnv % PEs > 1, InitOnly = (i<MeshLevels) )
!IF(ListGetLogical(Model % Simulation,'Prepare Mesh Before Split',GotIt) ) THEN
CALL SetMeshMaxDofs(NewMesh)
CALL PrepareMesh( Model, NewMesh, ParEnv % PEs > 1 )
!END IF
IF( ListCheckPresentAnyBC( Model,'Conforming BC' ) ) THEN
CALL GeneratePeriodicProjectors( Model, NewMesh )
END IF
END IF

Expand Down

0 comments on commit 9ab45a5

Please sign in to comment.