12#ifndef MFEM_NONLININTEG
13#define MFEM_NONLININTEG
321 DenseMatrix DSh, DS, Jrt, Jpr, Jpt, P, PMatI, PMatO;
333 const Vector &elfun)
override;
356 DenseMatrix DSh_u, DS_u, J0i, J, J1, Finv, P, F, FinvT;
357 DenseMatrix PMatI_u, PMatO_u, PMatI_p, PMatO_p, Z, G, C;
385 DenseMatrix dshape, dshapex, EF, gradEF, ELV, elmat_comp;
388 int dim, ne, nq, d1d, q1d;
424 const int d1d,
const int q1d);
432 const int d1d,
const int q1d);
442 const int d1d,
const int q1d);
447 template <
int DIM,
int D1D,
int Q1D>
450 AddMultPAKernels::Specialization<DIM, D1D, Q1D>::Add();
451 if constexpr (
DIM == 2)
453 AddMultGradPA2D::Specialization<D1D, Q1D>::Add();
454 GradDiagPA2D::Specialization<D1D, Q1D>::Add();
456 else if constexpr (
DIM == 3)
458 AddMultGradPA3D::Specialization<D1D, Q1D>::Add();
459 GradDiagPA3D::Specialization<D1D, Q1D>::Add();
486 DenseMatrix dshape, dshapex, EF, gradEF, ELV, elmat_comp;
517 DenseMatrix dshape, dshapex, EF, gradEF, ELV, elmat_comp;
Dynamic 2D array using row-major layout.
Base class Coefficients that optionally depend on space and time. These are used by the BilinearFormI...
ConvectiveVectorConvectionNLFIntegrator()=default
void AddMultGradPA(const Vector &x, Vector &y) const override
Method for partially assembled gradient action.
ConvectiveVectorConvectionNLFIntegrator(Coefficient &q)
void AddMultPA(const Vector &x, Vector &y) const override
Method for partially assembled action.
void AssembleGradDiagonalPA(Vector &diag) const override
Method for computing the diagonal of the gradient with partial assembly.
void AssembleGradPA(const Vector &x, const FiniteElementSpace &fes) override
Prepare the integrator for partial assembly (PA) gradient evaluations on the given FE space fes at th...
void AssemblePA(const FiniteElementSpace &fes) override
Method defining partial assembly.
void AssembleElementGrad(const FiniteElement &el, ElementTransformation &trans, const Vector &elfun, DenseMatrix &elmat) override
Assemble the local gradient matrix.
Data type dense matrix using column-major storage.
Structure representing the matrices/tensors needed to evaluate (in reference space) the values,...
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
Abstract class for all finite elements.
Structure for storing mesh geometric factors: coordinates, Jacobians, and determinants of the Jacobia...
Abstract class for hyperelastic models.
virtual void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const real_t weight, DenseMatrix &A) const =0
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
virtual real_t EvalW(const DenseMatrix &Jpt) const =0
Evaluate the strain energy density function, W = W(Jpt).
ElementTransformation * Ttr
virtual ~HyperelasticModel()
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const =0
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
void SetTransformation(ElementTransformation &Ttr_)
void AssembleElementVector(const FiniteElement &el, ElementTransformation &Ttr, const Vector &elfun, Vector &elvect) override
Perform the local action of the NonlinearFormIntegrator.
real_t GetElementEnergy(const FiniteElement &el, ElementTransformation &Ttr, const Vector &elfun) override
Computes the integral of W(Jacobian(Trt)) over a target zone.
const IntegrationRule * GetDefaultIntegrationRule(const FiniteElement &trial_fe, const FiniteElement &test_fe, const ElementTransformation &trans) const override
Subclasses should override to choose a default integration rule.
HyperelasticNLFIntegrator(HyperelasticModel *m)
void AssembleElementGrad(const FiniteElement &el, ElementTransformation &Ttr, const Vector &elfun, DenseMatrix &elmat) override
Assemble the local gradient matrix.
real_t GetElementEnergy(const Array< const FiniteElement * > &el, ElementTransformation &Tr, const Array< const Vector * > &elfun) override
Compute the local energy.
void AssembleElementVector(const Array< const FiniteElement * > &el, ElementTransformation &Tr, const Array< const Vector * > &elfun, const Array< Vector * > &elvec) override
Perform the local action of the NonlinearFormIntegrator.
void AssembleElementGrad(const Array< const FiniteElement * > &el, ElementTransformation &Tr, const Array< const Vector * > &elfun, const Array2D< DenseMatrix * > &elmats) override
Assemble the local gradient matrix.
IncompressibleNeoHookeanIntegrator(Coefficient &mu_)
Class for an integration rule - an Array of IntegrationPoint.
This base class implements some shared functionality between linear and nonlinear form integrators.
void EvalP(const DenseMatrix &J, DenseMatrix &P) const override
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
void AssembleH(const DenseMatrix &J, const DenseMatrix &DS, const real_t weight, DenseMatrix &A) const override
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
real_t EvalW(const DenseMatrix &J) const override
Evaluate the strain energy density function, W = W(Jpt).
void AssembleH(const DenseMatrix &J, const DenseMatrix &DS, const real_t weight, DenseMatrix &A) const override
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
NeoHookeanModel(real_t mu_, real_t K_, real_t g_=1.0)
real_t EvalW(const DenseMatrix &J) const override
Evaluate the strain energy density function, W = W(Jpt).
void EvalP(const DenseMatrix &J, DenseMatrix &P) const override
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
NeoHookeanModel(Coefficient &mu_, Coefficient &K_, Coefficient *g_=NULL)
void AddMultPA(const Vector &x, Vector &y) const override
Method for partially assembled action.
void AssembleElementGrad(const FiniteElement &el, ElementTransformation &trans, const Vector &elfun, DenseMatrix &elmat) override
Assemble the local gradient matrix.
SkewSymmetricVectorConvectionNLFIntegrator()=default
void AddMultGradPA(const Vector &x, Vector &y) const override
Method for partially assembled gradient action.
void AssembleGradPA(const Vector &x, const FiniteElementSpace &fes) override
Prepare the integrator for partial assembly (PA) gradient evaluations on the given FE space fes at th...
void AssemblePA(const FiniteElementSpace &fes) override
Method defining partial assembly.
SkewSymmetricVectorConvectionNLFIntegrator(Coefficient &q)
void AssembleGradDiagonalPA(Vector &diag) const override
Method for computing the diagonal of the gradient with partial assembly.
void AddMultPA(const Vector &x, Vector &y) const override
Method for partially assembled action.
MFEM_REGISTER_KERNELS(AddMultGradPA3D, AddMultGradPAType,(int, int))
void AssembleElementVector(const FiniteElement &el, ElementTransformation &trans, const Vector &elfun, Vector &elvect) override
Perform the local action of the NonlinearFormIntegrator.
void(*)(const int ne, const real_t *B, const real_t *G, const real_t *A, const real_t *u, real_t *y, const int d1d, const int q1d) GradDiagPAType
void(*)(const int ne, const real_t *B, const real_t *G, const real_t *A, const real_t *u, const real_t *x, real_t *y, const int d1d, const int q1d) AddMultGradPAType
MFEM_REGISTER_KERNELS(GradDiagPA3D, GradDiagPAType,(int, int))
void AssemblePA(const FiniteElementSpace &fes) override
Method defining partial assembly.
void AssembleMF(const FiniteElementSpace &fes) override
Method defining fully unassembled operator.
MFEM_REGISTER_KERNELS(AddMultPAKernels, AddMultPAType,(int, int, int))
VectorConvectionNLFIntegrator()
MFEM_REGISTER_KERNELS(GradDiagPA2D, GradDiagPAType,(int, int))
void AddMultGradPA(const Vector &x, Vector &y) const override
Method for partially assembled gradient action.
void AddMultMF(const Vector &x, Vector &y) const override
void AssembleElementGrad(const FiniteElement &el, ElementTransformation &trans, const Vector &elfun, DenseMatrix &elmat) override
Assemble the local gradient matrix.
void AssembleGradPA(const Vector &x, const FiniteElementSpace &fes) override
Prepare the integrator for partial assembly (PA) gradient evaluations on the given FE space fes at th...
static const IntegrationRule & GetRule(const FiniteElement &fe, const ElementTransformation &T)
void(*)(const int ne, const real_t *B, const real_t *G, const real_t *A, const real_t *x, real_t *y, const int d1d, const int q1d) AddMultPAType
static void AddSpecialization()
const IntegrationRule * GetDefaultIntegrationRule(const FiniteElement &trial_fe, const FiniteElement &test_fe, const ElementTransformation &trans) const override
Subclasses should override to choose a default integration rule.
void AssembleGradDiagonalPA(Vector &) const override
Method for computing the diagonal of the gradient with partial assembly.
MFEM_REGISTER_KERNELS(AddMultGradPA2D, AddMultGradPAType,(int, int))
VectorConvectionNLFIntegrator(Coefficient &q)
void trans(const Vector &u, Vector &x)
real_t weight(const Vector &x)
real_t u(const Vector &xvec)
MemoryType
Memory types supported by MFEM.