MFEM v4.10.0
Finite element discretization library
Loading...
Searching...
No Matches
nonlininteg.hpp
Go to the documentation of this file.
1// Copyright (c) 2010-2026, Lawrence Livermore National Security, LLC. Produced
2// at the Lawrence Livermore National Laboratory. All Rights reserved. See files
3// LICENSE and NOTICE for details. LLNL-CODE-806117.
4//
5// This file is part of the MFEM library. For more information and source code
6// availability visit https://mfem.org.
7//
8// MFEM is free software; you can redistribute it and/or modify it under the
9// terms of the BSD-3 license. We welcome feedback and contributions, see file
10// CONTRIBUTING.md for details.
11
12#ifndef MFEM_NONLININTEG
13#define MFEM_NONLININTEG
14
15#include "../config/config.hpp"
16#include "fe.hpp"
17#include "coefficient.hpp"
18#include "fespace.hpp"
20#include "integrator.hpp"
21#include "kernel_dispatch.hpp"
22
23namespace mfem
24{
25
26/** @brief This class is used to express the local action of a general nonlinear
27 finite element operator. In addition it may provide the capability to
28 assemble the local gradient operator and to compute the local energy. */
30{
31public:
32 enum Mode
33 {
34 ELEMENTWISE = 0, /**< Element-wise integration (default) */
35 PATCHWISE = 1, /**< Patch-wise integration (NURBS meshes) */
36 PATCHWISE_REDUCED = 2, /**< Patch-wise integration (NURBS meshes) with
37 reduced integration rules. */
38 };
39
40protected:
42
43 // CEED extension
45
47
49 : Integrator(ir), ceedOp(NULL) { }
50
51public:
52
54
55
56 bool Patchwise() const { return integrationMode != Mode::ELEMENTWISE; }
57
58 /// Set the memory type used for GeometricFactors and other large allocations
59 /// in PA extensions.
60 void SetPAMemoryType(MemoryType mt) { pa_mt = mt; }
61
62
63 /// Perform the local action of the NonlinearFormIntegrator
64 virtual void AssembleElementVector(const FiniteElement &el,
66 const Vector &elfun, Vector &elvect);
67
68 /// @brief Perform the local action of the NonlinearFormIntegrator resulting
69 /// from a face integral term.
70 virtual void AssembleFaceVector(const FiniteElement &el1,
71 const FiniteElement &el2,
73 const Vector &elfun, Vector &elvect);
74
75 /// Assemble the local gradient matrix
76 virtual void AssembleElementGrad(const FiniteElement &el,
78 const Vector &elfun, DenseMatrix &elmat);
79
80 /// @brief Assemble the local action of the gradient of the
81 /// NonlinearFormIntegrator resulting from a face integral term.
82 virtual void AssembleFaceGrad(const FiniteElement &el1,
83 const FiniteElement &el2,
85 const Vector &elfun, DenseMatrix &elmat);
86
87 /// Compute the local energy
88 virtual real_t GetElementEnergy(const FiniteElement &el,
90 const Vector &elfun);
91
92 /// Method defining partial assembly.
93 /** The result of the partial assembly is stored internally so that it can be
94 used later in the methods AddMultPA(). */
95 virtual void AssemblePA(const FiniteElementSpace &fes);
96
97 /** The result of the partial assembly is stored internally so that it can be
98 used later in the methods AddMultPA().
99 Used with BilinearFormIntegrators that have different spaces. */
100 virtual void AssemblePA(const FiniteElementSpace &trial_fes,
101 const FiniteElementSpace &test_fes);
102
103 /** @brief Prepare the integrator for partial assembly (PA) gradient
104 evaluations on the given FE space @a fes at the state @a x. */
105 /** The result of the partial assembly is stored internally so that it can be
106 used later in the methods AddMultGradPA() and AssembleGradDiagonalPA().
107 The state Vector @a x is an E-vector. */
108 virtual void AssembleGradPA(const Vector &x, const FiniteElementSpace &fes);
109
110 /// Compute the local (to the MPI rank) energy with partial assembly.
111 /** Here the state @a x is an E-vector. This method can be called only after
112 the method AssemblePA() has been called. */
113 virtual real_t GetLocalStateEnergyPA(const Vector &x) const;
114
115 /// Method for partially assembled action.
116 /** Perform the action of integrator on the input @a x and add the result to
117 the output @a y. Both @a x and @a y are E-vectors, i.e. they represent
118 the element-wise discontinuous version of the FE space.
119
120 This method can be called only after the method AssemblePA() has been
121 called. */
122 virtual void AddMultPA(const Vector &x, Vector &y) const;
123
124 /// Method for partially assembled gradient action.
125 /** All arguments are E-vectors. This method can be called only after the
126 method AssembleGradPA() has been called.
127
128 @param[in] x The gradient Operator is applied to the Vector @a x.
129 @param[in,out] y The result Vector: $ y += G x $. */
130 virtual void AddMultGradPA(const Vector &x, Vector &y) const;
131
132 /// Method for computing the diagonal of the gradient with partial assembly.
133 /** The result Vector @a diag is an E-Vector. This method can be called only
134 after the method AssembleGradPA() has been called.
135
136 @param[in,out] diag The result Vector: $ diag += diag(G) $. */
137 virtual void AssembleGradDiagonalPA(Vector &diag) const;
138
139 /// Indicates whether this integrator can use a Ceed backend.
140 virtual bool SupportsCeed() const { return false; }
141
142 /// Method defining fully unassembled operator.
143 virtual void AssembleMF(const FiniteElementSpace &fes);
144
145 /** Perform the action of integrator on the input @a x and add the result to
146 the output @a y. Both @a x and @a y are E-vectors, i.e. they represent
147 the element-wise discontinuous version of the FE space.
148
149 This method can be called only after the method AssembleMF() has been
150 called. */
151 virtual void AddMultMF(const Vector &x, Vector &y) const;
152
154
156 {
157 delete ceedOp;
158 }
159};
160
161/** The abstract base class BlockNonlinearFormIntegrator is
162 a generalization of the NonlinearFormIntegrator class suitable
163 for block state vectors. */
165{
166public:
167 /// Compute the local energy
170 const Array<const Vector *>&elfun);
171
172 /// Perform the local action of the BlockNonlinearFormIntegrator
175 const Array<const Vector *> &elfun,
176 const Array<Vector *> &elvec);
177
178 virtual void AssembleFaceVector(const Array<const FiniteElement *> &el1,
181 const Array<const Vector *> &elfun,
182 const Array<Vector *> &elvect);
183
184 /// Assemble the local gradient matrix
187 const Array<const Vector *> &elfun,
188 const Array2D<DenseMatrix *> &elmats);
189
190 virtual void AssembleFaceGrad(const Array<const FiniteElement *>&el1,
193 const Array<const Vector *> &elfun,
194 const Array2D<DenseMatrix *> &elmats);
195
197};
198
199
200/// Abstract class for hyperelastic models
202{
203protected:
204 ElementTransformation *Ttr; /**< Reference-element to target-element
205 transformation. */
206
207public:
208 HyperelasticModel() : Ttr(NULL) { }
209 virtual ~HyperelasticModel() { }
210
211 /// A reference-element to target-element transformation that can be used to
212 /// evaluate Coefficient%s.
213 /** @note It is assumed that Ttr_.SetIntPoint() is already called for the
214 point of interest. */
216
217 /** @brief Evaluate the strain energy density function, W = W(Jpt).
218 @param[in] Jpt Represents the target->physical transformation
219 Jacobian matrix. */
220 virtual real_t EvalW(const DenseMatrix &Jpt) const = 0;
221
222 /** @brief Evaluate the 1st Piola-Kirchhoff stress tensor, P = P(Jpt).
223 @param[in] Jpt Represents the target->physical transformation
224 Jacobian matrix.
225 @param[out] P The evaluated 1st Piola-Kirchhoff stress tensor. */
226 virtual void EvalP(const DenseMatrix &Jpt, DenseMatrix &P) const = 0;
227
228 /** @brief Evaluate the derivative of the 1st Piola-Kirchhoff stress tensor
229 and assemble its contribution to the local gradient matrix 'A'.
230 @param[in] Jpt Represents the target->physical transformation
231 Jacobian matrix.
232 @param[in] DS Gradient of the basis matrix (dof x dim).
233 @param[in] weight Quadrature weight coefficient for the point.
234 @param[in,out] A Local gradient matrix where the contribution from this
235 point will be added.
236
237 Computes weight * d(dW_dxi)_d(xj) at the current point, for all i and j,
238 where x1 ... xn are the FE dofs. This function is usually defined using
239 the matrix invariants and their derivatives.
240 */
241 virtual void AssembleH(const DenseMatrix &Jpt, const DenseMatrix &DS,
242 const real_t weight, DenseMatrix &A) const = 0;
243};
244
245
246/** Inverse-harmonic hyperelastic model with a strain energy density function
247 given by the formula: W(J) = (1/2) det(J) Tr((J J^t)^{-1}) where J is the
248 deformation gradient. */
250{
251protected:
252 mutable DenseMatrix Z, S; // dim x dim
253 mutable DenseMatrix G, C; // dof x dim
254
255public:
256 real_t EvalW(const DenseMatrix &J) const override;
257
258 void EvalP(const DenseMatrix &J, DenseMatrix &P) const override;
259
260 void AssembleH(const DenseMatrix &J, const DenseMatrix &DS,
261 const real_t weight, DenseMatrix &A) const override;
262};
263
264
265/** Neo-Hookean hyperelastic model with a strain energy density function given
266 by the formula: $(\mu/2)(\bar{I}_1 - dim) + (K/2)(det(J)/g - 1)^2$ where
267 J is the deformation gradient and $$\bar{I}_1 = (det(J))^{-2/dim} Tr(J
268 J^t)$$. The parameters $\mu$ and K are the shear and bulk moduli,
269 respectively, and g is a reference volumetric scaling. */
271{
272protected:
273 mutable real_t mu, K, g;
276
277 mutable DenseMatrix Z; // dim x dim
278 mutable DenseMatrix G, C; // dof x dim
279
280 inline void EvalCoeffs() const;
281
282public:
284 : mu(mu_), K(K_), g(g_), have_coeffs(false) { c_mu = c_K = c_g = NULL; }
285
287 : mu(0.0), K(0.0), g(1.0), c_mu(&mu_), c_K(&K_), c_g(g_),
288 have_coeffs(true) { }
289
290 real_t EvalW(const DenseMatrix &J) const override;
291
292 void EvalP(const DenseMatrix &J, DenseMatrix &P) const override;
293
294 void AssembleH(const DenseMatrix &J, const DenseMatrix &DS,
295 const real_t weight, DenseMatrix &A) const override;
296};
297
298
299/** Hyperelastic integrator for any given HyperelasticModel.
300
301 Represents $ \int W(Jpt) dx $ over a target zone, where W is the
302 @a model's strain energy density function, and Jpt is the Jacobian of the
303 target->physical coordinates transformation. The target configuration is
304 given by the current mesh at the time of the evaluation of the integrator.
305*/
307{
308private:
309 HyperelasticModel *model;
310
311 // Jrt: the Jacobian of the target-to-reference-element transformation.
312 // Jpr: the Jacobian of the reference-to-physical-element transformation.
313 // Jpt: the Jacobian of the target-to-physical-element transformation.
314 // P: represents dW_d(Jtp) (dim x dim).
315 // DSh: gradients of reference shape functions (dof x dim).
316 // DS: gradients of the shape functions in the target (stress-free)
317 // configuration (dof x dim).
318 // PMatI: coordinates of the deformed configuration (dof x dim).
319 // PMatO: reshaped view into the local element contribution to the operator
320 // output - the result of AssembleElementVector() (dof x dim).
321 DenseMatrix DSh, DS, Jrt, Jpr, Jpt, P, PMatI, PMatO;
322
323public:
324 /** @param[in] m HyperelasticModel that will be integrated. */
326
327 /** @brief Computes the integral of W(Jacobian(Trt)) over a target zone
328 @param[in] el Type of FiniteElement.
329 @param[in] Ttr Represents ref->target coordinates transformation.
330 @param[in] elfun Physical coordinates of the zone. */
333 const Vector &elfun) override;
334
337 const Vector &elfun, Vector &elvect) override;
338
339 void AssembleElementGrad(const FiniteElement &el,
341 const Vector &elfun, DenseMatrix &elmat) override;
342protected:
344 const FiniteElement& trial_fe,
345 const FiniteElement& test_fe,
346 const ElementTransformation& trans) const override;
347};
348
349/** Hyperelastic incompressible Neo-Hookean integrator with the PK1 stress
350 $P = \mu F - p F^{-T}$ where $\mu$ is the shear modulus,
351 $p$ is the pressure, and $F$ is the deformation gradient */
353{
354private:
355 Coefficient *c_mu;
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;
358 Vector Sh_p;
359
360public:
362
365 const Array<const Vector *> &elfun) override;
366
367 /// Perform the local action of the NonlinearFormIntegrator
370 const Array<const Vector *> &elfun,
371 const Array<Vector *> &elvec) override;
372
373 /// Assemble the local gradient matrix
376 const Array<const Vector *> &elfun,
377 const Array2D<DenseMatrix *> &elmats) override;
378};
379
380
382{
383private:
384 Coefficient *Q{};
385 DenseMatrix dshape, dshapex, EF, gradEF, ELV, elmat_comp;
386 Vector shape;
387 // PA extension
388 int dim, ne, nq, d1d, q1d;
389 Vector pa_adj, pa_u;
390 const DofToQuad *maps; ///< Not owned
391 const GeometricFactors *geom; ///< Not owned
392
393public:
394 struct Kernels { Kernels(); };
395
396 VectorConvectionNLFIntegrator(Coefficient &q): Q(&q) { static Kernels kernels; }
397
399
400 static const IntegrationRule &GetRule(const FiniteElement &fe,
401 const ElementTransformation &T);
402
405 const Vector &elfun,
406 Vector &elvect) override;
407
408 void AssembleElementGrad(const FiniteElement &el,
410 const Vector &elfun,
411 DenseMatrix &elmat) override;
412
414
415 void AssemblePA(const FiniteElementSpace &fes) override;
416
417 void AssembleGradPA(const Vector &x, const FiniteElementSpace &fes) override;
418
419 void AddMultPA(const Vector &x, Vector &y) const override;
420
422 void(*)(const int ne, const real_t *B, const real_t *G, const real_t *A,
423 const real_t *x, real_t *y,
424 const int d1d, const int q1d);
425 MFEM_REGISTER_KERNELS(AddMultPAKernels, AddMultPAType, (int, int, int));
426
427 void AddMultGradPA(const Vector &x, Vector &y) const override;
428
430 void(*)(const int ne, const real_t *B, const real_t *G, const real_t *A,
431 const real_t *u, const real_t *x, real_t *y,
432 const int d1d, const int q1d);
433
434 MFEM_REGISTER_KERNELS(AddMultGradPA2D, AddMultGradPAType, (int, int));
435 MFEM_REGISTER_KERNELS(AddMultGradPA3D, AddMultGradPAType, (int, int));
436
437 void AssembleGradDiagonalPA(Vector &) const override;
438
440 void (*)(const int ne, const real_t *B, const real_t *G, const real_t *A,
441 const real_t *u, real_t *y,
442 const int d1d, const int q1d);
443
444 MFEM_REGISTER_KERNELS(GradDiagPA2D, GradDiagPAType, (int, int));
445 MFEM_REGISTER_KERNELS(GradDiagPA3D, GradDiagPAType, (int, int));
446
447 template <int DIM, int D1D, int Q1D>
448 static void AddSpecialization()
449 {
450 AddMultPAKernels::Specialization<DIM, D1D, Q1D>::Add();
451 if constexpr (DIM == 2)
452 {
453 AddMultGradPA2D::Specialization<D1D, Q1D>::Add();
454 GradDiagPA2D::Specialization<D1D, Q1D>::Add();
455 }
456 else if constexpr (DIM == 3)
457 {
458 AddMultGradPA3D::Specialization<D1D, Q1D>::Add();
459 GradDiagPA3D::Specialization<D1D, Q1D>::Add();
460 }
461 }
462
463 void AssembleMF(const FiniteElementSpace &fes) override;
464
465 void AddMultMF(const Vector &x, Vector &y) const override;
466
467protected:
469 const FiniteElement& trial_fe,
470 const FiniteElement& test_fe,
471 const ElementTransformation& trans) const override
472 {
473 return &GetRule(test_fe, trans);
474 }
475};
476
477
478/** This class is used to assemble the convective form of the nonlinear term
479 arising in the Navier-Stokes equations $(u \cdot \nabla v, w )$.
480 Partial assembly is not supported; use VectorConvectionNLFIntegrator. */
483{
484private:
485 Coefficient *Q{};
486 DenseMatrix dshape, dshapex, EF, gradEF, ELV, elmat_comp;
487 Vector shape;
488
489public:
491
493
494 void AssembleElementGrad(const FiniteElement &el,
496 const Vector &elfun,
497 DenseMatrix &elmat) override;
498
500 void AssemblePA(const FiniteElementSpace &fes) override;
501 void AssembleGradPA(const Vector &x, const FiniteElementSpace &fes) override;
502 void AddMultPA(const Vector &x, Vector &y) const override;
503 void AddMultGradPA(const Vector &x, Vector &y) const override;
504 void AssembleGradDiagonalPA(Vector &diag) const override;
505};
506
507
508/** This class is used to assemble the skew-symmetric form of the nonlinear term
509 arising in the Navier-Stokes equations
510 $.5*(u \cdot \nabla v, w ) - .5*(u \cdot \nabla w, v )$.
511 Partial assembly is not supported; use VectorConvectionNLFIntegrator. */
514{
515private:
516 Coefficient *Q{};
517 DenseMatrix dshape, dshapex, EF, gradEF, ELV, elmat_comp;
518 Vector shape;
519
520public:
522
524
525 void AssembleElementGrad(const FiniteElement &el,
527 const Vector &elfun,
528 DenseMatrix &elmat) override;
529
531 void AssemblePA(const FiniteElementSpace &fes) override;
532 void AssembleGradPA(const Vector &x, const FiniteElementSpace &fes) override;
533 void AddMultPA(const Vector &x, Vector &y) const override;
534 void AddMultGradPA(const Vector &x, Vector &y) const override;
535 void AssembleGradDiagonalPA(Vector &diag) const override;
536};
537
538}
539
540#endif
Dynamic 2D array using row-major layout.
Definition array.hpp:459
virtual real_t GetElementEnergy(const Array< const FiniteElement * > &el, ElementTransformation &Tr, const Array< const Vector * > &elfun)
Compute the local energy.
virtual void AssembleFaceVector(const Array< const FiniteElement * > &el1, const Array< const FiniteElement * > &el2, FaceElementTransformations &Tr, const Array< const Vector * > &elfun, const Array< Vector * > &elvect)
virtual void AssembleElementVector(const Array< const FiniteElement * > &el, ElementTransformation &Tr, const Array< const Vector * > &elfun, const Array< Vector * > &elvec)
Perform the local action of the BlockNonlinearFormIntegrator.
virtual void AssembleFaceGrad(const Array< const FiniteElement * > &el1, const Array< const FiniteElement * > &el2, FaceElementTransformations &Tr, const Array< const Vector * > &elfun, const Array2D< DenseMatrix * > &elmats)
virtual void AssembleElementGrad(const Array< const FiniteElement * > &el, ElementTransformation &Tr, const Array< const Vector * > &elfun, const Array2D< DenseMatrix * > &elmats)
Assemble the local gradient matrix.
Base class Coefficients that optionally depend on space and time. These are used by the BilinearFormI...
void AddMultGradPA(const Vector &x, Vector &y) const override
Method for partially assembled gradient action.
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.
Definition densemat.hpp:24
Structure representing the matrices/tensors needed to evaluate (in reference space) the values,...
Definition fe_base.hpp:141
A specialized ElementTransformation class representing a face and its two neighboring elements.
Definition eltrans.hpp:750
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
Definition fespace.hpp:210
Abstract class for all finite elements.
Definition fe_base.hpp:294
Structure for storing mesh geometric factors: coordinates, Jacobians, and determinants of the Jacobia...
Definition mesh.hpp:3119
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 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.
Class for an integration rule - an Array of IntegrationPoint.
Definition intrules.hpp:96
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)
This class is used to express the local action of a general nonlinear finite element operator....
virtual void AssembleElementVector(const FiniteElement &el, ElementTransformation &Tr, const Vector &elfun, Vector &elvect)
Perform the local action of the NonlinearFormIntegrator.
virtual real_t GetLocalStateEnergyPA(const Vector &x) const
Compute the local (to the MPI rank) energy with partial assembly.
virtual void AddMultMF(const Vector &x, Vector &y) const
virtual void AssembleMF(const FiniteElementSpace &fes)
Method defining fully unassembled operator.
virtual void AssembleGradPA(const Vector &x, const FiniteElementSpace &fes)
Prepare the integrator for partial assembly (PA) gradient evaluations on the given FE space fes at th...
NonlinearFormIntegrator(const IntegrationRule *ir=NULL)
virtual void AssemblePA(const FiniteElementSpace &fes)
Method defining partial assembly.
void SetPAMemoryType(MemoryType mt)
virtual void AssembleFaceGrad(const FiniteElement &el1, const FiniteElement &el2, FaceElementTransformations &Tr, const Vector &elfun, DenseMatrix &elmat)
Assemble the local action of the gradient of the NonlinearFormIntegrator resulting from a face integr...
virtual void AssembleGradDiagonalPA(Vector &diag) const
Method for computing the diagonal of the gradient with partial assembly.
virtual void AssembleElementGrad(const FiniteElement &el, ElementTransformation &Tr, const Vector &elfun, DenseMatrix &elmat)
Assemble the local gradient matrix.
virtual void AssembleFaceVector(const FiniteElement &el1, const FiniteElement &el2, FaceElementTransformations &Tr, const Vector &elfun, Vector &elvect)
Perform the local action of the NonlinearFormIntegrator resulting from a face integral term.
virtual void AddMultPA(const Vector &x, Vector &y) const
Method for partially assembled action.
virtual void AddMultGradPA(const Vector &x, Vector &y) const
Method for partially assembled gradient action.
virtual real_t GetElementEnergy(const FiniteElement &el, ElementTransformation &Tr, const Vector &elfun)
Compute the local energy.
virtual bool SupportsCeed() const
Indicates whether this integrator can use a Ceed backend.
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.
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.
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))
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
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))
Vector data type.
Definition vector.hpp:82
void trans(const Vector &u, Vector &x)
Definition ex27.cpp:412
real_t weight(const Vector &x)
constexpr int DIM
real_t u(const Vector &xvec)
Definition lor_mms.hpp:22
float real_t
Definition config.hpp:46
MemoryType
Memory types supported by MFEM.