https://mooseframework.inl.gov
XFEMInterface.h
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 #pragma once
11 
12 #include "ConsoleStreamInterface.h"
13 #include "MooseTypes.h"
14 #include "InputParameters.h"
15 #include "MooseMesh.h"
16 
17 class MooseApp;
18 class AuxiliarySystem;
20 class MaterialData;
21 class FEProblemBase;
22 
23 namespace libMesh
24 {
25 class MeshBase;
26 class QBase;
27 } // namespace libMesh
28 
35 // ------------------------------------------------------------
36 // XFEMInterface class definition
38 {
39 public:
43  explicit XFEMInterface(const InputParameters & params)
44  : ConsoleStreamInterface(*params.getCheckedPointerParam<MooseApp *>("_moose_app")),
45  _fe_problem(params.getCheckedPointerParam<FEProblemBase *>("_fe_problem_base")),
46  _moose_mesh(nullptr),
47  _moose_displaced_mesh(nullptr),
48  _mesh(nullptr),
49  _displaced_mesh(nullptr)
50  {
51  }
52 
56  virtual ~XFEMInterface() {}
57 
61  void setMesh(MooseMesh * mesh)
62  {
63  _moose_mesh = mesh;
64  _mesh = &mesh->getMesh();
65  }
66 
70  void setDisplacedMesh(MooseMesh * displaced_mesh)
71  {
72  _moose_displaced_mesh = displaced_mesh;
73  _displaced_mesh = &displaced_mesh->getMesh();
74  }
75 
79  void setMaterialData(const std::vector<MaterialData *> & data) { _material_data = data; }
80 
84  void setBoundaryMaterialData(const std::vector<MaterialData *> & data)
85  {
86  _bnd_material_data = data;
87  }
88 
92  virtual bool update(Real time,
93  const std::vector<std::shared_ptr<NonlinearSystemBase>> & nl,
94  AuxiliarySystem & aux) = 0;
95 
99  virtual void initSolution(const std::vector<std::shared_ptr<NonlinearSystemBase>> & nl,
100  AuxiliarySystem & aux) = 0;
101 
110  virtual bool getXFEMWeights(MooseArray<Real> & weights,
111  const Elem * elem,
112  libMesh::QBase * qrule,
113  const MooseArray<Point> & q_points) = 0;
114 
123  virtual bool getXFEMFaceWeights(MooseArray<Real> & weights,
124  const Elem * elem,
125  libMesh::QBase * qrule,
126  const MooseArray<Point> & q_points,
127  unsigned int side) = 0;
128 
133  virtual bool updateHeal() = 0;
134 
135 protected:
137  std::vector<MaterialData *> _material_data;
138  std::vector<MaterialData *> _bnd_material_data;
139 
142  MeshBase * _mesh;
143  MeshBase * _displaced_mesh;
144 };
virtual ~XFEMInterface()
Destructor.
Definition: XFEMInterface.h:56
void setBoundaryMaterialData(const std::vector< MaterialData *> &data)
Set the pointer to the Boundary MaterialData.
Definition: XFEMInterface.h:84
virtual bool update(Real time, const std::vector< std::shared_ptr< NonlinearSystemBase >> &nl, AuxiliarySystem &aux)=0
Method to update the mesh due to modified cut definitions.
void setDisplacedMesh(MooseMesh *displaced_mesh)
Set the pointer to the displaced mesh that is modified by XFEM.
Definition: XFEMInterface.h:70
MeshBase & mesh
Base class for MOOSE-based applications.
Definition: MooseApp.h:96
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
virtual bool getXFEMFaceWeights(MooseArray< Real > &weights, const Elem *elem, libMesh::QBase *qrule, const MooseArray< Point > &q_points, unsigned int side)=0
Get the factors for the face QP weighs for XFEM partial elements.
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
virtual bool getXFEMWeights(MooseArray< Real > &weights, const Elem *elem, libMesh::QBase *qrule, const MooseArray< Point > &q_points)=0
Get the factors for the QP weighs for XFEM partial elements.
FEProblemBase * _fe_problem
std::vector< MaterialData * > _bnd_material_data
MooseMesh * _moose_displaced_mesh
void setMaterialData(const std::vector< MaterialData *> &data)
Set the pointer to the MaterialData.
Definition: XFEMInterface.h:79
Nonlinear system to be solved.
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:3443
std::vector< MaterialData * > _material_data
An inteface for the _console for outputting to the Console object.
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:88
virtual bool updateHeal()=0
Potentially update the mesh by healing previous XFEM cuts.
virtual void initSolution(const std::vector< std::shared_ptr< NonlinearSystemBase >> &nl, AuxiliarySystem &aux)=0
Initialize the solution on newly created nodes.
This is the XFEMInterface class.
Definition: XFEMInterface.h:37
MeshBase * _mesh
void setMesh(MooseMesh *mesh)
Set the pointer to the master mesh that is modified by XFEM.
Definition: XFEMInterface.h:61
MooseMesh * _moose_mesh
MeshBase * _displaced_mesh
XFEMInterface(const InputParameters &params)
Constructor.
Definition: XFEMInterface.h:43
Proxy for accessing MaterialPropertyStorage.
Definition: MaterialData.h:33
A system that holds auxiliary variables.