Output.h file
Extensible extraction mechanism for constitutive evaluation.
An Output is the dual of Input. An Input populates a ConstitutivePoint with auxiliary data before the constitutive law is evaluated, while an Output reads the prepared law at each quadrature point afterwards. This is the extraction site for quantities derived from the evaluation – committed internal variables, recovered stresses, strain energy, diagnostics – without hard-coding them into the integrator or the constitutive law, and without recomputing the kinematics at the call site.
An Output receives a const prepared law, so it is written against a specific law. The ConstitutivePoint carries Tags::CellIndex and Tags::QuadraturePointIndex, so an Output and an Input driven by the same pass address the same quadrature point.
Usage with CRTP
struct MyOutput : Solid::Output<MyOutput> { MyOutput() = default; template <class Law> void extract(const Solid::ConstitutivePoint& cp, const Law& law) const { // e.g., commit an internal variable state[cp.get<Solid::Tags::CellIndex>()] [cp.get<Solid::Tags::QuadraturePointIndex>()] = law.getActiveExtension(); } }; ivw.setOutput([output = MyOutput{}](const Solid::ConstitutivePoint& cp, const auto& law) { const Solid::Output<MyOutput>& base = output; base.extract(cp, law); });
Usage with lambda / std::function
ivw.setOutput([&](const Solid::ConstitutivePoint& cp, const auto& law) { energy += law.getStrainEnergyDensity(); }); ivw.commit();
Namespaces
- namespace Rodin
- The Rodin library for finite element methods and shape optimization.
- namespace Rodin::Solid
- Finite-strain kinematics, constitutive responses and virtual-work forms.
Classes
-
template<class Derived>class Rodin::Solid::Output
- CRTP base class for outputs.