#include <XFEMCutElem3D.h>
|
| XFEMCutElem3D (Elem *elem, const EFAElement3D *const CEMelem, unsigned int n_qpoints, unsigned int n_sides) |
| Constructor initializes XFEMCutElem3D object. More...
|
|
| ~XFEMCutElem3D () |
|
virtual void | computePhysicalVolumeFraction () |
| Computes the volume fraction of the element fragment. More...
|
|
virtual void | computePhysicalFaceAreaFraction (unsigned int side) |
| Computes the surface area fraction of the element side. More...
|
|
virtual void | computeMomentFittingWeights () |
|
virtual Point | getCutPlaneOrigin (unsigned int plane_id, MeshBase *displaced_mesh=NULL) const |
|
virtual Point | getCutPlaneNormal (unsigned int plane_id, MeshBase *displaced_mesh=NULL) const |
|
virtual void | getCrackTipOriginAndDirection (unsigned tip_id, Point &origin, Point &direction) const |
|
virtual void | getFragmentFaces (std::vector< std::vector< Point >> &frag_faces, MeshBase *displaced_mesh=NULL) const |
|
virtual const EFAElement * | getEFAElement () const |
|
virtual unsigned int | numCutPlanes () const |
|
virtual void | getIntersectionInfo (unsigned int plane_id, Point &normal, std::vector< Point > &intersectionPoints, MeshBase *displaced_mesh=NULL) const |
|
void | setQuadraturePointsAndWeights (const std::vector< Point > &qp_points, const std::vector< Real > &qp_weights) |
|
Real | getPhysicalVolumeFraction () const |
| Returns the volume fraction of the element fragment. More...
|
|
Real | getPhysicalFaceAreaFraction (unsigned int side) const |
| Returns the surface area fraction of the element side. More...
|
|
Real | getMomentFittingWeight (unsigned int i_qp) const |
|
void | getWeightMultipliers (MooseArray< Real > &weights, QBase *qrule, Xfem::XFEM_QRULE xfem_qrule, const MooseArray< Point > &q_points) |
|
void | getFaceWeightMultipliers (MooseArray< Real > &face_weights, QBase *qrule, Xfem::XFEM_QRULE xfem_qrule, const MooseArray< Point > &q_points, unsigned int side) |
|
void | computeXFEMWeights (QBase *qrule, Xfem::XFEM_QRULE xfem_qrule, const MooseArray< Point > &q_points) |
| Computes integration weights for the cut element. More...
|
|
void | computeXFEMFaceWeights (QBase *qrule, Xfem::XFEM_QRULE xfem_qrule, const MooseArray< Point > &q_points, unsigned int side) |
| Computes face integration weights for the cut element side. More...
|
|
bool | isPointPhysical (const Point &p) const |
|
Definition at line 24 of file XFEMCutElem3D.h.
◆ XFEMCutElem3D()
XFEMCutElem3D::XFEMCutElem3D |
( |
Elem * |
elem, |
|
|
const EFAElement3D *const |
CEMelem, |
|
|
unsigned int |
n_qpoints, |
|
|
unsigned int |
n_sides |
|
) |
| |
◆ ~XFEMCutElem3D()
XFEMCutElem3D::~XFEMCutElem3D |
( |
| ) |
|
◆ computeMomentFittingWeights()
void XFEMCutElem3D::computeMomentFittingWeights |
( |
| ) |
|
|
virtual |
◆ computePhysicalFaceAreaFraction()
void XFEMCutElem3D::computePhysicalFaceAreaFraction |
( |
unsigned int |
side | ) |
|
|
virtual |
Computes the surface area fraction of the element side.
- Parameters
-
side | The side of the element |
find a fragment surface which is covered by element side
Implements XFEMCutElem.
Definition at line 108 of file XFEMCutElem3D.C.
110 Real frag_surf = 0.0;
112 std::vector<std::vector<unsigned int>> frag_face_indices;
113 std::vector<EFANode *> frag_nodes;
115 int face_num = frag_face_indices.size();
118 bool contains_all =
true;
121 for (
int i = 0; i < face_num; ++i)
124 for (
unsigned int j = 0; j < frag_face_indices[i].size(); ++j)
126 EFANode * efa_node = frag_nodes[frag_face_indices[i][j]];
129 contains_all =
false;
136 for (
unsigned int j = 0; j < frag_face_indices[i].size(); ++j)
138 unsigned int m = ((j + 1) == frag_face_indices[i].size()) ? 0 : j + 1;
142 frag_surf += 0.5 * (edge_p1(0) - edge_p2(0)) * (edge_p1(1) + edge_p2(1));
◆ computePhysicalVolumeFraction()
void XFEMCutElem3D::computePhysicalVolumeFraction |
( |
| ) |
|
|
virtual |
Computes the volume fraction of the element fragment.
Implements XFEMCutElem.
Definition at line 63 of file XFEMCutElem3D.C.
68 std::vector<std::vector<unsigned int>> frag_face_indices;
69 std::vector<EFANode *> frag_nodes;
71 int face_num = frag_face_indices.size();
72 int node_num = frag_nodes.size();
75 int * order =
new int[face_num];
76 for (
int i = 0; i < face_num; ++i)
78 if (frag_face_indices[i].size() > (
unsigned int)order_max)
79 order_max = frag_face_indices[i].size();
80 order[i] = frag_face_indices[i].size();
83 double * coord =
new double[3 * node_num];
84 for (
unsigned int i = 0; i < frag_nodes.size(); ++i)
87 coord[3 * i + 0] = p(0);
88 coord[3 * i + 1] = p(1);
89 coord[3 * i + 2] = p(2);
92 int * node =
new int[face_num * order_max];
94 for (
int i = 0; i < face_num; ++i)
95 for (
unsigned int j = 0; j < frag_face_indices[i].size(); ++j)
96 node[order_max * i + j] = frag_face_indices[i][j];
Referenced by XFEMCutElem3D().
◆ computeXFEMFaceWeights()
void XFEMCutElem::computeXFEMFaceWeights |
( |
QBase * |
qrule, |
|
|
Xfem::XFEM_QRULE |
xfem_qrule, |
|
|
const MooseArray< Point > & |
q_points, |
|
|
unsigned int |
side |
|
) |
| |
|
inherited |
Computes face integration weights for the cut element side.
- Parameters
-
qrule | The standard MOOSE face quadrature rule |
xfem_qrule | The integration scheme for the cut element (We use surface area fraction only) |
q_points | The quadrature points for the element side |
side | The side of the element |
Definition at line 90 of file XFEMCutElem.C.
100 for (
unsigned qp = 0; qp < qrule->n_points(); ++qp)
Referenced by XFEMCutElem::getFaceWeightMultipliers().
◆ computeXFEMWeights()
void XFEMCutElem::computeXFEMWeights |
( |
QBase * |
qrule, |
|
|
Xfem::XFEM_QRULE |
xfem_qrule, |
|
|
const MooseArray< Point > & |
q_points |
|
) |
| |
|
inherited |
Computes integration weights for the cut element.
- Parameters
-
qrule | The standard MOOSE quadrature rule |
xfem_qrule | The integration scheme for the cut element |
q_points | The quadrature points for the element |
Definition at line 107 of file XFEMCutElem.C.
121 for (
unsigned qp = 0; qp < qrule->n_points(); ++qp)
143 if (denominator > 0.0)
162 bool nonzero =
false;
163 for (
unsigned qp = 0; qp < qrule->n_points(); ++qp)
179 for (
unsigned qp = 0; qp < qrule->n_points(); ++qp)
185 mooseError(
"Undefined option for XFEM_QRULE");
Referenced by XFEMCutElem::getWeightMultipliers().
◆ getCrackTipOriginAndDirection()
void XFEMCutElem3D::getCrackTipOriginAndDirection |
( |
unsigned |
tip_id, |
|
|
Point & |
origin, |
|
|
Point & |
direction |
|
) |
| const |
|
virtual |
Implements XFEMCutElem.
Definition at line 232 of file XFEMCutElem3D.C.
237 mooseError(
"getCrackTipOriginAndDirection not yet implemented for XFEMCutElem3D");
◆ getCutPlaneNormal()
Point XFEMCutElem3D::getCutPlaneNormal |
( |
unsigned int |
plane_id, |
|
|
MeshBase * |
displaced_mesh = NULL |
|
) |
| const |
|
virtual |
Implements XFEMCutElem.
Definition at line 190 of file XFEMCutElem3D.C.
192 Point normal(0.0, 0.0, 0.0);
193 std::vector<std::vector<EFANode *>> cut_plane_nodes;
199 std::vector<EFANode *> node_line;
200 for (
unsigned int j = 0; j < face->
numNodes(); ++j)
201 node_line.push_back(face->
getNode(j));
202 cut_plane_nodes.push_back(node_line);
205 if (cut_plane_nodes.size() == 0)
206 mooseError(
"no cut plane found in this element");
207 if (plane_id < cut_plane_nodes.size())
209 std::vector<Point> cut_plane_points;
210 for (
unsigned int i = 0; i < cut_plane_nodes[plane_id].size(); ++i)
211 cut_plane_points.push_back(
getNodeCoordinates(cut_plane_nodes[plane_id][i], displaced_mesh));
213 Point center(0.0, 0.0, 0.0);
214 for (
unsigned int i = 0; i < cut_plane_points.size(); ++i)
215 center += cut_plane_points[i];
216 center /= cut_plane_points.size();
218 for (
unsigned int i = 0; i < cut_plane_points.size(); ++i)
220 unsigned int iplus1 = i < cut_plane_points.size() - 1 ? i + 1 : 0;
221 Point ray1 = cut_plane_points[i] - center;
222 Point ray2 = cut_plane_points[iplus1] - center;
223 normal += ray1.cross(ray2);
225 normal /= cut_plane_points.size();
Referenced by getIntersectionInfo().
◆ getCutPlaneOrigin()
Point XFEMCutElem3D::getCutPlaneOrigin |
( |
unsigned int |
plane_id, |
|
|
MeshBase * |
displaced_mesh = NULL |
|
) |
| const |
|
virtual |
Implements XFEMCutElem.
Definition at line 159 of file XFEMCutElem3D.C.
161 Point orig(0.0, 0.0, 0.0);
162 std::vector<std::vector<EFANode *>> cut_plane_nodes;
168 std::vector<EFANode *> node_line;
169 for (
unsigned int j = 0; j < face->
numNodes(); ++j)
170 node_line.push_back(face->
getNode(j));
171 cut_plane_nodes.push_back(node_line);
174 if (cut_plane_nodes.size() == 0)
175 mooseError(
"no cut plane found in this element");
176 if (plane_id < cut_plane_nodes.size())
178 std::vector<Point> cut_plane_points;
179 for (
unsigned int i = 0; i < cut_plane_nodes[plane_id].size(); ++i)
180 cut_plane_points.push_back(
getNodeCoordinates(cut_plane_nodes[plane_id][i], displaced_mesh));
182 for (
unsigned int i = 0; i < cut_plane_points.size(); ++i)
183 orig += cut_plane_points[i];
184 orig /= cut_plane_points.size();
◆ getEFAElement()
const EFAElement * XFEMCutElem3D::getEFAElement |
( |
| ) |
const |
|
virtual |
◆ getFaceWeightMultipliers()
void XFEMCutElem::getFaceWeightMultipliers |
( |
MooseArray< Real > & |
face_weights, |
|
|
QBase * |
qrule, |
|
|
Xfem::XFEM_QRULE |
xfem_qrule, |
|
|
const MooseArray< Point > & |
q_points, |
|
|
unsigned int |
side |
|
) |
| |
|
inherited |
◆ getFragmentFaces()
void XFEMCutElem3D::getFragmentFaces |
( |
std::vector< std::vector< Point >> & |
frag_faces, |
|
|
MeshBase * |
displaced_mesh = NULL |
|
) |
| const |
|
virtual |
Implements XFEMCutElem.
Definition at line 241 of file XFEMCutElem3D.C.
245 mooseError(
"getFragmentFaces not yet implemented for XFEMCutElem3D");
◆ getIntersectionInfo()
void XFEMCutElem3D::getIntersectionInfo |
( |
unsigned int |
plane_id, |
|
|
Point & |
normal, |
|
|
std::vector< Point > & |
intersectionPoints, |
|
|
MeshBase * |
displaced_mesh = NULL |
|
) |
| const |
|
virtual |
Implements XFEMCutElem.
Definition at line 265 of file XFEMCutElem3D.C.
270 intersectionPoints.clear();
271 std::vector<std::vector<EFANode *>> cut_plane_nodes;
277 std::vector<EFANode *> node_line;
278 for (
unsigned int j = 0; j < face->
numNodes(); ++j)
279 node_line.push_back(face->
getNode(j));
280 cut_plane_nodes.push_back(node_line);
283 if (cut_plane_nodes.size() == 0)
284 mooseError(
"No cut plane found in this element");
286 if (plane_id < cut_plane_nodes.size())
288 intersectionPoints.resize(cut_plane_nodes[plane_id].size());
289 for (
unsigned int i = 0; i < cut_plane_nodes[plane_id].size(); ++i)
290 intersectionPoints[i] =
getNodeCoordinates(cut_plane_nodes[plane_id][i], displaced_mesh);
◆ getMomentFittingWeight()
Real XFEMCutElem::getMomentFittingWeight |
( |
unsigned int |
i_qp | ) |
const |
|
inherited |
◆ getNodeCoordinates()
Point XFEMCutElem3D::getNodeCoordinates |
( |
EFANode * |
node, |
|
|
MeshBase * |
displaced_mesh = NULL |
|
) |
| const |
|
privatevirtual |
◆ getPhysicalFaceAreaFraction()
Real XFEMCutElem::getPhysicalFaceAreaFraction |
( |
unsigned int |
side | ) |
const |
|
inherited |
◆ getPhysicalVolumeFraction()
Real XFEMCutElem::getPhysicalVolumeFraction |
( |
| ) |
const |
|
inherited |
◆ getWeightMultipliers()
void XFEMCutElem::getWeightMultipliers |
( |
MooseArray< Real > & |
weights, |
|
|
QBase * |
qrule, |
|
|
Xfem::XFEM_QRULE |
xfem_qrule, |
|
|
const MooseArray< Point > & |
q_points |
|
) |
| |
|
inherited |
◆ isPointPhysical()
bool XFEMCutElem::isPointPhysical |
( |
const Point & |
p | ) |
const |
|
inherited |
◆ numCutPlanes()
unsigned int XFEMCutElem3D::numCutPlanes |
( |
| ) |
const |
|
virtual |
◆ setQuadraturePointsAndWeights()
void XFEMCutElem::setQuadraturePointsAndWeights |
( |
const std::vector< Point > & |
qp_points, |
|
|
const std::vector< Real > & |
qp_weights |
|
) |
| |
|
inherited |
◆ _efa_elem3d
◆ _elem_side_area
std::vector<Real> XFEMCutElem::_elem_side_area |
|
protectedinherited |
◆ _elem_volume
Real XFEMCutElem::_elem_volume |
|
protectedinherited |
◆ _have_face_weights
std::vector<bool> XFEMCutElem::_have_face_weights |
|
protectedinherited |
◆ _have_weights
bool XFEMCutElem::_have_weights |
|
protectedinherited |
◆ _n_nodes
unsigned int XFEMCutElem::_n_nodes |
|
protectedinherited |
◆ _n_qpoints
unsigned int XFEMCutElem::_n_qpoints |
|
protectedinherited |
◆ _n_sides
unsigned int XFEMCutElem::_n_sides |
|
protectedinherited |
◆ _new_face_weights
std::vector<std::vector<Real> > XFEMCutElem::_new_face_weights |
|
protectedinherited |
◆ _new_weights
std::vector<Real> XFEMCutElem::_new_weights |
|
protectedinherited |
◆ _nodes
std::vector<Node *> XFEMCutElem::_nodes |
|
protectedinherited |
◆ _physical_areafrac
std::vector<Real> XFEMCutElem::_physical_areafrac |
|
protectedinherited |
◆ _physical_volfrac
Real XFEMCutElem::_physical_volfrac |
|
protectedinherited |
◆ _qp_points
std::vector<Point> XFEMCutElem::_qp_points |
|
protectedinherited |
◆ _qp_weights
std::vector<Real> XFEMCutElem::_qp_weights |
|
protectedinherited |
The documentation for this class was generated from the following files:
std::vector< Point > _qp_points
unsigned int numFaces() const
EFAFace * getFace(unsigned int face_id) const
double polyhedron_volume_3d(double coord[], int order_max, int face_num, int node[], int node_num, int order[])
EFAFragment3D * getFragment(unsigned int frag_id) const
EFANode * getNode(unsigned int node_id) const
Real getPhysicalVolumeFraction() const
Returns the volume fraction of the element fragment.
std::vector< Real > _elem_side_area
virtual Point getCutPlaneNormal(unsigned int plane_id, MeshBase *displaced_mesh=NULL) const
bool isFaceInterior(unsigned int face_id) const
void i4vec_zero(int n, int a[])
void getNodeInfo(std::vector< std::vector< unsigned int >> &face_node_indices, std::vector< EFANode * > &nodes) const
virtual unsigned int numCutPlanes() const =0
void computeXFEMFaceWeights(QBase *qrule, Xfem::XFEM_QRULE xfem_qrule, const MooseArray< Point > &q_points, unsigned int side)
Computes face integration weights for the cut element side.
bool containsNode(const EFANode *node) const
virtual Point getNodeCoordinates(EFANode *node, MeshBase *displaced_mesh=NULL) const
EFAFace * getFace(unsigned int face_id) const
Real getPhysicalFaceAreaFraction(unsigned int side) const
Returns the surface area fraction of the element side.
virtual void computePhysicalVolumeFraction()
Computes the volume fraction of the element fragment.
virtual void getMasterInfo(EFANode *node, std::vector< EFANode * > &master_nodes, std::vector< double > &master_weights) const
virtual void computePhysicalFaceAreaFraction(unsigned int side)=0
Computes the surface area fraction of the element side.
std::vector< Real > _qp_weights
std::vector< Real > _new_weights
quadrature weights from volume fraction and moment fitting
std::vector< Node * > _nodes
void normalizePoint(Point &p)
std::vector< Real > _physical_areafrac
virtual void computePhysicalVolumeFraction()=0
Computes the volume fraction of the element fragment.
XFEMCutElem(Elem *elem, unsigned int n_qpoints, unsigned int n_sides)
Constructor initializes XFEMCutElem object.
void computeXFEMWeights(QBase *qrule, Xfem::XFEM_QRULE xfem_qrule, const MooseArray< Point > &q_points)
Computes integration weights for the cut element.
bool isPointPhysical(const Point &p) const
unsigned int numNodes() const
virtual void computeMomentFittingWeights()
virtual Point getCutPlaneOrigin(unsigned int plane_id, MeshBase *displaced_mesh=NULL) const =0
virtual Point getCutPlaneNormal(unsigned int plane_id, MeshBase *displaced_mesh=NULL) const =0
virtual void computeMomentFittingWeights()=0
std::vector< bool > _have_face_weights
std::vector< std::vector< Real > > _new_face_weights
face quadrature weights from surface area fraction