MFEM v4.10.0
Finite element discretization library
Loading...
Searching...
No Matches
lininteg.cpp
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#include "fem.hpp"
13#include <cmath>
14#include "intrules.hpp"
15
16namespace mfem
17{
19 const Array<int> &markers,
20 Vector &b)
21{
22 MFEM_ABORT("Not supported.");
23}
24
26 const FiniteElement &el, FaceElementTransformations &Tr, Vector &elvect)
27{
28 mfem_error("LinearFormIntegrator::AssembleRHSElementVect(...)");
29}
30
32 const FiniteElement &el1, const FiniteElement &el2,
34{
35 mfem_error("LinearFormIntegrator::AssembleRHSElementVect(...)");
36}
37
39 : DeltaLFIntegrator(QF), Q(QF), oa(a), ob(b)
40{
41 static Kernels kernels;
42}
43
45 const IntegrationRule *ir)
46 : DeltaLFIntegrator(QF, ir), Q(QF), oa(1), ob(1)
47{
48 static Kernels kernels;
49}
50
53 Vector &elvect)
54{
55 int dof = el.GetDof();
56
57 shape.SetSize(dof); // vector of size dof
58 elvect.SetSize(dof);
59 elvect = 0.0;
60
61 const IntegrationRule *ir = GetIntegrationRule(el, Tr);
62
63 if (ir == NULL)
64 {
65 // ir = &IntRules.Get(el.GetGeomType(),
66 // oa * el.GetOrder() + ob + Tr.OrderW());
67 ir = &IntRules.Get(el.GetGeomType(), oa * el.GetOrder() + ob);
68 }
69
70 for (int i = 0; i < ir->GetNPoints(); i++)
71 {
72 const IntegrationPoint &ip = ir->IntPoint(i);
73
74 Tr.SetIntPoint (&ip);
75 real_t val = Tr.Weight() * Q.Eval(Tr, ip);
76
77 el.CalcPhysShape(Tr, shape);
78
79 add(elvect, ip.weight * val, shape, elvect);
80 }
81}
82
84 const FiniteElement &fe, ElementTransformation &Trans, Vector &elvect)
85{
86 MFEM_ASSERT(delta != NULL, "coefficient must be DeltaCoefficient");
87 elvect.SetSize(fe.GetDof());
88 fe.CalcPhysShape(Trans, elvect);
89 elvect *= delta->EvalDelta(Trans, Trans.GetIntPoint());
90}
91
93 const FiniteElement &el, ElementTransformation &Tr, Vector &elvect)
94{
95 int dof = el.GetDof();
96 int spaceDim = Tr.GetSpaceDim();
97
98 dshape.SetSize(dof, spaceDim);
99
100 elvect.SetSize(dof);
101 elvect = 0.0;
102
103 const IntegrationRule *ir = GetIntegrationRule(el, Tr);
104 if (ir == NULL)
105 {
106 int intorder = 2 * el.GetOrder();
107 ir = &IntRules.Get(el.GetGeomType(), intorder);
108 }
109
110 for (int i = 0; i < ir->GetNPoints(); i++)
111 {
112 const IntegrationPoint &ip = ir->IntPoint(i);
113
114 Tr.SetIntPoint(&ip);
115 el.CalcPhysDShape(Tr, dshape);
116
117 Q.Eval(Qvec, Tr, ip);
118 Qvec *= ip.weight * Tr.Weight();
119
120 dshape.AddMult(Qvec, elvect);
121 }
122}
123
125 const FiniteElement &fe, ElementTransformation &Trans, Vector &elvect)
126{
127 MFEM_ASSERT(vec_delta != NULL,"coefficient must be VectorDeltaCoefficient");
128 int dof = fe.GetDof();
129 int spaceDim = Trans.GetSpaceDim();
130
131 dshape.SetSize(dof, spaceDim);
132 fe.CalcPhysDShape(Trans, dshape);
133
134 vec_delta->EvalDelta(Qvec, Trans, Trans.GetIntPoint());
135
136 elvect.SetSize(dof);
137 dshape.Mult(Qvec, elvect);
138}
139
141 const FiniteElement &el, ElementTransformation &Tr, Vector &elvect)
142{
143 int dof = el.GetDof();
144
145 shape.SetSize(dof); // vector of size dof
146 elvect.SetSize(dof);
147 elvect = 0.0;
148
149 const IntegrationRule *ir = IntRule;
150 if (ir == NULL)
151 {
152 int intorder = oa * el.GetOrder() + ob; // <----------
153 ir = &IntRules.Get(el.GetGeomType(), intorder);
154 }
155
156 for (int i = 0; i < ir->GetNPoints(); i++)
157 {
158 const IntegrationPoint &ip = ir->IntPoint(i);
159
160 Tr.SetIntPoint (&ip);
161 real_t val = Tr.Weight() * Q.Eval(Tr, ip);
162
163 el.CalcShape(ip, shape);
164
165 add(elvect, ip.weight * val, shape, elvect);
166 }
167}
168
170 const FiniteElement &el, FaceElementTransformations &Tr, Vector &elvect)
171{
172 int dof = el.GetDof();
173
174 shape.SetSize(dof); // vector of size dof
175 elvect.SetSize(dof);
176 elvect = 0.0;
177
178 const IntegrationRule *ir = IntRule;
179 if (ir == NULL)
180 {
181 int intorder = oa * el.GetOrder() + ob; // <------ user control
182 ir = &IntRules.Get(Tr.FaceGeom, intorder); // of integration order
183 }
184
185 for (int i = 0; i < ir->GetNPoints(); i++)
186 {
187 const IntegrationPoint &ip = ir->IntPoint(i);
188
189 // Set the integration point in the face and the neighboring element
190 Tr.SetAllIntPoints(&ip);
191
192 // Access the neighboring element's integration point
193 const IntegrationPoint &eip = Tr.GetElement1IntPoint();
194
195 real_t val = Tr.Face->Weight() * ip.weight * Q.Eval(*Tr.Face, ip);
196
197 el.CalcShape(eip, shape);
198
199 add(elvect, val, shape, elvect);
200 }
201}
202
204 const FiniteElement &el, ElementTransformation &Tr, Vector &elvect)
205{
206 int dim = el.GetDim()+1;
207 int dof = el.GetDof();
208 Vector nor(dim), Qvec;
209
210 shape.SetSize(dof);
211 elvect.SetSize(dof);
212 elvect = 0.0;
213
214 const IntegrationRule *ir = IntRule;
215 if (ir == NULL)
216 {
217 int intorder = oa * el.GetOrder() + ob; // <----------
218 ir = &IntRules.Get(el.GetGeomType(), intorder);
219 }
220
221 for (int i = 0; i < ir->GetNPoints(); i++)
222 {
223 const IntegrationPoint &ip = ir->IntPoint(i);
224
225 Tr.SetIntPoint(&ip);
226 if (dim > 1)
227 {
228 CalcOrtho(Tr.Jacobian(), nor);
229 }
230 else
231 {
232 nor[0] = 1.0;
233 }
234 Q.Eval(Qvec, Tr, ip);
235
236 el.CalcShape(ip, shape);
237
238 elvect.Add(ip.weight*(Qvec*nor), shape);
239 }
240}
241
243 const FiniteElement &el, ElementTransformation &Tr, Vector &elvect)
244{
245 int dim = el.GetDim()+1;
246 int dof = el.GetDof();
247 Vector tangent(dim), Qvec;
248
249 shape.SetSize(dof);
250 elvect.SetSize(dof);
251 elvect = 0.0;
252
253 if (dim != 2)
254 {
255 mfem_error("These methods make sense only in 2D problems.");
256 }
257
258 const IntegrationRule *ir = IntRule;
259 if (ir == NULL)
260 {
261 int intorder = oa * el.GetOrder() + ob; // <----------
262 ir = &IntRules.Get(el.GetGeomType(), intorder);
263 }
264
265 for (int i = 0; i < ir->GetNPoints(); i++)
266 {
267 const IntegrationPoint &ip = ir->IntPoint(i);
268
269 Tr.SetIntPoint(&ip);
270 const DenseMatrix &Jac = Tr.Jacobian();
271 tangent(0) = Jac(0,0);
272 tangent(1) = Jac(1,0);
273
274 Q.Eval(Qvec, Tr, ip);
275
276 el.CalcShape(ip, shape);
277
278 add(elvect, ip.weight*(Qvec*tangent), shape, elvect);
279 }
280}
281
288
290 const FiniteElement &el, ElementTransformation &Tr, Vector &elvect)
291{
292 int vdim = Q.GetVDim();
293 int dof = el.GetDof();
294
295 real_t val,cf;
296
297 shape.SetSize(dof); // vector of size dof
298
299 elvect.SetSize(dof * vdim);
300 elvect = 0.0;
301
302 const IntegrationRule *ir = GetIntegrationRule(el, Tr);
303 if (ir == NULL)
304 {
305 int intorder = 2*el.GetOrder();
306 ir = &IntRules.Get(el.GetGeomType(), intorder);
307 }
308
309 for (int i = 0; i < ir->GetNPoints(); i++)
310 {
311 const IntegrationPoint &ip = ir->IntPoint(i);
312
313 Tr.SetIntPoint (&ip);
314 val = Tr.Weight();
315
316 el.CalcPhysShape(Tr, shape);
317 Q.Eval (Qvec, Tr, ip);
318
319 for (int k = 0; k < vdim; k++)
320 {
321 cf = val * Qvec(k);
322
323 for (int s = 0; s < dof; s++)
324 {
325 elvect(dof*k+s) += ip.weight * cf * shape(s);
326 }
327 }
328 }
329}
330
332 const FiniteElement &fe, ElementTransformation &Trans, Vector &elvect)
333{
334 MFEM_ASSERT(vec_delta != NULL, "coefficient must be VectorDeltaCoefficient");
335 int vdim = Q.GetVDim();
336 int dof = fe.GetDof();
337
338 shape.SetSize(dof);
339 fe.CalcPhysShape(Trans, shape);
340
341 vec_delta->EvalDelta(Qvec, Trans, Trans.GetIntPoint());
342
343 elvect.SetSize(dof*vdim);
344 DenseMatrix elvec_as_mat(elvect.GetData(), dof, vdim);
345 MultVWt(shape, Qvec, elvec_as_mat);
346}
347
349 const FiniteElement &el, ElementTransformation &Tr, Vector &elvect)
350{
351 const int dim = el.GetDim();
352 const int dof = el.GetDof();
353 const int vdim = Q.GetVDim();
354 const int sdim = Tr.GetSpaceDim();
355
356 dshape.SetSize(dof,sdim);
357
358 elvect.SetSize(dof*(vdim/sdim));
359 elvect = 0.0;
360
361 const IntegrationRule *ir = GetIntegrationRule(el, Tr);
362 if (ir == NULL)
363 {
364 int intorder = 2 * el.GetOrder();
365 ir = &IntRules.Get(el.GetGeomType(), intorder);
366 }
367
368 Vector pelvect(dof);
369 Vector part_x(dim);
370
371 for (int q = 0; q < ir->GetNPoints(); q++)
372 {
373 const IntegrationPoint &ip = ir->IntPoint(q);
374
375 Tr.SetIntPoint(&ip);
376 el.CalcPhysDShape(Tr, dshape);
377
378 Q.Eval(Qvec, Tr, ip);
379 Qvec *= ip.weight * Tr.Weight();
380
381 for (int k = 0; k < vdim/sdim; k++)
382 {
383 for (int d=0; d < sdim; ++d) { part_x(d) = Qvec(k*sdim+d); }
384 dshape.Mult(part_x, pelvect);
385 for (int s = 0; s < dof; ++s) { elvect(s+k*dof) += pelvect(s); }
386 }
387 }
388}
389
392{
393 MFEM_ABORT("Not implemented!");
394}
395
397 const FiniteElement &el, ElementTransformation &Tr, Vector &elvect)
398{
399 int vdim = Q.GetVDim();
400 int dof = el.GetDof();
401
402 shape.SetSize(dof);
403 vec.SetSize(vdim);
404
405 elvect.SetSize(dof * vdim);
406 elvect = 0.0;
407
408 const IntegrationRule *ir = IntRule;
409 if (ir == NULL)
410 {
411 int intorder = 2*el.GetOrder();
412 ir = &IntRules.Get(el.GetGeomType(), intorder);
413 }
414
415 for (int i = 0; i < ir->GetNPoints(); i++)
416 {
417 const IntegrationPoint &ip = ir->IntPoint(i);
418
419 Tr.SetIntPoint (&ip);
420 Q.Eval(vec, Tr, ip);
421 vec *= Tr.Weight() * ip.weight;
422 el.CalcShape(ip, shape);
423 for (int k = 0; k < vdim; k++)
424 for (int s = 0; s < dof; s++)
425 {
426 elvect(dof*k+s) += vec(k) * shape(s);
427 }
428 }
429}
430
432 const FiniteElement &el, FaceElementTransformations &Tr, Vector &elvect)
433{
434 int vdim = Q.GetVDim();
435 int dof = el.GetDof();
436
437 shape.SetSize(dof);
438 vec.SetSize(vdim);
439
440 elvect.SetSize(dof * vdim);
441 elvect = 0.0;
442
443 const IntegrationRule *ir = IntRule;
444 if (ir == NULL)
445 {
446 int intorder = 2*el.GetOrder();
447 ir = &IntRules.Get(Tr.GetGeometryType(), intorder);
448 }
449
450 for (int i = 0; i < ir->GetNPoints(); i++)
451 {
452 const IntegrationPoint &ip = ir->IntPoint(i);
453
454 // Set the integration point in the face and the neighboring element
455 Tr.SetAllIntPoints(&ip);
456
457 // Access the neighboring element's integration point
458 const IntegrationPoint &eip = Tr.GetElement1IntPoint();
459
460 // Use Tr transformation in case Q depends on boundary attribute
461 Q.Eval(vec, Tr, ip);
462 vec *= Tr.Weight() * ip.weight;
463 el.CalcShape(eip, shape);
464 for (int k = 0; k < vdim; k++)
465 {
466 for (int s = 0; s < dof; s++)
467 {
468 elvect(dof*k+s) += vec(k) * shape(s);
469 }
470 }
471 }
472}
473
476 : DeltaLFIntegrator(F, ir), QF(F)
477{
478 static Kernels kernels{};
479}
480
482 const FiniteElement &el, ElementTransformation &Tr, Vector &elvect)
483{
484 int dof = el.GetDof();
485 int spaceDim = Tr.GetSpaceDim();
486 int vdim = std::max(spaceDim, el.GetRangeDim());
487
488 vshape.SetSize(dof,vdim);
489 vec.SetSize(vdim);
490
491 elvect.SetSize(dof);
492 elvect = 0.0;
493
494 const IntegrationRule *ir = GetIntegrationRule(el, Tr);
495 if (ir == NULL)
496 {
497 // int intorder = 2*el.GetOrder() - 1; // ok for O(h^{k+1}) conv. in L2
498 int intorder = 2*el.GetOrder();
499 ir = &IntRules.Get(el.GetGeomType(), intorder);
500 }
501
502 for (int i = 0; i < ir->GetNPoints(); i++)
503 {
504 const IntegrationPoint &ip = ir->IntPoint(i);
505
506 Tr.SetIntPoint (&ip);
507 el.CalcVShape(Tr, vshape);
508
509 QF.Eval (vec, Tr, ip);
510 vec *= ip.weight * Tr.Weight();
511 vshape.AddMult (vec, elvect);
512 }
513}
514
516 const FiniteElement &fe, ElementTransformation &Trans, Vector &elvect)
517{
518 MFEM_ASSERT(vec_delta != NULL, "coefficient must be VectorDeltaCoefficient");
519 int dof = fe.GetDof();
520 int spaceDim = Trans.GetSpaceDim();
521
522 vshape.SetSize(dof, spaceDim);
523 fe.CalcPhysVShape(Trans, vshape);
524
525 vec_delta->EvalDelta(vec, Trans, Trans.GetIntPoint());
526
527 elvect.SetSize(dof);
528 vshape.Mult(vec, elvect);
529}
530
532 const FiniteElement &el, ElementTransformation &Tr, Vector &elvect)
533{
534 int dof = el.GetDof();
535 int spaceDim = Tr.GetSpaceDim();
536 int n=(spaceDim == 3)? spaceDim : 1;
537 curlshape.SetSize(dof,n);
538 vec.SetSize(n);
539
540 elvect.SetSize(dof);
541 elvect = 0.0;
542
543 const IntegrationRule *ir = GetIntegrationRule(el, Tr);
544 if (ir == NULL)
545 {
546 int intorder = 2*el.GetOrder();
547 ir = &IntRules.Get(el.GetGeomType(), intorder);
548 }
549
550 for (int i = 0; i < ir->GetNPoints(); i++)
551 {
552 const IntegrationPoint &ip = ir->IntPoint(i);
553
554 Tr.SetIntPoint (&ip);
555 el.CalcPhysCurlShape(Tr, curlshape);
556 QF->Eval(vec, Tr, ip);
557
558 vec *= ip.weight * Tr.Weight();
559 curlshape.AddMult (vec, elvect);
560 }
561}
562
564 const FiniteElement &fe, ElementTransformation &Trans, Vector &elvect)
565{
566 int spaceDim = Trans.GetSpaceDim();
567 MFEM_ASSERT(vec_delta != NULL,
568 "coefficient must be VectorDeltaCoefficient");
569 int dof = fe.GetDof();
570 int n=(spaceDim == 3)? spaceDim : 1;
571 vec.SetSize(n);
572 curlshape.SetSize(dof, n);
573 elvect.SetSize(dof);
574 fe.CalcPhysCurlShape(Trans, curlshape);
575
576 vec_delta->EvalDelta(vec, Trans, Trans.GetIntPoint());
577 curlshape.Mult(vec, elvect);
578}
579
581 const FiniteElement &el, ElementTransformation &Tr, Vector &elvect)
582{
583 int dof = el.GetDof();
584
585 divshape.SetSize(dof); // vector of size dof
586 elvect.SetSize(dof);
587 elvect = 0.0;
588
589 const IntegrationRule *ir = GetIntegrationRule(el, Tr);
590 if (ir == NULL)
591 {
592 int intorder = 2 * el.GetOrder();
593 ir = &IntRules.Get(el.GetGeomType(), intorder);
594 }
595
596 for (int i = 0; i < ir->GetNPoints(); i++)
597 {
598 const IntegrationPoint &ip = ir->IntPoint(i);
599
600 Tr.SetIntPoint (&ip);
601 real_t val = Tr.Weight() * Q.Eval(Tr, ip);
602 el.CalcPhysDivShape(Tr, divshape);
603
604 add(elvect, ip.weight * val, divshape, elvect);
605 }
606}
607
609 const FiniteElement &fe, ElementTransformation &Trans, Vector &elvect)
610{
611 MFEM_ASSERT(delta != NULL, "coefficient must be DeltaCoefficient");
612 elvect.SetSize(fe.GetDof());
613 fe.CalcPhysDivShape(Trans, elvect);
614 elvect *= delta->EvalDelta(Trans, Trans.GetIntPoint());
615}
616
618 const FiniteElement &el, ElementTransformation &Tr, Vector &elvect)
619{
620 int dim = el.GetDim()+1;
621 int dof = el.GetDof();
622
623 shape.SetSize (dof);
624 nor.SetSize (dim);
625 elvect.SetSize (dim*dof);
626
627 const IntegrationRule *ir = IntRule;
628 if (ir == NULL)
629 {
630 ir = &IntRules.Get(el.GetGeomType(), el.GetOrder() + 1);
631 }
632
633 elvect = 0.0;
634 for (int i = 0; i < ir->GetNPoints(); i++)
635 {
636 const IntegrationPoint &ip = ir->IntPoint(i);
637 Tr.SetIntPoint (&ip);
638 CalcOrtho(Tr.Jacobian(), nor);
639 el.CalcShape (ip, shape);
640 nor *= Sign * ip.weight * F -> Eval (Tr, ip);
641 for (int j = 0; j < dof; j++)
642 for (int k = 0; k < dim; k++)
643 {
644 elvect(dof*k+j) += nor(k) * shape(j);
645 }
646 }
647}
648
649
651 const FiniteElement &el, ElementTransformation &Tr, Vector &elvect)
652{
653 int dof = el.GetDof();
654
655 shape.SetSize(dof);
656 elvect.SetSize(dof);
657 elvect = 0.0;
658
659 const IntegrationRule *ir = IntRule;
660 if (ir == NULL)
661 {
662 int intorder = oa * el.GetOrder() + ob; // <----------
663 ir = &IntRules.Get(el.GetGeomType(), intorder);
664 }
665
666 for (int i = 0; i < ir->GetNPoints(); i++)
667 {
668 const IntegrationPoint &ip = ir->IntPoint(i);
669 el.CalcShape(ip, shape);
670
671 real_t val = ip.weight;
672 if (F)
673 {
674 Tr.SetIntPoint (&ip);
675 val *= F->Eval(Tr, ip);
676 }
677
678 elvect.Add(val, shape);
679 }
680}
681
683 const FiniteElement &el, ElementTransformation &Tr, Vector &elvect)
684{
685 int dim = el.GetDim()+1;
686 int dof = el.GetDof();
687 Vector nor(dim), Fvec(dim);
688
689 shape.SetSize(dof);
690 elvect.SetSize(dof);
691 elvect = 0.0;
692
693 const IntegrationRule *ir = IntRule;
694 if (ir == NULL)
695 {
696 int intorder = 2 * el.GetOrder() + Tr.OrderW(); // <----------
697 ir = &IntRules.Get(el.GetGeomType(), intorder);
698 }
699
700 for (int i = 0; i < ir->GetNPoints(); i++)
701 {
702 const IntegrationPoint &ip = ir->IntPoint(i);
703
704 Tr.SetIntPoint(&ip);
705 CalcOrtho(Tr.Jacobian(), nor);
706 F.Eval(Fvec, Tr, ip);
707 real_t val = ip.weight * (Fvec*nor) / Tr.Weight();
708
709 el.CalcShape(ip, shape);
710
711 elvect.Add(val, shape);
712 }
713}
714
716 const FiniteElement &el, ElementTransformation &Tr, Vector &elvect)
717{
718 int dof = el.GetDof();
719 int dim = el.GetDim();
720 int vdim = el.GetRangeDim();
721 DenseMatrix vshape(dof, vdim);
722 Vector f_loc(3);
723 Vector f_hat(2);
724
725 MFEM_VERIFY(vdim == 2, "VectorFEBoundaryTangentLFIntegrator "
726 "must be called with vector basis functions of dimension 2.");
727
728 elvect.SetSize(dof);
729 elvect = 0.0;
730
731 const IntegrationRule *ir = IntRule;
732 if (ir == NULL)
733 {
734 int intorder = oa * el.GetOrder() + ob; // <----------
735 ir = &IntRules.Get(el.GetGeomType(), intorder);
736 }
737
738 for (int i = 0; i < ir->GetNPoints(); i++)
739 {
740 const IntegrationPoint &ip = ir->IntPoint(i);
741
742 el.CalcVShape(ip, vshape);
743
744 Tr.SetIntPoint(&ip);
745 f.Eval(f_loc, Tr, ip);
746
747 if (dim == 2)
748 {
749 Tr.Jacobian().MultTranspose(f_loc, f_hat);
750 }
751 else if (dim == 1)
752 {
753 const DenseMatrix & J = Tr.Jacobian();
754 f_hat(0) = J(0,0) * f_loc(0) + J(1,0) * f_loc(1);
755 f_hat(1) = f_loc(2);
756 }
757 else
758 {
759 f_hat(0) = f_loc(1);
760 f_hat(1) = f_loc(2);
761 }
762
763 Swap<real_t>(f_hat(0), f_hat(1));
764 f_hat(0) = -f_hat(0);
765 f_hat *= ip.weight;
766
767 vshape.AddMult(f_hat, elvect);
768 }
769}
770
772 const FiniteElement &el, ElementTransformation &Tr, Vector &elvect)
773{
774 mfem_error("BoundaryFlowIntegrator::AssembleRHSElementVect\n"
775 " is not implemented as boundary integrator!\n"
776 " Use LinearForm::AddBdrFaceIntegrator instead of\n"
777 " LinearForm::AddBoundaryIntegrator.");
778}
779
781 const FiniteElement &el, FaceElementTransformations &Tr, Vector &elvect)
782{
783 int dim, ndof, order;
784 real_t un, w, vu_data[3], nor_data[3];
785
786 dim = el.GetDim();
787 ndof = el.GetDof();
788 Vector vu(vu_data, dim), nor(nor_data, dim);
789
790 const IntegrationRule *ir = IntRule;
791 if (ir == NULL)
792 {
793 // Assuming order(u)==order(mesh)
794 order = Tr.Elem1->OrderW() + 2*el.GetOrder();
795 if (el.Space() == FunctionSpace::Pk)
796 {
797 order++;
798 }
799 ir = &IntRules.Get(Tr.GetGeometryType(), order);
800 }
801
802 shape.SetSize(ndof);
803 elvect.SetSize(ndof);
804 elvect = 0.0;
805
806 for (int p = 0; p < ir->GetNPoints(); p++)
807 {
808 const IntegrationPoint &ip = ir->IntPoint(p);
809
810 // Set the integration point in the face and the neighboring element
811 Tr.SetAllIntPoints(&ip);
812
813 // Access the neighboring element's integration point
814 const IntegrationPoint &eip = Tr.GetElement1IntPoint();
815 el.CalcShape(eip, shape);
816
817 // Use Tr.Elem1 transformation for u so that it matches the coefficient
818 // used with the ConvectionIntegrator and/or the DGTraceIntegrator.
819 u->Eval(vu, *Tr.Elem1, eip);
820
821 if (dim == 1)
822 {
823 nor(0) = 2*eip.x - 1.0;
824 }
825 else
826 {
827 CalcOrtho(Tr.Jacobian(), nor);
828 }
829
830 un = vu * nor;
831 w = 0.5*alpha*un - beta*fabs(un);
832 w *= ip.weight*f->Eval(Tr, ip);
833 elvect.Add(w, shape);
834 }
835}
836
838 const FiniteElement &el, ElementTransformation &Tr, Vector &elvect)
839{
840 mfem_error("DGDirichletLFIntegrator::AssembleRHSElementVect");
841}
842
844 const FiniteElement &el, FaceElementTransformations &Tr, Vector &elvect)
845{
846 int dim, ndof;
847 bool kappa_is_nonzero = (kappa != 0.);
848 real_t w;
849
850 dim = el.GetDim();
851 ndof = el.GetDof();
852
853 nor.SetSize(dim);
854 nh.SetSize(dim);
855 ni.SetSize(dim);
857 if (MQ)
858 {
859 mq.SetSize(dim);
860 }
861
862 shape.SetSize(ndof);
863 dshape.SetSize(ndof, dim);
864 dshape_dn.SetSize(ndof);
865
866 elvect.SetSize(ndof);
867 elvect = 0.0;
868
869 const IntegrationRule *ir = IntRule;
870 if (ir == NULL)
871 {
872 // a simple choice for the integration order; is this OK?
873 int order = 2*el.GetOrder();
874 ir = &IntRules.Get(Tr.GetGeometryType(), order);
875 }
876
877 for (int p = 0; p < ir->GetNPoints(); p++)
878 {
879 const IntegrationPoint &ip = ir->IntPoint(p);
880
881 // Set the integration point in the face and the neighboring element
882 Tr.SetAllIntPoints(&ip);
883
884 // Access the neighboring element's integration point
885 const IntegrationPoint &eip = Tr.GetElement1IntPoint();
886
887 if (dim == 1)
888 {
889 nor(0) = 2*eip.x - 1.0;
890 }
891 else
892 {
893 CalcOrtho(Tr.Jacobian(), nor);
894 }
895
896 el.CalcShape(eip, shape);
897 el.CalcDShape(eip, dshape);
898
899 // compute uD through the face transformation
900 w = ip.weight * uD->Eval(Tr, ip) / Tr.Elem1->Weight();
901 if (!MQ)
902 {
903 if (Q)
904 {
905 w *= Q->Eval(*Tr.Elem1, eip);
906 }
907 ni.Set(w, nor);
908 }
909 else
910 {
911 nh.Set(w, nor);
912 MQ->Eval(mq, *Tr.Elem1, eip);
914 }
916 adjJ.Mult(ni, nh);
917
919 elvect.Add(sigma, dshape_dn);
920
921 if (kappa_is_nonzero)
922 {
923 elvect.Add(kappa*(ni*nor), shape);
924 }
925 }
926}
927
929 const FiniteElement &el, ElementTransformation &Tr, Vector &elvect)
930{
931 mfem_error("DGElasticityDirichletLFIntegrator::AssembleRHSElementVect");
932}
933
935 const FiniteElement &el, FaceElementTransformations &Tr, Vector &elvect)
936{
937 MFEM_ASSERT(Tr.Elem2No < 0, "interior boundary is not supported");
938
939#ifdef MFEM_THREAD_SAFE
944 Vector nor;
948#endif
949
950 const int dim = el.GetDim();
951 const int ndofs = el.GetDof();
952 const int nvdofs = dim*ndofs;
953
954 elvect.SetSize(nvdofs);
955 elvect = 0.0;
956
958 shape.SetSize(ndofs);
959 dshape.SetSize(ndofs, dim);
960 dshape_ps.SetSize(ndofs, dim);
961 nor.SetSize(dim);
962 dshape_dn.SetSize(ndofs);
963 dshape_du.SetSize(ndofs);
965
966 const IntegrationRule *ir = IntRule;
967 if (ir == NULL)
968 {
969 const int order = 2*el.GetOrder(); // <-----
970 ir = &IntRules.Get(Tr.GetGeometryType(), order);
971 }
972
973 for (int pi = 0; pi < ir->GetNPoints(); ++pi)
974 {
975 const IntegrationPoint &ip = ir->IntPoint(pi);
976
977 // Set the integration point in the face and the neighboring element
978 Tr.SetAllIntPoints(&ip);
979
980 // Access the neighboring element's integration point
981 const IntegrationPoint &eip = Tr.GetElement1IntPoint();
982
983 // Evaluate the Dirichlet b.c. using the face transformation.
984 uD.Eval(u_dir, Tr, ip);
985
986 el.CalcShape(eip, shape);
987 el.CalcDShape(eip, dshape);
988
991
992 if (dim == 1)
993 {
994 nor(0) = 2*eip.x - 1.0;
995 }
996 else
997 {
998 CalcOrtho(Tr.Jacobian(), nor);
999 }
1000
1001 real_t wL, wM, jcoef;
1002 {
1003 const real_t w = ip.weight / Tr.Elem1->Weight();
1004 wL = w * lambda->Eval(*Tr.Elem1, eip);
1005 wM = w * mu->Eval(*Tr.Elem1, eip);
1006 jcoef = kappa * (wL + 2.0*wM) * (nor*nor);
1009 }
1010
1011 // alpha < uD, (lambda div(v) I + mu (grad(v) + grad(v)^T)) . n > +
1012 // + kappa < h^{-1} (lambda + 2 mu) uD, v >
1013
1014 // i = idof + ndofs * im
1015 // v_phi(i,d) = delta(im,d) phi(idof)
1016 // div(v_phi(i)) = dphi(idof,im)
1017 // (grad(v_phi(i)))(k,l) = delta(im,k) dphi(idof,l)
1018 //
1019 // term 1:
1020 // alpha < uD, lambda div(v_phi(i)) n >
1021 // alpha lambda div(v_phi(i)) (uD.n) =
1022 // alpha lambda dphi(idof,im) (uD.n) --> quadrature -->
1023 // ip.weight/det(J1) alpha lambda (uD.nor) dshape_ps(idof,im) =
1024 // alpha * wL * (u_dir*nor) * dshape_ps(idof,im)
1025 // term 2:
1026 // < alpha uD, mu grad(v_phi(i)).n > =
1027 // alpha mu uD^T grad(v_phi(i)) n =
1028 // alpha mu uD(k) delta(im,k) dphi(idof,l) n(l) =
1029 // alpha mu uD(im) dphi(idof,l) n(l) --> quadrature -->
1030 // ip.weight/det(J1) alpha mu uD(im) dshape_ps(idof,l) nor(l) =
1031 // alpha * wM * u_dir(im) * dshape_dn(idof)
1032 // term 3:
1033 // < alpha uD, mu (grad(v_phi(i)))^T n > =
1034 // alpha mu n^T grad(v_phi(i)) uD =
1035 // alpha mu n(k) delta(im,k) dphi(idof,l) uD(l) =
1036 // alpha mu n(im) dphi(idof,l) uD(l) --> quadrature -->
1037 // ip.weight/det(J1) alpha mu nor(im) dshape_ps(idof,l) uD(l) =
1038 // alpha * wM * nor(im) * dshape_du(idof)
1039 // term j:
1040 // < kappa h^{-1} (lambda + 2 mu) uD, v_phi(i) > =
1041 // kappa/h (lambda + 2 mu) uD(k) v_phi(i,k) =
1042 // kappa/h (lambda + 2 mu) uD(k) delta(im,k) phi(idof) =
1043 // kappa/h (lambda + 2 mu) uD(im) phi(idof) --> quadrature -->
1044 // [ 1/h = |nor|/det(J1) ]
1045 // ip.weight/det(J1) |nor|^2 kappa (lambda + 2 mu) uD(im) phi(idof) =
1046 // jcoef * u_dir(im) * shape(idof)
1047
1048 wM *= alpha;
1049 const real_t t1 = alpha * wL * (u_dir*nor);
1050 for (int im = 0, i = 0; im < dim; ++im)
1051 {
1052 const real_t t2 = wM * u_dir(im);
1053 const real_t t3 = wM * nor(im);
1054 const real_t tj = jcoef * u_dir(im);
1055 for (int idof = 0; idof < ndofs; ++idof, ++i)
1056 {
1057 elvect(i) += (t1*dshape_ps(idof,im) + t2*dshape_dn(idof) +
1058 t3*dshape_du(idof) + tj*shape(idof));
1059 }
1060 }
1061 }
1062}
1063
1064
1065
1067(const FiniteElement &el,
1069 Vector &elvect)
1070{
1071 int n = el.GetDof();
1072 elvect.SetSize(n);
1073 for (int i = 0; i < n; i++)
1074 {
1075 elvect(i) = dist(generator);
1076 }
1077
1078 int iel = Tr.ElementNo;
1079
1080 if (!save_factors || !L[iel])
1081 {
1082 DenseMatrix *M, m;
1083 if (save_factors)
1084 {
1085 L[iel]=new DenseMatrix;
1086 M = L[iel];
1087 }
1088 else
1089 {
1090 M = &m;
1091 }
1092 massinteg.AssembleElementMatrix(el, Tr, *M);
1093 CholeskyFactors chol(M->Data());
1094 chol.Factor(M->Height());
1095 chol.LMult(n,1,elvect.GetData());
1096 }
1097 else
1098 {
1099 CholeskyFactors chol(L[iel]->Data());
1100 chol.LMult(n,1,elvect.GetData());
1101 }
1102}
1103
1104
1106 const FiniteElement &fe, ElementTransformation &Tr, Vector &elvect)
1107{
1108 const IntegrationRule *ir =
1110
1111 const int nqp = ir->GetNPoints();
1112 const int vdim = vqfc.GetVDim();
1113 const int ndofs = fe.GetDof();
1114 Vector shape(ndofs);
1115 Vector temp(vdim);
1116 elvect.SetSize(vdim * ndofs);
1117 elvect = 0.0;
1118 for (int q = 0; q < nqp; q++)
1119 {
1120 const IntegrationPoint &ip = ir->IntPoint(q);
1121 Tr.SetIntPoint(&ip);
1122 const real_t w = Tr.Weight() * ip.weight;
1123 vqfc.Eval(temp, Tr, ip);
1124 fe.CalcShape(ip, shape);
1125 for (int ind = 0; ind < vdim; ind++)
1126 {
1127 for (int nd = 0; nd < ndofs; nd++)
1128 {
1129 elvect(nd + ind * ndofs) += w * shape(nd) * temp(ind);
1130 }
1131 }
1132 }
1133}
1134
1135
1138 Vector &elvect)
1139{
1140 const IntegrationRule *ir =
1142
1143 const int nqp = ir->GetNPoints();
1144 const int ndofs = fe.GetDof();
1145 Vector shape(ndofs);
1146 elvect.SetSize(ndofs);
1147 elvect = 0.0;
1148 for (int q = 0; q < nqp; q++)
1149 {
1150 const IntegrationPoint &ip = ir->IntPoint(q);
1151 Tr.SetIntPoint (&ip);
1152 const real_t w = Tr.Weight() * ip.weight;
1153 real_t temp = qfc.Eval(Tr, ip);
1154 fe.CalcShape(ip, shape);
1155 shape *= (w * temp);
1156 elvect += shape;
1157 }
1158}
1159
1160}
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
Definition lininteg.cpp:771
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
Definition lininteg.cpp:140
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
Definition lininteg.cpp:203
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
Definition lininteg.cpp:242
bool Factor(int m, real_t TOL=0.0) override
Compute the Cholesky factorization of the current matrix.
void LMult(int m, int n, real_t *X) const
Base class Coefficients that optionally depend on space and time. These are used by the BilinearFormI...
virtual real_t Eval(ElementTransformation &T, const IntegrationPoint &ip)=0
Evaluate the coefficient in the element described by T at the point ip.
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
Definition lininteg.cpp:837
MatrixCoefficient * MQ
Definition lininteg.hpp:612
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
Definition lininteg.cpp:928
virtual real_t EvalDelta(ElementTransformation &T, const IntegrationPoint &ip)
The value of the function assuming we are evaluating at the delta center.
Abstract class for integrators that support delta coefficients.
Definition lininteg.hpp:62
VectorDeltaCoefficient * vec_delta
Definition lininteg.hpp:65
DeltaCoefficient * delta
Definition lininteg.hpp:64
Data type dense matrix using column-major storage.
Definition densemat.hpp:24
void Mult(const real_t *x, real_t *y) const
Matrix vector multiplication.
Definition densemat.cpp:108
void MultTranspose(const real_t *x, real_t *y) const
Multiply a vector with the transpose matrix.
Definition densemat.cpp:158
real_t * Data() const
Returns the matrix data array. Warning: this method casts away constness.
Definition densemat.hpp:131
void AddMult(const Vector &x, Vector &y, const real_t a=1.0) const override
y += a * A.x
Definition densemat.cpp:194
void SetSize(int s)
Change the size of the DenseMatrix to s x s.
Definition densemat.hpp:125
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:124
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
Definition lininteg.cpp:92
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
Definition lininteg.cpp:51
DomainLFIntegrator(Coefficient &QF, int a=2, int b=0)
Definition lininteg.cpp:38
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:83
Geometry::Type GetGeometryType() const
Return the Geometry::Type of the reference element.
Definition eltrans.hpp:175
const IntegrationPoint & GetIntPoint()
Get a const reference to the currently set integration point. This will return NULL if no integration...
Definition eltrans.hpp:111
virtual int GetSpaceDim() const =0
Get the dimension of the target (physical) space.
real_t Weight()
Return the weight of the Jacobian matrix of the transformation at the currently set IntegrationPoint....
Definition eltrans.hpp:144
const DenseMatrix & Jacobian()
Return the Jacobian matrix of the transformation at the currently set IntegrationPoint,...
Definition eltrans.hpp:132
virtual int OrderW() const =0
Return the order of the determinant of the Jacobian (weight) of the transformation.
void SetIntPoint(const IntegrationPoint *ip)
Set the integration point ip that weights and Jacobians will be evaluated at.
Definition eltrans.hpp:106
A specialized ElementTransformation class representing a face and its two neighboring elements.
Definition eltrans.hpp:750
ElementTransformation * Elem1
Definition eltrans.hpp:791
const IntegrationPoint & GetElement1IntPoint()
Get a const reference to the integration point in neighboring element 1 corresponding to the currentl...
Definition eltrans.hpp:846
ElementTransformation * Face
Definition eltrans.hpp:792
void SetAllIntPoints(const IntegrationPoint *face_ip)
Set the integration point in the Face and the two neighboring elements, if present.
Definition eltrans.hpp:835
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
virtual void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
Definition fe_base.cpp:50
int GetRangeDim() const
Returns the vector dimension for vector-valued finite elements, which is also the dimension of the in...
Definition fe_base.hpp:387
int GetOrder() const
Returns the order of the finite element. In the case of anisotropic orders, returns the maximum order...
Definition fe_base.hpp:414
void CalcPhysDShape(ElementTransformation &Trans, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in physical space at the poi...
Definition fe_base.cpp:202
int GetDim() const
Returns the reference space dimension for the finite element.
Definition fe_base.hpp:381
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...
Geometry::Type GetGeomType() const
Returns the Geometry::Type of the reference element.
Definition fe_base.hpp:407
int Space() const
Returns the type of FunctionSpace on the element.
Definition fe_base.hpp:424
void CalcPhysDivShape(ElementTransformation &Trans, Vector &divshape) const
Evaluate the divergence of all shape functions of a vector finite element in physical space at the po...
Definition fe_base.cpp:68
void CalcPhysVShape(ElementTransformation &Trans, DenseMatrix &shape) const
Equivalent to the CalcVShape() method with the same arguments.
Definition fe_base.hpp:524
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const =0
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
virtual void CalcPhysCurlShape(ElementTransformation &Trans, DenseMatrix &curl_shape) const
Evaluate the curl of all shape functions of a vector finite element in physical space at the point de...
Definition fe_base.cpp:81
int GetDof() const
Returns the number of degrees of freedom in the finite element.
Definition fe_base.hpp:410
void CalcPhysShape(ElementTransformation &Trans, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in physical space at the point ...
Definition fe_base.cpp:192
@ Pk
Polynomials of order k.
Definition fe_base.hpp:280
Class for integration point with weight.
Definition intrules.hpp:35
Class for an integration rule - an Array of IntegrationPoint.
Definition intrules.hpp:96
int GetNPoints() const
Returns the number of the points in the integration rule.
Definition intrules.hpp:255
IntegrationPoint & IntPoint(int i)
Returns a reference to the i-th integration point.
Definition intrules.hpp:258
const IntegrationRule & Get(int GeomType, int Order)
Returns an integration rule for given GeomType and Order.
const IntegrationRule * GetIntegrationRule() const
Equivalent to GetIntRule, but retained for backward compatibility with applications.
const IntegrationRule * IntRule
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
void AssembleElementMatrix(const FiniteElement &el, ElementTransformation &Trans, DenseMatrix &elmat) override
virtual void Eval(DenseMatrix &K, ElementTransformation &T, const IntegrationPoint &ip)=0
Evaluate the matrix coefficient in the element described by T at the point ip, storing the result in ...
int Height() const
Get the height (size of output) of the Operator. Synonym with NumRows().
Definition operator.hpp:68
real_t Eval(ElementTransformation &T, const IntegrationPoint &ip) override
Evaluate the coefficient in the element described by T at the point ip.
const QuadratureFunction & GetQuadFunction() const
QuadratureSpaceBase * GetSpace()
Get the associated QuadratureSpaceBase object.
Definition qfunction.hpp:94
void AssembleRHSElementVect(const FiniteElement &fe, ElementTransformation &Tr, Vector &elvect) override
const IntegrationRule & GetIntRule(int idx) const
Return the IntegrationRule associated with entity idx.
Definition qspace.hpp:125
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
Definition lininteg.cpp:617
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
Definition lininteg.cpp:396
Base class for vector Coefficients that optionally depend on time and space.
int GetVDim()
Returns dimension of the vector.
virtual void Eval(Vector &V, ElementTransformation &T, const IntegrationPoint &ip)=0
Evaluate the vector coefficient in the element described by T at the point ip, storing the result in ...
virtual void EvalDelta(Vector &V, ElementTransformation &T, const IntegrationPoint &ip)
Return the specified direction vector multiplied by the value returned by DeltaCoefficient::EvalDelta...
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
Definition lininteg.cpp:348
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:390
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:331
VectorDomainLFIntegrator(VectorCoefficient &QF, const IntegrationRule *ir=nullptr)
Constructs a domain integrator with a given VectorCoefficient.
Definition lininteg.cpp:282
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
Definition lininteg.cpp:289
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
Definition lininteg.cpp:650
virtual void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
Definition lininteg.cpp:682
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
Definition lininteg.cpp:715
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:563
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
Definition lininteg.cpp:531
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:608
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
Definition lininteg.cpp:580
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
Definition lininteg.cpp:481
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:515
VectorFEDomainLFIntegrator(VectorCoefficient &F, const IntegrationRule *ir=nullptr)
Definition lininteg.cpp:474
void Eval(Vector &V, ElementTransformation &T, const IntegrationPoint &ip) override
Evaluate the vector coefficient in the element described by T at the point ip, storing the result in ...
const QuadratureFunction & GetQuadFunction() const
void AssembleRHSElementVect(const FiniteElement &fe, ElementTransformation &Tr, Vector &elvect) override
Vector data type.
Definition vector.hpp:82
Vector & Set(const real_t a, const Vector &x)
(*this) = a * x
Definition vector.cpp:341
void SetSize(int s)
Resize the vector to size s.
Definition vector.hpp:633
real_t * GetData() const
Return a pointer to the beginning of the Vector data.
Definition vector.hpp:243
Vector & Add(const real_t a, const Vector &Va)
(*this) += a * Va
Definition vector.cpp:326
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
int dim
Definition ex24.cpp:53
real_t b
Definition lissajous.cpp:42
real_t a
Definition lissajous.cpp:41
void CalcOrtho(const DenseMatrix &J, Vector &n)
void mfem_error(const char *msg)
Definition error.cpp:154
void Mult(const Table &A, const Table &B, Table &C)
C = A * B (as boolean matrices)
Definition table.cpp:505
void MultVWt(const Vector &v, const Vector &w, DenseMatrix &VWt)
void add(const Vector &v1, const Vector &v2, Vector &v)
Definition vector.cpp:414
void Swap(T &a, T &b)
Swap objects of type T. The operation is performed using the most specialized swap function from the ...
Definition array.hpp:767
void CalcAdjugate(const DenseMatrix &a, DenseMatrix &adja)
float real_t
Definition config.hpp:46
IntegrationRules IntRules(0, Quadrature1D::GaussLegendre)
A global object with all integration rules (defined in intrules.cpp)
Definition intrules.hpp:549
real_t p(const Vector &x, real_t t)