Hi Matt,
As a supplement what David already mentioned, I used the QP-based approach that you laid out for skeletal muscle modelling. Although the code-related implementation details are not documented in my
dissertation, the
Linear Elastic Active Skeletal Muscle Model code gallery example captures its essence for a much more simplified (
single fibre family with a predefined muscle activation signal), completely linearised version of that model. That said, in the years since then I’ve thought that it might be nice to store the fibre direction field as an FE field. I think that the only complexity there is that if you have a different number of fibres in each cell (which is what I had to do) then the task of managing data at an FE level *may* be more challenging than storing it all locally.
Just in case It can be of use to you: I’ve also got a work-in-progress branch (see
invariants.h and
constitutive_modelling.h) that shows how to compute the values and derivatives of a number of invariants (applicable to single and coupled physics). In there are two sets of invariants that may be of interest to you: what I label I4 through to pI5 (in invariants.h) relate to transverse isotropic materials (potentially with fibre dispersion), and I6-I8 add another fibre family to permit the material being completely orthotropic. For both of these, one just needs the right Cauchy-Green tensor and a structure tensor as inputs. The idea in that branch is that you provide coefficients that are the derivatives of an energy function with respect to certain invariants to one of the CM helper classes (e.g. Physics::ConstitutiveModelling::UncoupledConstitutiveModel<Physics::Invariants::TransverseIsotropic>) and then it will return to you, for instance, d2Psi_dC_dC which is the material tangent as computed from all of the invariants. All of the derivatives that have been implemented thus far have been verified (you can check the associated tests on the branch). Actually, all that remains is for me to complete the documentation.
I hope that some of this is helpful to you. Computing the derivatives of the invariants can be tricky for some of them, so you should definitely take care there.
Best,
Jean-Paul