https://mooseframework.inl.gov
NLDiffusionIntegrator.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #ifdef MOOSE_MFEM_ENABLED
11 
12 #include "NLDiffusionIntegrator.h"
13 
14 namespace Moose::MFEM
15 {
17  mfem::Coefficient & dk_du,
18  const mfem::GridFunction * gf,
19  const mfem::IntegrationRule * ir)
20  : _diffusion_integ(k, ir),
21  _grad_trial(gf),
22  _neg_grad_trial(-1, _grad_trial),
23  _neg_dk_du_grad_trial(dk_du, _neg_grad_trial),
24  _weak_div_integ(_neg_dk_du_grad_trial)
25 {
26  _sum.AddIntegrator(&_diffusion_integ);
27  _sum.AddIntegrator(&_weak_div_integ);
28 }
29 
30 void
31 NLDiffusionIntegrator::AssembleElementVector(const mfem::FiniteElement & el,
32  mfem::ElementTransformation & Tr,
33  const mfem::Vector & elfun,
34  mfem::Vector & elvect)
35 {
36  _diffusion_integ.AssembleElementVector(el, Tr, elfun, elvect);
37 }
38 
39 void
40 NLDiffusionIntegrator::AssembleElementGrad(const mfem::FiniteElement & el,
41  mfem::ElementTransformation & Tr,
42  const mfem::Vector & elfun,
43  mfem::DenseMatrix & elmat)
44 {
45  _sum.AssembleElementGrad(el, Tr, elfun, elmat);
46 }
47 }
48 
49 #endif
mfem::DiffusionIntegrator _diffusion_integ
mfem::MixedScalarWeakDivergenceIntegrator _weak_div_integ
virtual void AssembleElementGrad(const mfem::FiniteElement &el, mfem::ElementTransformation &Tr, const mfem::Vector &elfun, mfem::DenseMatrix &elmat) override
virtual void AssembleElementVector(const mfem::FiniteElement &el, mfem::ElementTransformation &Tr, const mfem::Vector &elfun, mfem::Vector &elvect) override
Utilities for converting between vector(s) of libMesh Points and MFEM Vector(s).
NLDiffusionIntegrator(mfem::Coefficient &k, mfem::Coefficient &dk_du, const mfem::GridFunction *gf, const mfem::IntegrationRule *ir=nullptr)