I'm currently working with a single constitutive model that describes 2 collagen fibre families that have different element properties. The strain energy density function is W, where there would be 2 values of W for the two fibre families :

    `Wi = 1/2*c*(I1 - 3) + (k1/(2*k2) (Exp[k2*Ei]) - 
    1), (* i = 1, 2, these are the two fibre families*)
    Ei = Tr[hi]] - 1 (* i = 1, 2, a structure strain invariant for the two families*)
    hi1=k*bmod +(1 - (3*k))*(TensorProduct[a1, a1]);
    hi2 =k*bmod + (1 - (3*k))*(TensorProduct[a2,  a2]);`
(*a1 and a2 are vectors that describe the mean orientations of the fibre families with respect to the reference direction*)

I have not outlined all the variables but I think this is sufficient to describe the general idea of what the constitutive model outlines. Using the above, I need to generate a single AceGen element that describes both fibre families for later analysis in AceFem. Since I need to create an element that includes 2 strain energy density functions instead of one, I was wondering if it is possible to create more than 1 tangent and residual matrix within a tangent and residual subroutine. My current subroutine for one fibre family looks like this (I haven't put the full code in, but I think the relevant parts are only the assembly of tangent and residual:

    SMSStandardModule["Tangent and residual"];

skipR = SMSLogical[SMSInteger[idata$$["SkipResidual"]] == 1];
skipK = SMSLogical[SMSInteger[idata$$["SkipTangent"]] == 1];

NoIp = SMSInteger[es$$["id", "NoIntPoints"]];

SMSDo[Ig, 1, NoIp];

    Export velocity and acceleration;
    SMSExport[{v[1], v[2], v[3], v[4], v[5], v[6]}, 
  Table[ed$$["ht", Ihg + i], {i, 6}]];

wgp = SMSReal[es$$["IntPoints", 4, Ig]];

    SMSDo[i, 1, Length[pe];
        Rg1 = fGauss wgp  SMSD[
    W + T - (\[Rho]*u.bforces), pe, i, "Constant" -> a];
    (*This process would have to be repeated twice for the fibre families W1 and W2*)

        SMSIf[! skipR]; (*assembly of residual vector*)
 p$$[i], "AddIn" -> True];

Tangent stiffness;
        SMSDo[j, If[SMSSymmetricTangent, i, 1], Length[pe];
            Kg = SMSD[Rg1, pe, j];

            SMSExport[Kg, s$$[i, j], "AddIn" -> True];


But as I mentioned earlier I need to add the second equation for the second fibre family and I'm not sure if it is possible to create more than 1 tangent and residual matrix within a tangent and residual subroutine. I was brainstorming the following possibilities:

1) create a loop that loops through the material characteristics of the two fibre families but I was told by a project supervisor that doing that was not necessary since I could just write out the two equations, but I'm wondering how that would work.

2) I was also thinking that I could create two separate AceGen elements but that would require some sort of superposition which I do not think is possible when entered into AceFem for the finite element analysis.

Absolutely any ideas are welcome, thank you in advance.

  • $\begingroup$ Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour and check the faqs! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! $\endgroup$
    – Pinti
    Nov 29, 2019 at 14:11
  • $\begingroup$ I recommend that you take a look at different examples of various element types and constitutive models in this book about AceGen. $\endgroup$
    – Pinti
    Nov 29, 2019 at 14:13

1 Answer 1


I will try to give a general explanation to your questions, even though I am not sure if I understood the whole question.

Strain energy is a scalar function which is differentiated twice with respect to element degrees of freedom to get a tangent matrix. Each element can have only one residual vector and tangent matrix. So this is what I think about your questions:

1) For including more "fibre families" you just need to sum together their strain energies.

2) In AceFEM you can "overlay" multiple elements as long as you take care that nodal DOFs and their identifications match properly. But it seems that in your case it is simpler to derive material behavior with a single element type.

  • $\begingroup$ I never thought about the addition as it was not explicitly stated in the paper that I'm using - thank you so much for your help. $\endgroup$ Nov 29, 2019 at 15:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.