# CalculiX & Mfront

**URL:** <https://calculix.discourse.group/t/calculix-mfront/205>\
**Category:** Tool interfaces\
**Created:** [September 24, 2020, 7:27am UTC](https://calculix.discourse.group/t/calculix-mfront/205 "2020-09-24T07:27:44Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![rafal.brzegowy](https://avatars.discourse-cdn.com/v4/letter/r/a9adbd/32.png) [@rafal.brzegowy](https://calculix.discourse.group/u/rafal.brzegowy)\
**Post date:** [September 24, 2020, 7:27am UTC](https://calculix.discourse.group/t/calculix-mfront/205/1 "2020-09-24T07:27:44Z")

</div>

Hi,

@xyont Try the updated version, I modified the example to allow to enter your own values (this 3.3 version is portable - I think).

```
@Brick StandardElasticity{young_modulus : 150e9, poisson_ratio : 0.3};

@StateVariable strain p[2];
p.setGlossaryName("EquivalentPlasticStrain");

@Parameter d = 150e6;
@Parameter beta = 0.6;
@Parameter pa = -10e6;
@Parameter pb = -75e6;

```

to:

```
@MaterialProperty stress E;
E.setGlossaryName("YoungModulus");
@MaterialProperty real nu1;
nu1.setGlossaryName("PoissonRatio");

@Brick StandardElasticity{young_modulus : "E", poisson_ratio : "nu1"};

@StateVariable strain p[2];
p.setGlossaryName("EquivalentPlasticStrain");

@MaterialProperty real d;
@MaterialProperty real beta;
@MaterialProperty real pa;
@MaterialProperty real pb;

```

> **[Dropbox](https://www.dropbox.com/s/3atvtg94wnuehiu/Mfront_portable.7z?dl=0)**

Continuing the discussion from [CalculiX and PaStiX solver Windows version](https://calculix.discourse.group/t/calculix-and-pastix-solver-windows-version/130/15):

---

<div class="post-metadata">

**Author:** ![xyont](https://yyz2.discourse-cdn.com/free1/user_avatar/calculix.discourse.group/xyont/32/3553_2.png) [@xyont](https://calculix.discourse.group/u/xyont)\
**Post date:** [October 31, 2020, 2:36pm UTC](https://calculix.discourse.group/t/calculix-mfront/205/2 "2020-10-31T14:36:53Z")

</div>

thanks a lot @rafal.brzegowy for all efforts.

currently i being study the parameters input for Drucker Prager Cap models. most of all these values can be derived from Modified Mohr Colomb paramaters, except in ratio of elliptical cap ( _ **R** _ ) to get _ **pb** _ values.

i try seeking any literature, but did not found a theoretical background and used consistent values. some researcher use 0.2 and 0.6 others, is there any guidance for these values in correlation with concrete compressive strength?

---

<div class="post-metadata">

**Author:** ![rafal.brzegowy](https://avatars.discourse-cdn.com/v4/letter/r/a9adbd/32.png) [@rafal.brzegowy](https://calculix.discourse.group/u/rafal.brzegowy)\
**Post date:** [November 1, 2020, 2:44pm UTC](https://calculix.discourse.group/t/calculix-mfront/205/3 "2020-11-01T14:44:29Z")

</div>

I add TFEL/Mfront directly to msys2/mingw64:

> <https://github.com/msys2/MINGW-packages/pull/7178>

This version can build material library for: CalculiX, Abaqus, Ansys, Code-Aster, LS-DYNA, Comsol, Europlexus, Cyrano, Diana-FEA, Zmat

to install:  
pacman -S mingw-w64-x86\_64-tfel

and I add spooles (with CalculiX patch):

> <https://github.com/msys2/MINGW-packages/pull/7160>

to install:  
pacman -S mingw-w64-x86\_64-spooles

---

<div class="post-metadata">

**Author:** ![rafal.brzegowy](https://avatars.discourse-cdn.com/v4/letter/r/a9adbd/32.png) [@rafal.brzegowy](https://calculix.discourse.group/u/rafal.brzegowy)\
**Post date:** [November 2, 2020, 10:47am UTC](https://calculix.discourse.group/t/calculix-mfront/205/4 "2020-11-02T10:47:52Z")

</div>

Try to write a post on Mfront forum:

> **[TFEL/MFront / Discussion](https://sourceforge.net/p/tfel/discussion/)**

---

<div class="post-metadata">

**Author:** ![xyont](https://yyz2.discourse-cdn.com/free1/user_avatar/calculix.discourse.group/xyont/32/3553_2.png) [@xyont](https://calculix.discourse.group/u/xyont)\
**Post date:** [November 3, 2020, 3:43am UTC](https://calculix.discourse.group/t/calculix-mfront/205/5 "2020-11-03T03:43:12Z")

</div>

hi,

even i’m not really confident to enter in advanced damage material forums, still i try and do stepped learning curves.

i have a great news from Thomas H. the authors of TFEL/MFront, some newest and updates of Mazars material models has been implemented. it’s called `UnilateralMazars.mfront` and stored at his GitHub, may it possible to add to the list for next release of CalculiX/MFront interfaces? thank you much.

best,

---

<div class="post-metadata">

**Author:** ![rafal.brzegowy](https://avatars.discourse-cdn.com/v4/letter/r/a9adbd/32.png) [@rafal.brzegowy](https://calculix.discourse.group/u/rafal.brzegowy)\
**Post date:** [November 4, 2020, 9:34am UTC](https://calculix.discourse.group/t/calculix-mfront/205/6 "2020-11-04T09:34:34Z")

</div>

Try this:

> **[MFront\_portable\_UNILATERALMAZARS.7z](https://www.dropbox.com/s/zwjx8qton23tggw/MFront_portable_UNILATERALMAZARS.7z?dl=0)**
>
> Shared with Dropbox

example:

```
*Material, name=@CALCULIXBEHAVIOUR_UNILATERALMAZARS
*Depvar
6
** The material properties are given as if we used parameters to explicitly
** display their names. Users shall replace those declaration by
** theirs values
*User Material, constants=9
<YoungModulus>, <PoissonRatio>, <At>, <Bt>, <Ac>, <Bc>, <st_max>, <sc_max>, 
<k>

```

UnilateralMazars.mfront form tfel-master\mfront\tests\behaviours

```
@DSL Default;
@Behaviour UnilateralMazars;
@Author FranĂ§ois Hamon;
@Date 26/05/2015;
@Description{
  "An unilateral version of the Mazars model"
  "based on the following paper:"

  "A new 3D damage model for concrete"
  "under monotonic, cyclic and dynamic"
  "loadings."
    
  "Jacky Mazars, FranĂ§ois Hamon and StĂ©phane Grange"

  "Materials and Structures ISSN 1359-5997"
  "DOI 10.1617/s11527-014-0439-8"
}

@MaterialProperty stress young;
young.setGlossaryName("YoungModulus");
@MaterialProperty real nu;
nu.setGlossaryName("PoissonRatio");

@MaterialProperty real At;
@MaterialProperty real Bt;
@MaterialProperty real Ac;
@MaterialProperty real Bc;
@MaterialProperty real st_max;
@MaterialProperty real sc_max;
@MaterialProperty real k;
@StateVariable real Yt;
@StateVariable real Yc;
@StateVariable real d;
@StateVariable real Yt0;
@StateVariable real Yc0;
@StateVariable real Tmax;

@ProvidesSymmetricTangentOperator;
@Integrator{
  constexpr const real dmax = 0.99999;
  const stress lambda = computeLambda(young,nu);
  const stress mu = computeMu(young,nu);  
  const StrainStensor e = eto+deto;
  const strain tr = trace(e);
  strain e1,e2,e3;
  e.computeEigenValues(e1,e2,e3);
  const real limint=st_max/young;
  const real liminc=abs(sc_max/young);
  // eigen values of s0
  const stress s1 = 2*mu*e1+lambda*tr;
  const stress s2 = 2*mu*e2+lambda*tr;
  const stress s3 = 2*mu*e3+lambda*tr;
  const stress sn = max(abs(s1),max(abs(s2),abs(s3)));
  const stress pps1 = max(stress(0),s1);
  const stress pps2 = max(stress(0),s2);
  const stress pps3 = max(stress(0),s3);
  const stress r = (sn>1.e-6*young) ?
    min(max((pps1+pps2+pps3)/(abs(s1)+abs(s2)+abs(s3)),real(0)),real(1)) : 0;
  real EPTM= (Yt0>limint) ? Yt0 : limint;
  real EPCM= (Yc0>liminc) ? Yc0 : liminc;
  const strain Inv1 = e1+e2+e3;
  const auto Inv2 = ((e1-e2)*(e1-e2)+(e2-e3)*(e2-e3)+(e3-e1)*(e3-e1))/2;
  const real ept = Inv1/(2*(1-2*nu))+sqrt(Inv2)/(2*(1+nu));
  const real epc = (6*sqrt(Inv2)/(1+nu)+Inv1/(1-2*nu))/5;
  if ((ept>EPTM)&&(r>0)&&(d<dmax)){
    EPTM=ept;
  }
  Yt = max(Yt,EPTM);
  if ((epc>EPCM)&&(r<1)&&(d<dmax)){
    EPCM=epc;
  }
  Yc =max(Yc,EPCM);
  real A=At*(2*r*r*(1-2*k)-r*(1-4*k))+Ac*(2*r*r-3*r+1);
  real B=pow(r,r*r-2*r+2)*Bt+(1-pow(r,r*r-2*r+2))*Bc;
  const real Y0 =r*limint+(1.0-r)*liminc;
  const real Y =r*EPTM+(1.0-r)*EPCM;
  const real dmu= (Y<Y0) ? 0 : 1-(1-A)*Y0/(Y)-A*exp(-B*((Y)-Y0));
  d=min(max(real(0),dmu),dmax);
  Yt0=EPTM;
  Yc0=EPCM;
  // stresses at the end
  sig = (1-d)*(lambda*trace(e)*Stensor::Id()+2*mu*e);
  // auxiliary task
  Tmax=max(Tmax,T);
  if(computeTangentOperator_){
    StiffnessTensor Hooke;
    computeAlteredElasticStiffness<hypothesis,Type>::exe(Hooke,lambda,mu);
    if((smt==ELASTIC)||(smt==TANGENTOPERATOR)){
      Dt=Hooke;
    } else if(smt==SECANTOPERATOR){
      Dt = (1-d)*Hooke ;
    }
  }
}
```

---

<div class="post-metadata">

**Author:** ![xyont](https://yyz2.discourse-cdn.com/free1/user_avatar/calculix.discourse.group/xyont/32/3553_2.png) [@xyont](https://calculix.discourse.group/u/xyont)\
**Post date:** [November 4, 2020, 12:22pm UTC](https://calculix.discourse.group/t/calculix-mfront/205/7 "2020-11-04T12:22:36Z")

</div>

thank you so much @rafal.brzegowy, your contributions & efforts in MFront interfaces has made CalculiX material libraries become so rich.

---

<div class="post-metadata">

**Author:** ![xyont](https://yyz2.discourse-cdn.com/free1/user_avatar/calculix.discourse.group/xyont/32/3553_2.png) [@xyont](https://calculix.discourse.group/u/xyont)\
**Post date:** [November 6, 2020, 8:52pm UTC](https://calculix.discourse.group/t/calculix-mfront/205/8 "2020-11-06T20:52:54Z")

</div>

hi @rafal.brzegowy  
trying took some test for DruckerPragerCap material models, it was not able to runs. reporting an error messages:

`*ERROR: invalid material name '@CALCULIXBEHAVIOUR_DRUCKERPRAGERCAP' (unable to load function)`

any hints about these problems? thank you

edited: also these error occurs in Unilateral Mazars material models.

---

<div class="post-metadata">

**Author:** ![rafal.brzegowy](https://avatars.discourse-cdn.com/v4/letter/r/a9adbd/32.png) [@rafal.brzegowy](https://calculix.discourse.group/u/rafal.brzegowy)\
**Post date:** [November 7, 2020, 9:04am UTC](https://calculix.discourse.group/t/calculix-mfront/205/9 "2020-11-07T09:04:33Z")

</div>

It works on my computer, so it may be a problem that this version is not fully portable.  
I have no way to check, I only have access to computers with the same processor architecture: Intel Haswell.  
I use portable build flags but maybe some is missing ([http://tfel.sourceforge.net/faq.html#portable-build](http://tfel.sourceforge.net/faq.html#portable-build)).

For compilation Mfront:  
-Denable-portable-build=ON

and for material library:  
mfront --obuild=level0

PS.  
If the location of the Mfront library is not indicated then this error occurs `(unable to load library`).

1. You can add to cmdStartup.bat (for example):  
`set PATH=%CALCULIX_ROOT%\CalculiX\MFront;`
2. Or simply copy all .dll file to folder where is ccx.exe

---

<div class="post-metadata">

**Author:** ![xyont](https://yyz2.discourse-cdn.com/free1/user_avatar/calculix.discourse.group/xyont/32/3553_2.png) [@xyont](https://calculix.discourse.group/u/xyont)\
**Post date:** [November 7, 2020, 11:13am UTC](https://calculix.discourse.group/t/calculix-mfront/205/10 "2020-11-07T11:13:07Z")

</div>

may the processor compatibility since i’m using AMD. the path is already defined correctly, as seen DruckerPrager and Mazars seems work well. unfortunately the last two i interest did not.

hope, the problem will be found and fixed someday.

---

<div class="post-metadata">

**Author:** ![mmartin](https://avatars.discourse-cdn.com/v4/letter/m/45deac/32.png) [@mmartin](https://calculix.discourse.group/u/mmartin)\
**Post date:** [March 18, 2022, 2:08pm UTC](https://calculix.discourse.group/t/calculix-mfront/205/11 "2022-03-18T14:08:32Z")

</div>

Good afternoon CCX-Community:

Do you have any available compiled(ready-to-use) version of CCX+MFRONT?  
I would like to try mazars material.

Thank you

Manuel

---

<div class="post-metadata">

**Author:** ![rafal.brzegowy](https://avatars.discourse-cdn.com/v4/letter/r/a9adbd/32.png) [@rafal.brzegowy](https://calculix.discourse.group/u/rafal.brzegowy)\
**Post date:** [March 19, 2022, 6:55pm UTC](https://calculix.discourse.group/t/calculix-mfront/205/12 "2022-03-19T18:55:14Z")

</div>

The version available on the official website supports mfront (windows version; [http://www.dhondt.de/calculix\_2.19\_4win.zip](http://www.dhondt.de/calculix_2.19_4win.zip)), you only need to have mfront libraries and reference in the .inp file (like): [Using MFront Mazars Material Model](https://calculix.discourse.group/t/using-mfront-mazars-material-model/987)

---

<div class="post-metadata">

**Author:** ![mmartin](https://avatars.discourse-cdn.com/v4/letter/m/45deac/32.png) [@mmartin](https://calculix.discourse.group/u/mmartin)\
**Post date:** [March 20, 2022, 10:15am UTC](https://calculix.discourse.group/t/calculix-mfront/205/13 "2022-03-20T10:15:03Z")

</div>

Good mornign Rafal:  
Thank you very much fro your help. I’m going to try it out.

Manuel

---

<div class="post-metadata">

**Author:** ![mmartin](https://avatars.discourse-cdn.com/v4/letter/m/45deac/32.png) [@mmartin](https://calculix.discourse.group/u/mmartin)\
**Post date:** [March 20, 2022, 11:09am UTC](https://calculix.discourse.group/t/calculix-mfront/205/14 "2022-03-20T11:09:45Z")

</div>

Good morning Rafal:

I was able to run cxx+mfront according to your directions but the frd file has no results included. I will go ahead again and check output paramenters. Thank you very much.

Manuel

---

<div class="post-metadata">

**Author:** ![mmartin](https://avatars.discourse-cdn.com/v4/letter/m/45deac/32.png) [@mmartin](https://calculix.discourse.group/u/mmartin)\
**Post date:** [March 21, 2022, 11:46am UTC](https://calculix.discourse.group/t/calculix-mfront/205/15 "2022-03-21T11:46:25Z")

</div>

Good morning Rafal:

I successfully linked CCX+MFRONT on MECWAY. And I added extra ccx-cards to handle MFRONT materials inside the GUI.  
I found out that if you want to use the same material, for example MAZARS, several times in the .inp file, you must add the new name as a suffix this way(:  
@CALCULIXBEHAVIOUR\_UNILATERALMAZARS@CLAY  
@CALCULIXBEHAVIOUR\_UNILATERALMAZARS@CONCRETE

But I still do not get results.

Manuel

---

<div class="post-metadata">

**Author:** ![rafal.brzegowy](https://avatars.discourse-cdn.com/v4/letter/r/a9adbd/32.png) [@rafal.brzegowy](https://calculix.discourse.group/u/rafal.brzegowy)\
**Post date:** [March 21, 2022, 12:07pm UTC](https://calculix.discourse.group/t/calculix-mfront/205/16 "2022-03-21T12:07:32Z")

</div>

Have you got SDV?

\*EL FILE  
SDV

---

<div class="post-metadata">

**Author:** ![mmartin](https://avatars.discourse-cdn.com/v4/letter/m/45deac/32.png) [@mmartin](https://calculix.discourse.group/u/mmartin)\
**Post date:** [March 22, 2022, 12:10pm UTC](https://calculix.discourse.group/t/calculix-mfront/205/17 "2022-03-22T12:10:56Z")

</div>

Good afternoon RAFAL:

I carry out the calculation adding your card (thank you) and CCX gives me SDV parameters with values included but I still do not get displacements neither stresses.

Manuel

---

<div class="post-metadata">

**Author:** ![rafal.brzegowy](https://avatars.discourse-cdn.com/v4/letter/r/a9adbd/32.png) [@rafal.brzegowy](https://calculix.discourse.group/u/rafal.brzegowy)\
**Post date:** [March 24, 2022, 7:17am UTC](https://calculix.discourse.group/t/calculix-mfront/205/18 "2022-03-24T07:17:42Z")

</div>

Have you got (unfortunately I have to ask about it)?:

\*NODE FILE  
U

\*EL FILE  
S

---

<div class="post-metadata">

**Author:** ![mmartin](https://avatars.discourse-cdn.com/v4/letter/m/45deac/32.png) [@mmartin](https://calculix.discourse.group/u/mmartin)\
**Post date:** [March 24, 2022, 8:41am UTC](https://calculix.discourse.group/t/calculix-mfront/205/19 "2022-03-24T08:41:06Z")

</div>

Yes, never mind.

\*NODE FILE,GLOBAL=YES  
U,RF

\*EL FILE, OUTPUT=3D  
S,E,ENER,SDV, SNEG,SMID,SPOS,ZZS,DISP

\*ELPRINT  
S,E

---

<div class="post-metadata">

**Author:** ![mmartin](https://avatars.discourse-cdn.com/v4/letter/m/45deac/32.png) [@mmartin](https://calculix.discourse.group/u/mmartin)\
**Post date:** [April 5, 2022, 8:48am UTC](https://calculix.discourse.group/t/calculix-mfront/205/20 "2022-04-05T08:48:32Z")

</div>

Dear RAFAL:

I still do not get displacements, what a pitty.  
I think I am using a wrong unit system. I use MECWAY as GUI and all the internal parameters must be in N,m,kg,ºK.

I found an useful Mazar material definition excel spreadsheet on Code\_aster forum that plots the stress/strain curve.  
I have a couple of questions for you:

- Does Mazar material definition on MFRONT use any unit system or it is agnostic?
- Do you know if my next assumption on units is right?
- 
  - Pressure.

- 
  - unit less.

- 
  - unit less.

- 
  - unit less.

- 
  - unit less.

- 
  - unit less.

- 
  - \<st\_max\> tensile (pressure).

- 
  - \<sc\_max\>, pressure.

- 
  - unit less.

Thank you  
MANUEL

[Next page](https://calculix.discourse.group/t/calculix-mfront/205.md?page=2)
