Pb with conditional Dirichlet

Clearly defined bug reports and their fixes
Post Reply
fgillet
Posts: 38
Joined: 30 Sep 2010, 16:58

Pb with conditional Dirichlet

Post by fgillet » 03 Apr 2018, 19:10

Hello;

It seems that Solver % Matrix % ConstrainedDOF is never reinitailised to FALSE so that when a node get a Dirichlet condition, it will always apply a Dirichlet condition. This could be a problem when using a "Condition" for the dirichlet condition and when the condition change from TRUE to FALSE.

A fix for the default beahaviour is:
Line 4384 of DefUtils.F90 (in DefaultDirichletBCs):
A % ConstrainedDOF = .FALSE.
should come after the ENDIF so that it will be re-initialized at each call of DefaultDirichletBCs;


However this do not solve the issue for solvers that do not use the DefaultDirichletBCs routine.

best regards,

Fabien

raback
Site Admin
Posts: 3277
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Pb with conditional Dirichlet

Post by raback » 04 Apr 2018, 12:31

Hi Fabien

Now the Dirichlet conditions are enforced at the end of DefaultDirichletBCs() so that has to be the last routine to call when setting Dirichlet conditions. However, I know that there are some codes which set Dirichlet BCs outside that routine. Hence putting the initilization of ConstrainedDOF in front of DefaultDirichletBCs() would make these codes of no effect.

For this reason the initialization of ConstrainDOFs and DValues is also done in DefaultInitialize() which should be called prior to every timestep. Hence my recommendation would be to put the DefaultInialize() before start of the assembly. Then the conditional conditions should also be correctly treated. Would this solve your problem at hand?

-Peter

fgillet
Posts: 38
Joined: 30 Sep 2010, 16:58

Re: Pb with conditional Dirichlet

Post by fgillet » 04 Apr 2018, 13:00

Hi Peter;

Yes a call to DefaultInitialize() will also solve our problem.
Currently we have this problem with the Navier-Stokes solver, I see that it is calling InitializeToZero().
Replacing the InitializeToZero() line by CALL DefaultInitialize() will sove our problem.

I see that there is few other solvers that have the CALL InitializeToZero instead of DefaultInitialize() ; especially for ParStokes I think that the lines:
CALL InitializeToZero( AMatrix, AMatrix % RHS )
CALL InitializeToZero( PMatrix, PMatrix % RHS )
can be changed respectively by:
CALL DefaultInitialize(USolver=VelocitySolver)
CALL DefaultInitialize(USolver=PressureSolver)

thanks

fabien

raback
Site Admin
Posts: 3277
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Pb with conditional Dirichlet

Post by raback » 04 Apr 2018, 16:05

Hi Fabien

Thanx. I did exactly this for FlowSolve. Maybe you can test ParStokes that it is ok there too before committing. FlowSolve is more of a standard solver.

-Peter

fgillet
Posts: 38
Joined: 30 Sep 2010, 16:58

Re: Pb with conditional Dirichlet

Post by fgillet » 04 Apr 2018, 16:12

ok.
Thanks!

Fabien

Post Reply