MFEM  v4.5.1
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
nonlininteg_vectorconvection_mf.cpp
Go to the documentation of this file.
1 // Copyright (c) 2010-2022, 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 "../general/forall.hpp"
13 #include "nonlininteg.hpp"
15 
16 using namespace std;
17 
18 namespace mfem
19 {
20 void VectorConvectionNLFIntegrator::AssembleMF(const FiniteElementSpace &fes)
21 {
22  MFEM_ASSERT(fes.GetOrdering() == Ordering::byNODES,
23  "PA Only supports Ordering::byNODES!");
24  Mesh *mesh = fes.GetMesh();
25  const FiniteElement &el = *fes.GetFE(0);
26  ElementTransformation &T = *mesh->GetElementTransformation(0);
27  const IntegrationRule *ir = IntRule ? IntRule : &GetRule(el, T);
28  if (DeviceCanUseCeed())
29  {
30  delete ceedOp;
31  const bool mixed = mesh->GetNumGeometries(mesh->Dimension()) > 1 ||
32  fes.IsVariableOrder();
33  if (mixed)
34  {
35  ceedOp = new ceed::MixedMFVectorConvectionNLIntegrator(*this, fes, Q);
36  }
37  else
38  {
39  ceedOp = new ceed::MFVectorConvectionNLFIntegrator(fes, *ir, Q);
40  }
41  return;
42  }
43  MFEM_ABORT("Not yet implemented.");
44 }
45 
46 void VectorConvectionNLFIntegrator::AddMultMF(const Vector &x, Vector &y) const
47 {
48  if (DeviceCanUseCeed())
49  {
50  ceedOp->AddMult(x, y);
51  }
52  else
53  {
54  MFEM_ABORT("Not yet implemented!");
55  }
56 }
57 
58 } // namespace mfem
Abstract class for all finite elements.
Definition: fe_base.hpp:235
Ordering::Type GetOrdering() const
Return the ordering method.
Definition: fespace.hpp:599
Class for an integration rule - an Array of IntegrationPoint.
Definition: intrules.hpp:90
bool IsVariableOrder() const
Returns true if the space contains elements of varying polynomial orders.
Definition: fespace.hpp:463
Mesh * GetMesh() const
Returns the mesh.
Definition: fespace.hpp:441
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
Definition: fespace.hpp:96
bool DeviceCanUseCeed()
Function that determines if a CEED kernel should be used, based on the current mfem::Device configura...
Definition: util.cpp:33
const IntegrationRule & GetRule(const Integrator &integ, const FiniteElement &trial_fe, const FiniteElement &test_fe, ElementTransformation &Trans)
virtual const FiniteElement * GetFE(int i) const
Returns pointer to the FiniteElement in the FiniteElementCollection associated with i'th element in t...
Definition: fespace.cpp:2781
Vector data type.
Definition: vector.hpp:60