Page 1 of 1

Changes to parstokes Solver?

Posted: 02 Feb 2018, 18:48
by Clemens
Hi y'all

I updated to a newer code version of Elmer a few days ago and wanted to start optimising my Par-Stokes set-up. With the old version the code runs smoothly, but with the newer version it only works if I comment out the line

Code: Select all

Element = "p:1 b:4"  
in all three solvers. However doing this made the solver significantly slower and in some cases it did not even converge. Even Thomas' course example crashes. Does anyone know if there have been any updates to the ParStokes solver? A quick diff between the version did not indicate any important changes.

Cheers, Clemens

Re: Changes to parstokes Solver?

Posted: 02 Feb 2018, 18:56
by raback
Hi

There have been some changes to library but they should not affect "Element" definitions.

Could you share a test case. The standard ones seem to pass.

-Peter

Re: Changes to parstokes Solver?

Posted: 05 Feb 2018, 15:25
by Clemens
Hi Peter,

So here is a test case Thomas presented at the last Elmer/Ice course that used to work without problems, but now crashes with a segfault.

Cheers, Clemens

Re: Changes to parstokes Solver?

Posted: 06 Feb 2018, 11:15
by Juha
Hi

The patch below fixes the case. There seems to have been a misunderstaning of the role of the variable initialization statement
in Fortran, which is very different from c/c++. Fortran initializes the variable only once (not at each re-entry) and so the initialization
also implies saving of the variable between calls.

I'll apply this to 'devel' shortly.

BR, Juha


diff --git a/fem/src/MeshUtils.F90 b/fem/src/MeshUtils.F90
index f7dfa3f..85d8efa 100644
--- a/fem/src/MeshUtils.F90
+++ b/fem/src/MeshUtils.F90
@@ -2852,13 +2852,13 @@ END SUBROUTINE GetMaxDefs
!------------------------------------------------------------------------------
INTEGER :: i,j,el_id
TYPE(Element_t), POINTER :: Element, Edge, Face
- LOGICAL :: AssignEdges=.FALSE.
+ LOGICAL :: AssignEdges
!------------------------------------------------------------------------------

CALL FindMeshEdges(Mesh)

- IF (PRESENT(NeedEdges)) &
- AssignEdges = NeedEdges
+ AssignEdges = .FALSE.
+ IF (PRESENT(NeedEdges)) AssignEdges = NeedEdges

! Set edge and face polynomial degree and degrees of freedom for
! all elements
@@ -15487,10 +15487,10 @@ CONTAINS

INTEGER i,j,n,edgeNumber, numEdges, bMap(4)
TYPE(Element_t), POINTER :: Edge
- LOGICAL :: EvalPE=.TRUE.
+ LOGICAL :: EvalPE

- IF(PRESENT(NoPE)) &
- EvalPE = .NOT.NoPE
+ EvalPE = .TRUE.
+ IF(PRESENT(NoPE)) EvalPE = .NOT.NoPE

! Get number of points, edges or faces
numEdges = 0

Re: Changes to parstokes Solver?

Posted: 12 Feb 2018, 10:25
by Clemens
Hi Juha,

Thanks for the quick response. Could you give this thread a bump once this has been updated in 'devel'?

Cheers, Clemens

Re: Changes to parstokes Solver?

Posted: 12 Feb 2018, 11:14
by raback
Hi Clemens,

I think it is already at the devel, see
https://github.com/ElmerCSC/elmerfem/co ... 019f73da18

-Peter

Re: Changes to parstokes Solver?

Posted: 20 Feb 2018, 09:54
by Clemens
A little late, but thanks for the info and the quick fix. All works well again.

Cheers, Clemens