MFEM v4.8.0
Finite element discretization library
Loading...
Searching...
No Matches
lininteg.hpp
Go to the documentation of this file.
1// Copyright (c) 2010-2025, 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_LININTEG
13#define MFEM_LININTEG
14
15#include "../config/config.hpp"
16#include "coefficient.hpp"
17#include "bilininteg.hpp"
18#include <random>
19#include "integrator.hpp"
20
21namespace mfem
22{
23
24/// Abstract base class LinearFormIntegrator
26{
27protected:
28
30
31public:
32
33 /// Method probing for assembly on device
34 virtual bool SupportsDevice() const { return false; }
35
36 /// Method defining assembly on device
37 virtual void AssembleDevice(const FiniteElementSpace &fes,
38 const Array<int> &markers,
39 Vector &b);
40
41 /** Given a particular Finite Element and a transformation (Tr)
42 computes the element vector, elvect. */
43 virtual void AssembleRHSElementVect(const FiniteElement &el,
45 Vector &elvect) = 0;
46 virtual void AssembleRHSElementVect(const FiniteElement &el,
48 Vector &elvect);
49 virtual void AssembleRHSElementVect(const FiniteElement &el1,
50 const FiniteElement &el2,
52 Vector &elvect);
53
55};
56
57
58/// Abstract class for integrators that support delta coefficients
60{
61protected:
64
65 /** @brief This constructor should be used by derived classes that use a
66 scalar DeltaCoefficient. */
69 delta(dynamic_cast<DeltaCoefficient*>(&q)),
70 vec_delta(NULL) { }
71
72 /** @brief This constructor should be used by derived classes that use a
73 VectorDeltaCoefficient. */
75 const IntegrationRule *ir = NULL)
77 delta(NULL),
78 vec_delta(dynamic_cast<VectorDeltaCoefficient*>(&vq)) { }
79
80public:
81 /// Returns true if the derived class instance uses a delta coefficient.
82 bool IsDelta() const { return (delta || vec_delta); }
83
84 /// Returns the center of the delta coefficient.
85 void GetDeltaCenter(Vector &center)
86 {
87 if (delta) { delta->GetDeltaCenter(center); return; }
88 if (vec_delta) { vec_delta->GetDeltaCenter(center); return; }
89 center.SetSize(0);
90 }
91
92 /** @brief Assemble the delta coefficient at the IntegrationPoint set in
93 @a Trans which is assumed to map to the delta coefficient center.
94
95 @note This method should be called for one mesh element only, including
96 in parallel, even when the center of the delta coefficient is shared by
97 multiple elements. */
100 Vector &elvect) = 0;
101};
102
103
104/// Class for domain integration $ L(v) := (f, v) $
106{
107 Vector shape;
108 Coefficient &Q;
109 int oa, ob;
110public:
111 /// Constructs a domain integrator with a given Coefficient
112 DomainLFIntegrator(Coefficient &QF, int a = 2, int b = 0)
113 // the old default was a = 1, b = 1
114 // for simple elliptic problems a = 2, b = -2 is OK
115 : DeltaLFIntegrator(QF), Q(QF), oa(a), ob(b) { }
116
117 /// Constructs a domain integrator with a given Coefficient
119 : DeltaLFIntegrator(QF, ir), Q(QF), oa(1), ob(1) { }
120
121 bool SupportsDevice() const override { return true; }
122
123 /// Method defining assembly on device
124 void AssembleDevice(const FiniteElementSpace &fes,
125 const Array<int> &markers,
126 Vector &b) override;
127
128 /** Given a particular Finite Element and a transformation (Tr)
129 computes the element right hand side element vector, elvect. */
132 Vector &elvect) override;
133
136 Vector &elvect) override;
137
139};
140
141/// Class for domain integrator $ L(v) := (f, \nabla v) $
143{
144private:
145 Vector shape, Qvec;
147 DenseMatrix dshape;
148
149public:
150 /// Constructs the domain integrator $ (Q, \nabla v) $
153
154 bool SupportsDevice() const override { return true; }
155
156 /// Method defining assembly on device
157 void AssembleDevice(const FiniteElementSpace &fes,
158 const Array<int> &markers,
159 Vector &b) override;
160
161 /** Given a particular Finite Element and a transformation (Tr)
162 computes the element right hand side element vector, elvect. */
165 Vector &elvect) override;
166
169 Vector &elvect) override;
170
172};
173
174
175/// Class for boundary integration $ L(v) := (g, v) $
177{
178 Vector shape;
179 Coefficient &Q;
180 int oa, ob;
181public:
182 /** @brief Constructs a boundary integrator with a given Coefficient @a QG.
183 Integration order will be @a a * basis_order + @a b. */
184 BoundaryLFIntegrator(Coefficient &QG, int a = 1, int b = 1)
185 : Q(QG), oa(a), ob(b) { }
186
187 bool SupportsDevice() const override { return true; }
188
189 /// Method defining assembly on device
190 void AssembleDevice(const FiniteElementSpace &fes,
191 const Array<int> &markers,
192 Vector &b) override;
193
194 /** Given a particular boundary Finite Element and a transformation (Tr)
195 computes the element boundary vector, elvect. */
198 Vector &elvect) override;
201 Vector &elvect) override;
202
204};
205
206/// Class for boundary integration $ L(v) = (g \cdot n, v) $
208{
209 Vector shape;
211 int oa, ob;
212public:
213 /// Constructs a boundary integrator with a given Coefficient QG
215 : Q(QG), oa(a), ob(b) { }
216
217 bool SupportsDevice() const override { return true; }
218
219 /// Method defining assembly on device
220 void AssembleDevice(const FiniteElementSpace &fes,
221 const Array<int> &markers,
222 Vector &b) override;
223
226 Vector &elvect) override;
227
229};
230
231/// Class for boundary integration $ L(v) = (g \cdot \tau, v) $ in 2D
233{
234 Vector shape;
236 int oa, ob;
237public:
238 /// Constructs a boundary integrator with a given Coefficient QG
240 : Q(QG), oa(a), ob(b) { }
241
244 Vector &elvect) override;
245
247};
248
249/** Class for domain integration of $ L(v) := (f, v) $, where
250 $ f = (f_1,\dots,f_n)$ and $ v = (v_1,\dots,v_n) $. */
252{
253private:
254 Vector shape, Qvec;
256
257public:
258 /// Constructs a domain integrator with a given VectorCoefficient
261
262 bool SupportsDevice() const override { return true; }
263
264 /// Method defining assembly on device
265 void AssembleDevice(const FiniteElementSpace &fes,
266 const Array<int> &markers,
267 Vector &b) override;
268
269 /** Given a particular Finite Element and a transformation (Tr)
270 computes the element right hand side element vector, elvect. */
273 Vector &elvect) override;
274
277 Vector &elvect) override;
278
280};
281
282/** Class for domain integrator $ L(v) := (f, \nabla v) $, where
283 $ f = (f_{1x},f_{1y},f_{1z},\dots,f_{nx},f_{ny},f_{nz})$ and $v=(v_1,\dots,v_n)$. */
285{
286private:
287 Vector shape, Qvec;
289 DenseMatrix dshape;
290
291public:
292 /// Constructs the domain integrator (Q, grad v)
295
296 bool SupportsDevice() const override { return true; }
297
298 /// Method defining assembly on device
299 void AssembleDevice(const FiniteElementSpace &fes,
300 const Array<int> &markers,
301 Vector &b) override;
302
303 /** Given a particular Finite Element and a transformation (Tr)
304 computes the element right hand side element vector, elvect. */
307 Vector &elvect) override;
308
311 Vector &elvect) override;
312
314};
315
316/** Class for boundary integration of $ L(v) := (g, v) $, where
317 $g=(g_1,\dots,g_n)$ and $v=(v_1,\dots,v_n)$. */
319{
320private:
321 Vector shape, vec;
323
324public:
325 /// Constructs a boundary integrator with a given VectorCoefficient QG
327
328 /** Given a particular boundary Finite Element and a transformation (Tr)
329 computes the element boundary vector, elvect. */
332 Vector &elvect) override;
333
334 // For DG spaces
337 Vector &elvect) override;
338
340};
341
342/// $ (f, v)_{\Omega} $ for VectorFiniteElements (Nedelec, Raviart-Thomas)
344{
345private:
347 DenseMatrix vshape;
348 Vector vec;
349
350public:
353
356 Vector &elvect) override;
357
360 Vector &elvect) override;
361
362 bool SupportsDevice() const override { return true; }
363
364 void AssembleDevice(const FiniteElementSpace &fes,
365 const Array<int> &markers,
366 Vector &b) override;
367
369};
370
371/// $ (Q, \mathrm{curl}(v))_{\Omega} $ for Nedelec Elements
373{
374private:
375 VectorCoefficient *QF=nullptr;
376 DenseMatrix curlshape;
377 Vector vec;
378
379public:
380 /// Constructs the domain integrator $(Q, \mathrm{curl}(v)) $
383
386 Vector &elvect) override;
387
390 Vector &elvect) override;
391
393};
394
395/// $ (Q, \mathrm{div}(v))_{\Omega} $ for RT Elements
397{
398private:
399 Vector divshape;
400 Coefficient &Q;
401public:
402 /// Constructs the domain integrator $ (Q, \mathrm{div}(v)) $
405
406 /** Given a particular Finite Element and a transformation (Tr)
407 computes the element right hand side element vector, elvect. */
410 Vector &elvect) override;
411
414 Vector &elvect) override;
415
417};
418
419/** $ (f, v \cdot n)_{\partial\Omega} $ for vector test function
420 $v=(v_1,\dots,v_n)$ where all vi are in the same scalar FE space and $f$ is a
421 scalar function. */
423{
424private:
425 real_t Sign;
426 Coefficient *F;
427 Vector shape, nor;
428
429public:
431 const IntegrationRule *ir = NULL)
432 : LinearFormIntegrator(ir), Sign(s), F(&f) { }
433
436 Vector &elvect) override;
437
439};
440
441/** Class for boundary integration of $ (f, v \cdot n) $ for scalar coefficient $f$ and
442 RT vector test function $v$. This integrator works with RT spaces defined
443 using the RT_FECollection class. */
445{
446private:
447 Coefficient *F;
448 Vector shape;
449 int oa, ob; // these control the quadrature order, see DomainLFIntegrator
450
451public:
453 : F(NULL), oa(a), ob(b) { }
455 : F(&f), oa(a), ob(b) { }
456
459 Vector &elvect) override;
460
462
463 bool SupportsDevice() const override { return true; }
464
465 void AssembleDevice(const FiniteElementSpace &fes,
466 const Array<int> &markers,
467 Vector &b) override;
468};
469
470/** Class for boundary integration of (f.n, v.n) for vector coefficient f and
471 RT vector test function v. This integrator works with RT spaces defined
472 using the RT_FECollection class. */
474{
475private:
477 Vector shape;
478
479public:
481
482 virtual void AssembleRHSElementVect(const FiniteElement &el,
484 Vector &elvect) override;
485
487};
488
489/// Class for boundary integration $ L(v) = (n \times f, v) $
491{
492private:
494 int oa, ob;
495
496public:
498 int a = 2, int b = 0)
499 : f(QG), oa(a), ob(b) { }
500
503 Vector &elvect) override;
504
506};
507
508
509/** Class for boundary integration of the linear form:
510 $ \frac{\alpha}{2} \langle (u \cdot n) f, w \rangle - \beta \langle |u \cdot n| f, w \rangle $
511 where $f$ and $u$ are given scalar and vector coefficients, respectively,
512 and $w$ is the scalar test function. */
514{
515private:
516 Coefficient *f;
518 real_t alpha, beta;
519
520 Vector shape;
521
522public:
524 real_t a)
525 { f = &f_; u = &u_; alpha = a; beta = 0.5*a; }
526
528 real_t a, real_t b)
529 { f = &f_; u = &u_; alpha = a; beta = b; }
530
533 Vector &elvect) override;
536 Vector &elvect) override;
537
539};
540
541
542/** Boundary linear integrator for imposing non-zero Dirichlet boundary
543 conditions, to be used in conjunction with DGDiffusionIntegrator.
544 Specifically, given the Dirichlet data $u_D$, the linear form assembles the
545 following integrals on the boundary:
546 $$
547 \sigma \langle u_D, (Q \nabla v)) \cdot n \rangle + \kappa \langle {h^{-1} Q} u_D, v \rangle,
548 $$
549 where Q is a scalar or matrix diffusion coefficient and v is the test
550 function. The parameters $\sigma$ and $\kappa$ should be the same as the ones
551 used in the DGDiffusionIntegrator. */
553{
554protected:
558
559 // these are not thread-safe!
562
563public:
565 : uD(&u), Q(NULL), MQ(NULL), sigma(s), kappa(k) { }
567 const real_t s, const real_t k)
568 : uD(&u), Q(&q), MQ(NULL), sigma(s), kappa(k) { }
570 const real_t s, const real_t k)
571 : uD(&u), Q(NULL), MQ(&q), sigma(s), kappa(k) { }
572
575 Vector &elvect) override;
578 Vector &elvect) override;
579
581};
582
583
584/** Boundary linear form integrator for imposing non-zero Dirichlet boundary
585 conditions, in a DG elasticity formulation. Specifically, the linear form is
586 given by
587 $$
588 \alpha \langle u_D, (\lambda \mathrm{div}(v) I + \mu (\nabla v + \nabla v^{\mathrm{T}})) \cdot n \rangle +
589 + \kappa \langle h^{-1} (\lambda + 2 \mu) u_D, v \rangle,
590 $$
591 where u_D is the given Dirichlet data. The parameters $\alpha$, $\kappa$, $\lambda$
592 and $\mu$, should match the parameters with the same names used in the bilinear
593 form integrator, DGElasticityIntegrator. */
595{
596protected:
600
601#ifndef MFEM_THREAD_SAFE
610#endif
611
612public:
614 Coefficient &lambda_, Coefficient &mu_,
615 real_t alpha_, real_t kappa_)
616 : uD(uD_), lambda(&lambda_), mu(&mu_), alpha(alpha_), kappa(kappa_) { }
617
620 Vector &elvect) override;
623 Vector &elvect) override;
624
626};
627
628
629/** Class for spatial white Gaussian noise integration.
630
631 The target problem is the linear SPDE $ a(u,v) = F(v)$ with $F(v) := <\dot{W},v> $,
632 where $\dot{W}$ is spatial white Gaussian noise. When the Galerkin method is used to
633 discretize this problem into a linear system of equations $Ax = b$, the RHS is
634 a Gaussian random vector $b \sim N(0,M)$ whose covariance matrix is the same as the
635 mass matrix $M_{ij} = (v_i,v_j)$. This property can be ensured if $b = H w$, where
636 $HH^{\mathrm{T}} = M$ and each component $w_i\sim N(0,1)$.
637
638 There is much flexibility in how we may wish to define $H$. In this PR, we
639 define $H = P^{\mathrm{T}} diag(L_e)$, where $P$ is the local-to-global dof assembly matrix
640 and $\mathrm{diag}(L_e)$ is a block-diagonal matrix with $L_e L_e^{\mathrm{T}} = M_e$, where $M_e$ is
641 the element mass matrix for element $e$. A straightforward computation shows
642 that $HH^{\mathrm{T}} = P^{\mathrm{T}} diag(M_e) P = M$, as necessary. */
644{
645#ifdef MFEM_USE_MPI
646 MPI_Comm comm;
647#endif
648 MassIntegrator massinteg;
650
651 // Define random generator with Gaussian distribution
652 std::default_random_engine generator;
653 std::normal_distribution<real_t> dist;
654
655 bool save_factors = false;
656public:
657
658#ifdef MFEM_USE_MPI
659 /** @brief Sets the @a seed_ of the random number generator. A fixed seed
660 allows for a reproducible sequence of white noise vectors. */
662 : LinearFormIntegrator(), comm(MPI_COMM_NULL)
663 {
664 if (seed_ > 0) { SetSeed(seed_); }
665 }
666
667 /** @brief Sets the MPI communicator @a comm_ and the @a seed_ of the random
668 number generator. A fixed seed allows for a reproducible sequence of
669 white noise vectors. */
670 WhiteGaussianNoiseDomainLFIntegrator(MPI_Comm comm_, int seed_)
671 : LinearFormIntegrator(), comm(comm_)
672 {
673 int myid;
674 MPI_Comm_rank(comm, &myid);
675
676 int seed = (seed_ > 0) ? seed_ + myid : (int)time(0) + myid;
677 SetSeed(seed);
678 }
679#else
680 /** @brief Sets the @a seed_ of the random number generator. A fixed seed
681 allows for a reproducible sequence of white noise vectors. */
684 {
685 if (seed_ > 0) { SetSeed(seed_); }
686 }
687#endif
688 /// @brief Sets/resets the @a seed of the random number generator.
689 void SetSeed(int seed)
690 {
691 generator.seed(seed);
692 }
693
697 Vector &elvect) override;
698
699 /** @brief Saves the lower triangular matrices in the element-wise Cholesky
700 decomposition. The parameter @a NE should be the number of elements in
701 the mesh. */
702 void SaveFactors(int NE)
703 {
704 save_factors = true;
705 ResetFactors(NE);
706 }
707
708 /** @brief Resets the array of saved lower triangular Cholesky decomposition
709 matrices. The parameter @a NE should be the number of elements in the
710 mesh. */
711 void ResetFactors(int NE)
712 {
713 for (int i = 0; i<L.Size(); i++)
714 {
715 delete L[i];
716 }
717 L.DeleteAll();
718
719 L.SetSize(NE);
720 for (int i = 0; i<NE; i++)
721 {
722 L[i] = nullptr;
723 }
724 }
725
727 {
728 for (int i = 0; i<L.Size(); i++)
729 {
730 delete L[i];
731 }
732 L.DeleteAll();
733 }
734};
735
736
737/** Class for domain integration of $ L(v) := (f, v) $, where
738 $ f=(f_1,\dots,f_n)$ and $v=(v_1,\dots,v_n)$. that makes use of
739 VectorQuadratureFunctionCoefficient*/
741{
742private:
744
745public:
747 const IntegrationRule *ir = NULL)
748 : LinearFormIntegrator(ir), vqfc(vqfc)
749 {
750 if (ir)
751 {
752 MFEM_WARNING("Integration rule not used in this class. "
753 "The QuadratureFunction integration rules are used instead");
754 }
755 }
756
760 Vector &elvect) override;
761
762 void SetIntRule(const IntegrationRule *ir) override
763 {
764 MFEM_WARNING("Integration rule not used in this class. "
765 "The QuadratureFunction integration rules are used instead");
766 }
767};
768
769
770/** Class for domain integration $ L(v) := (f, v) $ that makes use
771 of QuadratureFunctionCoefficient. */
773{
774private:
776
777public:
779 const IntegrationRule *ir = NULL)
780 : LinearFormIntegrator(ir), qfc(qfc)
781 {
782 if (ir)
783 {
784 MFEM_WARNING("Integration rule not used in this class. "
785 "The QuadratureFunction integration rules are used instead");
786 }
787 }
788
792 Vector &elvect) override;
793
794 void SetIntRule(const IntegrationRule *ir) override
795 {
796 MFEM_WARNING("Integration rule not used in this class. "
797 "The QuadratureFunction integration rules are used instead");
798 }
799};
800
801}
802
803
804#endif
void SetSize(int nsize)
Change the logical size of the array, keep existing entries.
Definition array.hpp:758
int Size() const
Return the logical size of the array.
Definition array.hpp:147
void DeleteAll()
Delete the whole array.
Definition array.hpp:925
BoundaryFlowIntegrator(Coefficient &f_, VectorCoefficient &u_, real_t a, real_t b)
Definition lininteg.hpp:527
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
Definition lininteg.cpp:744
BoundaryFlowIntegrator(Coefficient &f_, VectorCoefficient &u_, real_t a)
Definition lininteg.hpp:523
Class for boundary integration .
Definition lininteg.hpp:177
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
Definition lininteg.cpp:127
BoundaryLFIntegrator(Coefficient &QG, int a=1, int b=1)
Constructs a boundary integrator with a given Coefficient QG. Integration order will be a * basis_ord...
Definition lininteg.hpp:184
void AssembleDevice(const FiniteElementSpace &fes, const Array< int > &markers, Vector &b) override
Method defining assembly on device.
bool SupportsDevice() const override
Method probing for assembly on device.
Definition lininteg.hpp:187
Class for boundary integration .
Definition lininteg.hpp:208
BoundaryNormalLFIntegrator(VectorCoefficient &QG, int a=1, int b=1)
Constructs a boundary integrator with a given Coefficient QG.
Definition lininteg.hpp:214
bool SupportsDevice() const override
Method probing for assembly on device.
Definition lininteg.hpp:217
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
Definition lininteg.cpp:190
void AssembleDevice(const FiniteElementSpace &fes, const Array< int > &markers, Vector &b) override
Method defining assembly on device.
Class for boundary integration in 2D.
Definition lininteg.hpp:233
BoundaryTangentialLFIntegrator(VectorCoefficient &QG, int a=1, int b=1)
Constructs a boundary integrator with a given Coefficient QG.
Definition lininteg.hpp:239
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
Definition lininteg.cpp:229
Base class Coefficients that optionally depend on space and time. These are used by the BilinearFormI...
DGDirichletLFIntegrator(Coefficient &u, MatrixCoefficient &q, const real_t s, const real_t k)
Definition lininteg.hpp:569
DGDirichletLFIntegrator(Coefficient &u, Coefficient &q, const real_t s, const real_t k)
Definition lininteg.hpp:566
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
Definition lininteg.cpp:810
DGDirichletLFIntegrator(Coefficient &u, const real_t s, const real_t k)
Definition lininteg.hpp:564
MatrixCoefficient * MQ
Definition lininteg.hpp:556
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
Definition lininteg.cpp:901
DGElasticityDirichletLFIntegrator(VectorCoefficient &uD_, Coefficient &lambda_, Coefficient &mu_, real_t alpha_, real_t kappa_)
Definition lininteg.hpp:613
Delta function coefficient optionally multiplied by a weight coefficient and a scaled time dependent ...
void GetDeltaCenter(Vector &center)
Write the center of the delta function into center.
Abstract class for integrators that support delta coefficients.
Definition lininteg.hpp:60
VectorDeltaCoefficient * vec_delta
Definition lininteg.hpp:63
bool IsDelta() const
Returns true if the derived class instance uses a delta coefficient.
Definition lininteg.hpp:82
DeltaCoefficient * delta
Definition lininteg.hpp:62
DeltaLFIntegrator(VectorCoefficient &vq, const IntegrationRule *ir=NULL)
This constructor should be used by derived classes that use a VectorDeltaCoefficient.
Definition lininteg.hpp:74
DeltaLFIntegrator(Coefficient &q, const IntegrationRule *ir=NULL)
This constructor should be used by derived classes that use a scalar DeltaCoefficient.
Definition lininteg.hpp:67
virtual void AssembleDeltaElementVect(const FiniteElement &fe, ElementTransformation &Trans, Vector &elvect)=0
Assemble the delta coefficient at the IntegrationPoint set in Trans which is assumed to map to the de...
void GetDeltaCenter(Vector &center)
Returns the center of the delta coefficient.
Definition lininteg.hpp:85
Data type dense matrix using column-major storage.
Definition densemat.hpp:24
Class for domain integrator .
Definition lininteg.hpp:143
bool SupportsDevice() const override
Method probing for assembly on device.
Definition lininteg.hpp:154
void AssembleDeltaElementVect(const FiniteElement &fe, ElementTransformation &Trans, Vector &elvect) override
Assemble the delta coefficient at the IntegrationPoint set in Trans which is assumed to map to the de...
Definition lininteg.cpp:111
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
Definition lininteg.cpp:79
void AssembleDevice(const FiniteElementSpace &fes, const Array< int > &markers, Vector &b) override
Method defining assembly on device.
DomainLFGradIntegrator(VectorCoefficient &QF)
Constructs the domain integrator .
Definition lininteg.hpp:151
Class for domain integration .
Definition lininteg.hpp:106
void AssembleDevice(const FiniteElementSpace &fes, const Array< int > &markers, Vector &b) override
Method defining assembly on device.
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
Definition lininteg.cpp:38
bool SupportsDevice() const override
Method probing for assembly on device.
Definition lininteg.hpp:121
DomainLFIntegrator(Coefficient &QF, int a=2, int b=0)
Constructs a domain integrator with a given Coefficient.
Definition lininteg.hpp:112
void AssembleDeltaElementVect(const FiniteElement &fe, ElementTransformation &Trans, Vector &elvect) override
Assemble the delta coefficient at the IntegrationPoint set in Trans which is assumed to map to the de...
Definition lininteg.cpp:70
DomainLFIntegrator(Coefficient &QF, const IntegrationRule *ir)
Constructs a domain integrator with a given Coefficient.
Definition lininteg.hpp:118
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:244
Abstract class for all finite elements.
Definition fe_base.hpp:244
Class for an integration rule - an Array of IntegrationPoint.
Definition intrules.hpp:100
This base class implements some shared functionality between linear and nonlinear form integrators.
Abstract base class LinearFormIntegrator.
Definition lininteg.hpp:26
virtual void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect)=0
virtual void AssembleDevice(const FiniteElementSpace &fes, const Array< int > &markers, Vector &b)
Method defining assembly on device.
Definition lininteg.cpp:18
LinearFormIntegrator(const IntegrationRule *ir=NULL)
Definition lininteg.hpp:29
virtual bool SupportsDevice() const
Method probing for assembly on device.
Definition lininteg.hpp:34
Base class for Matrix Coefficients that optionally depend on time and space.
Quadrature function coefficient which requires that the quadrature rules used for this coefficient be...
void AssembleRHSElementVect(const FiniteElement &fe, ElementTransformation &Tr, Vector &elvect) override
QuadratureLFIntegrator(QuadratureFunctionCoefficient &qfc, const IntegrationRule *ir=NULL)
Definition lininteg.hpp:778
void SetIntRule(const IntegrationRule *ir) override
Prescribe a fixed IntegrationRule to use, or set to null to let the integrator choose an appropriate ...
Definition lininteg.hpp:794
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
Definition lininteg.cpp:590
VectorBoundaryFluxLFIntegrator(Coefficient &f, real_t s=1.0, const IntegrationRule *ir=NULL)
Definition lininteg.hpp:430
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
Definition lininteg.cpp:376
VectorBoundaryLFIntegrator(VectorCoefficient &QG)
Constructs a boundary integrator with a given VectorCoefficient QG.
Definition lininteg.hpp:326
Base class for vector Coefficients that optionally depend on time and space.
Vector coefficient defined by a scalar DeltaCoefficient and a constant vector direction.
void GetDeltaCenter(Vector &center)
bool SupportsDevice() const override
Method probing for assembly on device.
Definition lininteg.hpp:296
VectorDomainLFGradIntegrator(VectorCoefficient &QF)
Constructs the domain integrator (Q, grad v)
Definition lininteg.hpp:293
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
Definition lininteg.cpp:328
void AssembleDevice(const FiniteElementSpace &fes, const Array< int > &markers, Vector &b) override
Method defining assembly on device.
void AssembleDeltaElementVect(const FiniteElement &fe, ElementTransformation &Trans, Vector &elvect) override
Assemble the delta coefficient at the IntegrationPoint set in Trans which is assumed to map to the de...
Definition lininteg.cpp:370
VectorDomainLFIntegrator(VectorCoefficient &QF)
Constructs a domain integrator with a given VectorCoefficient.
Definition lininteg.hpp:259
void AssembleDeltaElementVect(const FiniteElement &fe, ElementTransformation &Trans, Vector &elvect) override
Assemble the delta coefficient at the IntegrationPoint set in Trans which is assumed to map to the de...
Definition lininteg.cpp:311
void AssembleDevice(const FiniteElementSpace &fes, const Array< int > &markers, Vector &b) override
Method defining assembly on device.
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
Definition lininteg.cpp:269
bool SupportsDevice() const override
Method probing for assembly on device.
Definition lininteg.hpp:262
void AssembleDevice(const FiniteElementSpace &fes, const Array< int > &markers, Vector &b) override
Method defining assembly on device.
bool SupportsDevice() const override
Method probing for assembly on device.
Definition lininteg.hpp:463
VectorFEBoundaryFluxLFIntegrator(int a=1, int b=-1)
Definition lininteg.hpp:452
VectorFEBoundaryFluxLFIntegrator(Coefficient &f, int a=2, int b=0)
Definition lininteg.hpp:454
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
Definition lininteg.cpp:623
VectorFEBoundaryNormalLFIntegrator(VectorCoefficient &f)
Definition lininteg.hpp:480
virtual void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
Definition lininteg.cpp:655
Class for boundary integration .
Definition lininteg.hpp:491
VectorFEBoundaryTangentLFIntegrator(VectorCoefficient &QG, int a=2, int b=0)
Definition lininteg.hpp:497
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
Definition lininteg.cpp:688
void AssembleDeltaElementVect(const FiniteElement &fe, ElementTransformation &Trans, Vector &elvect) override
Assemble the delta coefficient at the IntegrationPoint set in Trans which is assumed to map to the de...
Definition lininteg.cpp:536
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
Definition lininteg.cpp:504
VectorFEDomainLFCurlIntegrator(VectorCoefficient &F)
Constructs the domain integrator .
Definition lininteg.hpp:381
void AssembleDeltaElementVect(const FiniteElement &fe, ElementTransformation &Trans, Vector &elvect) override
Assemble the delta coefficient at the IntegrationPoint set in Trans which is assumed to map to the de...
Definition lininteg.cpp:581
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
Definition lininteg.cpp:553
VectorFEDomainLFDivIntegrator(Coefficient &QF)
Constructs the domain integrator .
Definition lininteg.hpp:403
for VectorFiniteElements (Nedelec, Raviart-Thomas)
Definition lininteg.hpp:344
bool SupportsDevice() const override
Method probing for assembly on device.
Definition lininteg.hpp:362
VectorFEDomainLFIntegrator(VectorCoefficient &F)
Definition lininteg.hpp:351
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
Definition lininteg.cpp:454
void AssembleDeltaElementVect(const FiniteElement &fe, ElementTransformation &Trans, Vector &elvect) override
Assemble the delta coefficient at the IntegrationPoint set in Trans which is assumed to map to the de...
Definition lininteg.cpp:488
void AssembleDevice(const FiniteElementSpace &fes, const Array< int > &markers, Vector &b) override
Method defining assembly on device.
Vector quadrature function coefficient which requires that the quadrature rules used for this vector ...
void AssembleRHSElementVect(const FiniteElement &fe, ElementTransformation &Tr, Vector &elvect) override
void SetIntRule(const IntegrationRule *ir) override
Prescribe a fixed IntegrationRule to use, or set to null to let the integrator choose an appropriate ...
Definition lininteg.hpp:762
VectorQuadratureLFIntegrator(VectorQuadratureFunctionCoefficient &vqfc, const IntegrationRule *ir=NULL)
Definition lininteg.hpp:746
Vector data type.
Definition vector.hpp:82
void SetSize(int s)
Resize the vector to size s.
Definition vector.hpp:558
WhiteGaussianNoiseDomainLFIntegrator(MPI_Comm comm_, int seed_)
Sets the MPI communicator comm_ and the seed_ of the random number generator. A fixed seed allows for...
Definition lininteg.hpp:670
WhiteGaussianNoiseDomainLFIntegrator(int seed_=0)
Sets the seed_ of the random number generator. A fixed seed allows for a reproducible sequence of whi...
Definition lininteg.hpp:661
void SetSeed(int seed)
Sets/resets the seed of the random number generator.
Definition lininteg.hpp:689
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
void ResetFactors(int NE)
Resets the array of saved lower triangular Cholesky decomposition matrices. The parameter NE should b...
Definition lininteg.hpp:711
void SaveFactors(int NE)
Saves the lower triangular matrices in the element-wise Cholesky decomposition. The parameter NE shou...
Definition lininteg.hpp:702
Vector beta
const real_t alpha
Definition ex15.cpp:369
real_t b
Definition lissajous.cpp:42
real_t a
Definition lissajous.cpp:41
real_t f(const Vector &p)
real_t u(const Vector &xvec)
Definition lor_mms.hpp:22
float real_t
Definition config.hpp:43
std::function< real_t(const Vector &)> f(real_t mass_coeff)
Definition lor_mms.hpp:30