https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
13#include "MooseTypes.h"
14#include "InputParameters.h"
15#include "MooseMesh.h"
16
17class MooseApp;
18class AuxiliarySystem;
20class MaterialData;
21class FEProblemBase;
22
23namespace libMesh
24{
25class MeshBase;
26class QBase;
27} // namespace libMesh
28
35// ------------------------------------------------------------
36// XFEMInterface class definition
38{
39public:
43 explicit XFEMInterface(const InputParameters & params)
44 : ConsoleStreamInterface(*params.getCheckedPointerParam<MooseApp *>(MooseBase::app_param)),
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 {
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
135protected:
137 std::vector<MaterialData *> _material_data;
138 std::vector<MaterialData *> _bnd_material_data;
139
142 MeshBase * _mesh;
143 MeshBase * _displaced_mesh;
144};
A system that holds auxiliary variables.
An inteface for the _console for outputting to the Console object.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
Proxy for accessing MaterialPropertyStorage.
Base class for MOOSE-based applications.
Definition MooseApp.h:110
forward declarations
Definition MooseArray.h:18
Base class for everything in MOOSE with a name and a type.
Definition MooseBase.h:50
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition MooseMesh.h:95
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition MooseMesh.C:3549
Nonlinear system to be solved.
This is the XFEMInterface class.
virtual void initSolution(const std::vector< std::shared_ptr< NonlinearSystemBase > > &nl, AuxiliarySystem &aux)=0
Initialize the solution on newly created nodes.
virtual ~XFEMInterface()
Destructor.
void setDisplacedMesh(MooseMesh *displaced_mesh)
Set the pointer to the displaced mesh that is modified by XFEM.
MeshBase * _displaced_mesh
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.
MooseMesh * _moose_mesh
XFEMInterface(const InputParameters &params)
Constructor.
void setBoundaryMaterialData(const std::vector< MaterialData * > &data)
Set the pointer to the Boundary MaterialData.
std::vector< MaterialData * > _material_data
MeshBase * _mesh
FEProblemBase * _fe_problem
virtual bool updateHeal()=0
Potentially update the mesh by healing previous XFEM cuts.
void setMesh(MooseMesh *mesh)
Set the pointer to the master mesh that is modified by XFEM.
void setMaterialData(const std::vector< MaterialData * > &data)
Set the pointer to the MaterialData.
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.
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.
MooseMesh * _moose_displaced_mesh
std::vector< MaterialData * > _bnd_material_data
MeshBase & mesh
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...