[Dune] Help requested for my first test case in non linear mechanics

HELFER Thomas 202608 thomas.helfer at cea.fr
Thu Apr 16 22:16:51 CEST 2020


Dear all,
After normalizing correctly my matrix when applying boundary conditions and switching to UMFPack,
my test case runs perfectly fine in elasticity and in plasticity.
I can now continue my discovery of DUNE with an axisymmetric notched bar with finite strain elasto-plastic behaviour.
Special thanks to Oliver, Christian and Carsten.
Regards,
Thomas

P.S. 1: Using UMFPack seems quite slow on a 5*5*5 grid, is it normal ?

P.S. 2:  I was not able to use SuperLU. This may be related to the fact that I tried to guess the value of various macros (include SUPERLU_INT_TYPE and DOUBLE),
but I report it here in the unrealistic case that the bindings are broken:


/home/th202608/codes/dune/2.7/install/include/dune/istl/superlu.hh:584:42: erreur: « create » n'est pas un membre de « Dune::SuperLUDenseMatChooser<double> »
  584 |         SuperLUDenseMatChooser<T>::create(&B, (int)mat.N(), 1,  reinterpret_cast<T*>(&b[0]), (int)mat.N(), SLU_DN, GetSuperLUType<T>::type, SLU_GE);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dans le fichier inclus depuis /home/th202608/codes/dune/2.7/tests/dune-mgis/src/dune-mgis-tensile-test.cc:25:
/home/th202608/codes/dune/2.7/install/include/dune/istl/superlu.hh:585:42: erreur: « create » n'est pas un membre de « Dune::SuperLUDenseMatChooser<double> »
  585 |         SuperLUDenseMatChooser<T>::create(&X, (int)mat.N(), 1,  reinterpret_cast<T*>(&x[0]), (int)mat.N(), SLU_DN, GetSuperLUType<T>::type, SLU_GE);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/th202608/codes/dune/2.7/install/include/dune/istl/superlu.hh:592:40: erreur: « create » n'est pas un membre de « Dune::SuperLUDenseMatChooser<double> »
  592 |       SuperLUDenseMatChooser<T>::create(&rB, (int)mat.N(), 1,  reinterpret_cast<T*>(&b[0]), (int)mat.N(), SLU_DN, GetSuperLUType<T>::type, SLU_GE);
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/th202608/codes/dune/2.7/install/include/dune/istl/superlu.hh:593:40: erreur: « create » n'est pas un membre de « Dune::SuperLUDenseMatChooser<double> »
  593 |       SuperLUDenseMatChooser<T>::create(&rX, (int)mat.N(), 1,  reinterpret_cast<T*>(&x[0]), (int)mat.N(), SLU_DN, GetSuperLUType<T>::type, SLU_GE);
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

________________________________________
De : Oliver Sander [oliver.sander at tu-dresden.de]
Envoyé : jeudi 16 avril 2020 12:36
À : HELFER Thomas 202608; dune at lists.dune-project.org
Objet : Re: [Dune] Help requested for my first test case in non linear mechanics

Hi Thomas,

in line 363 you do

        if (cIt.index() == i) {
          Ke[c][c] = 1;
        }

to set the diagonal entry of a Dirichlet row to 1.  But in this context,
Ke is a 3x3 FieldMatrix, and what you get is a block that looks like this:

1  1  1
1  1  1
1  1  1

That's not good.

Best,
Oliver

PS: I just noticed that you implemented a method for the multiplication of
two FieldMatrix objects.  There is no need for that: you can use operator*.


On 16.04.20 11:30, HELFER Thomas 202608 wrote:
> Hi Olivier,
> I am sorry, I did not understand your point here. I did not want to replace the matrix by a diagonal one,
> just erase the row corresponding to the component upon which this boundary conditions acts.
> Have I missed something ?
> Thomas
> ________________________________________
> De : Dune [dune-bounces at lists.dune-project.org] de la part de Oliver Sander [oliver.sander at tu-dresden.de]
> Envoyé : jeudi 16 avril 2020 11:11
> À : dune at lists.dune-project.org
> Objet : Re: [Dune] Help requested for my first test case in non linear mechanics
>
> Hi Thomas,
>
> AFAICT, your method apply_boundary_conditions contains a classic mistake:
> You are not setting the matrix diagonals correctly.  See Chapter 7.3.2.1
> in my book for details.
>
> Best,
> Oliver
>
> On 16.04.20 09:39, HELFER Thomas 202608 wrote:
>> Hi Oliver,
>>
>> thanks for this feedback. I will compare my stiffness matrix to the one get with another code,
>> that probably the best way to go. But I felt rather confident...
>>
>> But it does seems like something nasty is happening in my code.
>>
>> Something is itching me about the linear solver: the defect becomes very high but the solver
>> converges to the given criterion (a reduction to 1.e-5). However, my Dirichlet boundary
>> conditions are not met.
>>
>> So either my handling of the Dirichlet boundaryd condtions is wrong, or my usage of the linear solver is
>> (or both).
>>
>> Is there an example of how to replace the linear solver by a direct solver ?
>>
>> Regards,
>>
>> Thomas
>> ________________________________________
>> De : Oliver Sander [oliver.sander at tu-dresden.de]
>> Envoyé : jeudi 16 avril 2020 09:07
>> À : dune at lists.dune-project.org; HELFER Thomas 202608
>> Objet : Re: [Dune] Help requested for my first test case in non linear mechanics
>>
>> Hi Thomas,
>>
>>> It almost works. I can simulate a tensile test for an elastic behaviour and a plastic behaviour.
>>> I probably can use any smal strain behaviour generated by MFront. The non-linearity is treated
>>> very crudely as we use an Newton algorithm with a fixed number of iterations.
>>
>> that sounds pretty good already.
>>
>>> The trouble is that it only works if the grid contains only a single element. This probably means
>>> that I made a mistake in the assembly of the stiffness matrix or the assembly of the inner
>>> forces. I reread my code several times without finding the trouble.
>>
>> Did you check whether the matrix and forces are assembled correctly?
>> What I would do is choose a very small grid (say, 2x2), assemble everything,
>> and write the matrix and forces to a file (or print them to the screen).
>> Then compare with one of your working implementations.  This will allow you
>> to narrow down the cause of your problem.
>>
>> Helpers for writing/printing vectors and sparse matrices can be found in dune/istl/io.hh.
>>
>> Bonne chance,
>> Oliver
>>
>>
>>
>>>
>>> Please find enclosed my project, modified to drop the dependency to the MGIS library and
>>> only integrate an isotropic elastic behaviour. The relevant file is
>>> dune-mgis/src/dune-mgis-tensile-test.cc.
>>>
>>> The purpose of my request is twofold:
>>>
>>> - I would be grateful if anyone could find what I have done wrong.
>>> - I would be grateful if anyone could review the code to tell me what could be improved.
>>>
>>> With kind regards,
>>>
>>> Thomas Helfer
>>>
>>>
>>> _______________________________________________
>>> Dune mailing list
>>> Dune at lists.dune-project.org
>>> https://lists.dune-project.org/mailman/listinfo/dune
>>>
>>
>





More information about the Dune mailing list