21 mfem_error(
"NonlinearFormIntegrator::AssembleElementVector"
22 " is not overloaded!");
29 mfem_error(
"NonlinearFormIntegrator::AssembleFaceVector"
30 " is not overloaded!");
37 mfem_error(
"NonlinearFormIntegrator::AssembleElementGrad"
38 " is not overloaded!");
46 mfem_error(
"NonlinearFormIntegrator::AssembleElementGrad"
47 " is not overloaded!");
54 mfem_error(
"NonlinearFormIntegrator::GetElementEnergy"
55 " is not overloaded!");
63 return 0.5*(
Z*
Z)/J.
Det();
76 for (
int i = 0; i <
dim; i++)
109 for (
int i = 0; i < dof; i++)
110 for (
int j = 0; j <= i; j++)
113 for (
int d = 0; d <
dim; d++)
118 for (
int k = 0; k <
dim; k++)
119 for (
int l = 0; l <= k; l++)
122 A(i+k*dof,j+l*dof) += b;
125 A(j+k*dof,i+l*dof) += b;
129 A(i+l*dof,j+k*dof) += b;
132 A(j+l*dof,i+k*dof) += b;
139 for (
int i = 1; i < dof; i++)
140 for (
int j = 0; j < i; j++)
142 for (
int k = 1; k <
dim; k++)
143 for (
int l = 0; l < k; l++)
146 weight*(
C(i,l)*
G(j,k) -
C(i,k)*
G(j,l) +
147 C(j,k)*
G(i,l) -
C(j,l)*
G(i,k) +
148 t*(
G(i,k)*
G(j,l) -
G(i,l)*
G(j,k)));
150 A(i+k*dof,j+l*dof) += a;
151 A(j+l*dof,i+k*dof) += a;
153 A(i+l*dof,j+k*dof) -= a;
154 A(j+k*dof,i+l*dof) -= a;
181 double bI1 = pow(dJ, -2.0/dim)*(J*J);
183 return 0.5*(
mu*(bI1 -
dim) +
K*(sJ - 1.0)*(sJ - 1.0));
199 double a =
mu*pow(dJ, -2.0/dim);
200 double b =
K*(dJ/
g - 1.0)/
g - a*(J*J)/(dim*dJ);
223 double a =
mu*pow(dJ, -2.0/
dim);
224 double bc = a*(J*J)/
dim;
225 double b = bc -
K*sJ*(sJ - 1.0);
226 double c = 2.0*bc/
dim +
K*sJ*(2.0*sJ - 1.0);
239 for (
int i = 0; i < dof; i++)
240 for (
int k = 0; k <= i; k++)
243 for (
int d = 0; d <
dim; d++)
245 s += DS(i,d)*DS(k,d);
249 for (
int d = 0; d <
dim; d++)
251 A(i+d*dof,k+d*dof) += s;
255 for (
int d = 0; d <
dim; d++)
257 A(k+d*dof,i+d*dof) += s;
264 for (
int i = 0; i < dof; i++)
265 for (
int j = 0; j <
dim; j++)
266 for (
int k = 0; k < dof; k++)
267 for (
int l = 0; l <
dim; l++)
269 A(i+j*dof,k+l*dof) +=
270 a*(
C(i,j)*
G(k,l) +
G(i,j)*
C(k,l)) +
271 b*
G(i,l)*
G(k,j) + c*
G(i,j)*
G(k,l);
345 model->
EvalP(Jpt, P);
int GetNPoints() const
Returns the number of the points in the integration rule.
Abstract class for Finite Elements.
void MultABt(const DenseMatrix &A, const DenseMatrix &B, DenseMatrix &ABt)
Multiply a matrix A with the transpose of a matrix B: A*Bt.
virtual void EvalP(const DenseMatrix &J, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
virtual double EvalW(const DenseMatrix &J) const
Evaluate the strain energy density function, W = W(Jpt).
int GetDim() const
Returns the reference space dimension for the finite element.
Class for an integration rule - an Array of IntegrationPoint.
const IntegrationRule & Get(int GeomType, int Order)
Returns an integration rule for given GeomType and Order.
void SetSize(int s)
Resize the vector to size s.
virtual void AssembleH(const DenseMatrix &J, const DenseMatrix &DS, const double weight, DenseMatrix &A) const
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
void Mult(const Table &A, const Table &B, Table &C)
C = A * B (as boolean matrices)
int Width() const
Get the width (size of input) of the Operator. Synonym with NumCols().
int GetOrder() const
Returns the order of the finite element.
Data type dense matrix using column-major storage.
virtual double EvalW(const DenseMatrix &Jpt) const =0
Evaluate the strain energy density function, W = W(Jpt).
virtual void EvalP(const DenseMatrix &J, DenseMatrix &P) const
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const =0
Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
IntegrationPoint & IntPoint(int i)
Returns a reference to the i-th integration point.
void CalcAdjugateTranspose(const DenseMatrix &a, DenseMatrix &adjat)
Calculate the transposed adjugate of a matrix (for NxN matrices, N=1,2,3)
int Height() const
Get the height (size of output) of the Operator. Synonym with NumRows().
void Add(const double c, const DenseMatrix &A)
Adds the matrix A multiplied by the number c to the matrix.
virtual void AssembleElementGrad(const FiniteElement &el, ElementTransformation &Ttr, const Vector &elfun, DenseMatrix &elmat)
Assemble the local gradient matrix.
virtual double GetElementEnergy(const FiniteElement &el, ElementTransformation &Ttr, const Vector &elfun)
Computes the integral of W(Jacobian(Trt)) over a target zone.
void SetTransformation(ElementTransformation &_Ttr)
void CalcInverse(const DenseMatrix &a, DenseMatrix &inva)
int GetGeomType() const
Returns the Geometry::Type of the reference element.
double Trace() const
Trace of a square matrix.
void AddMultABt(const DenseMatrix &A, const DenseMatrix &B, DenseMatrix &ABt)
ABt += A * B^t.
int GetDof() const
Returns the number of degrees of freedom in the finite element.
void mfem_error(const char *msg)
void MultAAt(const DenseMatrix &a, DenseMatrix &aat)
Calculate the matrix A.At.
ElementTransformation * Ttr
virtual void AssembleH(const DenseMatrix &J, const DenseMatrix &DS, const double weight, DenseMatrix &A) const
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
Class for integration point with weight.
virtual double EvalW(const DenseMatrix &J) const
Evaluate the strain energy density function, W = W(Jpt).
virtual void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS, const double weight, DenseMatrix &A) const =0
Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor and assemble its contribution to the...
virtual double Eval(ElementTransformation &T, const IntegrationPoint &ip)=0
virtual void AssembleElementVector(const FiniteElement &el, ElementTransformation &Ttr, const Vector &elfun, Vector &elvect)
Perform the local action of the NonlinearFormIntegrator.
void MultAtB(const DenseMatrix &A, const DenseMatrix &B, DenseMatrix &AtB)
Multiply the transpose of a matrix A with a matrix B: At*B.
void UseExternalData(double *d, int h, int w)
Change the data array and the size of the DenseMatrix.
void SetSize(int s)
Change the size of the DenseMatrix to s x s.
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const =0
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
IntegrationRules IntRules(0, Quadrature1D::GaussLegendre)
A global object with all integration rules (defined in intrules.cpp)