#include <EllipseCutUserObject.h>
|
virtual bool | intersectWithEdge (const Point &p1, const Point &p2, Point &pint) const |
|
bool | isInsideEdge (const Point &p1, const Point &p2, const Point &p) const |
|
Real | getRelativePosition (const Point &p1, const Point &p2, const Point &p) const |
|
|
void | serialize (std::string &serialized_buffer) |
| Methods to pack/unpack the _marked_elems_2d and _marked_elems_3d data into a structure suitable for parallel communication. More...
|
|
void | deserialize (std::vector< std::string > &serialized_buffers) |
|
Definition at line 20 of file EllipseCutUserObject.h.
◆ EllipseCutUserObject()
EllipseCutUserObject::EllipseCutUserObject |
( |
const InputParameters & |
parameters | ) |
|
Definition at line 36 of file EllipseCutUserObject.C.
40 const int cut_data_len = 9;
44 mooseError(
"Length of EllipseCutUserObject cut_data must be 9");
53 if (std::abs(rays.first * rays.second) > 1e-6)
55 "EllipseCutUserObject only works on an elliptic cut. Users should provide two points at "
56 "the long and short axis.");
58 _normal = rays.first.cross(rays.second);
61 std::pair<Real, Real> ray_radii =
62 std::make_pair(std::sqrt(rays.first.norm_sq()), std::sqrt(rays.second.norm_sq()));
65 if (ray_radii.first > ray_radii.second)
◆ cutElementByGeometry() [1/2]
bool GeometricCut3DUserObject::cutElementByGeometry |
( |
const Elem * |
elem, |
|
|
std::vector< Xfem::CutEdge > & |
cut_edges, |
|
|
std::vector< Xfem::CutNode > & |
cut_nodes, |
|
|
Real |
time |
|
) |
| const |
|
overridevirtualinherited |
Check to see whether a specified 2D element should be cut based on geometric conditions.
- Parameters
-
elem | Pointer to the libMesh element to be considered for cutting |
cut_edges | Data structure filled with information about edges to be cut |
cut_nodes | Data structure filled with information about nodes to be cut |
time | Current simulation time |
- Returns
- bool true if element is to be cut
Implements GeometricCutUserObject.
Definition at line 39 of file GeometricCut3DUserObject.C.
44 mooseError(
"Invalid method: must use vector of element faces for 3D mesh cutting");
◆ cutElementByGeometry() [2/2]
bool GeometricCut3DUserObject::cutElementByGeometry |
( |
const Elem * |
elem, |
|
|
std::vector< Xfem::CutFace > & |
cut_faces, |
|
|
Real |
time |
|
) |
| const |
|
overridevirtualinherited |
Check to see whether a specified 3D element should be cut based on geometric conditions.
- Parameters
-
elem | Pointer to the libMesh element to be considered for cutting |
cut_faces | Data structure filled with information about edges to be cut |
time | Current simulation time |
- Returns
- bool true if element is to be cut
Implements GeometricCutUserObject.
Definition at line 49 of file GeometricCut3DUserObject.C.
54 bool cut_elem =
false;
56 for (
unsigned int i = 0; i < elem->n_sides(); ++i)
59 std::unique_ptr<const Elem> curr_side = elem->side_ptr(i);
60 if (curr_side->dim() != 2)
61 mooseError(
"In cutElementByGeometry dimension of side must be 2, but it is ",
63 unsigned int n_edges = curr_side->n_sides();
65 std::vector<unsigned int> cut_edges;
66 std::vector<Real> cut_pos;
68 for (
unsigned int j = 0; j < n_edges; j++)
71 std::unique_ptr<const Elem> curr_edge = curr_side->side_ptr(j);
72 if (curr_edge->type() != EDGE2)
73 mooseError(
"In cutElementByGeometry face edge must be EDGE2, but type is: ",
74 libMesh::Utility::enum_to_string(curr_edge->type()),
75 " base element type is: ",
76 libMesh::Utility::enum_to_string(elem->type()));
77 const Node * node1 = curr_edge->node_ptr(0);
78 const Node * node2 = curr_edge->node_ptr(1);
83 cut_edges.push_back(j);
88 if (cut_edges.size() == 2)
97 cut_faces.push_back(mycut);
◆ cutFragmentByGeometry() [1/2]
bool GeometricCut3DUserObject::cutFragmentByGeometry |
( |
std::vector< std::vector< Point >> & |
frag_edges, |
|
|
std::vector< Xfem::CutEdge > & |
cut_edges, |
|
|
Real |
time |
|
) |
| const |
|
overridevirtualinherited |
Check to see whether a fragment of a 2D element should be cut based on geometric conditions.
- Parameters
-
frag_edges | Data structure defining the current fragment to be considered |
cut_edges | Data structure filled with information about fragment edges to be cut |
time | Current simulation time |
- Returns
- bool true if fragment is to be cut
Implements GeometricCutUserObject.
Definition at line 105 of file GeometricCut3DUserObject.C.
109 mooseError(
"Invalid method: must use vector of element faces for 3D mesh cutting");
◆ cutFragmentByGeometry() [2/2]
bool GeometricCut3DUserObject::cutFragmentByGeometry |
( |
std::vector< std::vector< Point >> & |
frag_faces, |
|
|
std::vector< Xfem::CutFace > & |
cut_faces, |
|
|
Real |
time |
|
) |
| const |
|
overridevirtualinherited |
Check to see whether a fragment of a 3D element should be cut based on geometric conditions.
- Parameters
-
frag_faces | Data structure defining the current fragment to be considered |
cut_faces | Data structure filled with information about fragment faces to be cut |
time | Current simulation time |
- Returns
- bool true if fragment is to be cut
Implements GeometricCutUserObject.
Definition at line 114 of file GeometricCut3DUserObject.C.
119 mooseError(
"cutFragmentByGeometry not yet implemented for 3D mesh cutting");
◆ deserialize()
void GeometricCutUserObject::deserialize |
( |
std::vector< std::string > & |
serialized_buffers | ) |
|
|
protectedinherited |
Definition at line 222 of file GeometricCutUserObject.C.
224 mooseAssert(serialized_buffers.size() == _app.n_processors(),
225 "Unexpected size of serialized_buffers: " << serialized_buffers.size());
228 std::istringstream iss;
231 for (
unsigned int rank = 0; rank < serialized_buffers.size(); ++rank)
234 if (rank == processor_id())
239 iss.str(serialized_buffers[rank]);
242 std::map<unsigned int, std::vector<Xfem::GeomMarkedElemInfo2D>> other_marked_elems_2d;
243 std::map<unsigned int, std::vector<Xfem::GeomMarkedElemInfo3D>> other_marked_elems_3d;
244 dataLoad(iss, other_marked_elems_2d,
this);
245 dataLoad(iss, other_marked_elems_3d,
this);
248 _marked_elems_2d.insert(other_marked_elems_2d.begin(), other_marked_elems_2d.end());
249 _marked_elems_3d.insert(other_marked_elems_3d.begin(), other_marked_elems_3d.end());
Referenced by GeometricCutUserObject::finalize().
◆ execute()
void GeometricCutUserObject::execute |
( |
| ) |
|
|
overridevirtualinherited |
Reimplemented in MovingLineSegmentCutSetUserObject.
Definition at line 67 of file GeometricCutUserObject.C.
69 if (_current_elem->dim() == 2)
71 std::vector<Xfem::CutEdge> elem_cut_edges;
72 std::vector<Xfem::CutNode> elem_cut_nodes;
73 std::vector<Xfem::CutEdge> frag_cut_edges;
74 std::vector<std::vector<Point>> frag_edges;
82 _xfem->getFragmentEdges(_current_elem, EFAElem, frag_edges);
100 else if (_current_elem->dim() == 3)
102 std::vector<Xfem::CutFace> elem_cut_faces;
103 std::vector<Xfem::CutFace> frag_cut_faces;
104 std::vector<std::vector<Point>> frag_faces;
112 _xfem->getFragmentFaces(_current_elem, EFAElem, frag_faces);
Referenced by MovingLineSegmentCutSetUserObject::execute().
◆ finalize()
void GeometricCutUserObject::finalize |
( |
| ) |
|
|
overridevirtualinherited |
◆ getCrackFrontPoints()
const std::vector< Point > EllipseCutUserObject::getCrackFrontPoints |
( |
unsigned int |
| ) |
const |
|
overridevirtual |
◆ getInterfaceID()
unsigned int GeometricCutUserObject::getInterfaceID |
( |
| ) |
const |
|
inlineinherited |
◆ getRelativePosition()
Real GeometricCut3DUserObject::getRelativePosition |
( |
const Point & |
p1, |
|
|
const Point & |
p2, |
|
|
const Point & |
p |
|
) |
| const |
|
protectedinherited |
Definition at line 155 of file GeometricCut3DUserObject.C.
160 Real full_len = (p2 - p1).norm();
161 Real len_p1_p = (p - p1).norm();
162 return len_p1_p / full_len;
◆ initialize()
void GeometricCutUserObject::initialize |
( |
| ) |
|
|
overridevirtualinherited |
◆ intersectWithEdge()
bool GeometricCut3DUserObject::intersectWithEdge |
( |
const Point & |
p1, |
|
|
const Point & |
p2, |
|
|
Point & |
pint |
|
) |
| const |
|
protectedvirtualinherited |
Definition at line 124 of file GeometricCut3DUserObject.C.
126 bool has_intersection =
false;
129 double edge_point1[3] = {p1(0), p1(1), p1(2)};
130 double edge_point2[3] = {p2(0), p2(1), p2(2)};
131 double cut_point[3] = {0.0, 0.0, 0.0};
134 plane_point, plane_normal, edge_point1, edge_point2, cut_point) == 1)
136 Point temp_p(cut_point[0], cut_point[1], cut_point[2]);
140 has_intersection =
true;
143 return has_intersection;
◆ isInsideCutPlane()
bool EllipseCutUserObject::isInsideCutPlane |
( |
Point |
p | ) |
const |
|
overrideprivatevirtual |
◆ isInsideEdge()
bool GeometricCut3DUserObject::isInsideEdge |
( |
const Point & |
p1, |
|
|
const Point & |
p2, |
|
|
const Point & |
p |
|
) |
| const |
|
protectedinherited |
◆ serialize()
void GeometricCutUserObject::serialize |
( |
std::string & |
serialized_buffer | ) |
|
|
protectedinherited |
◆ setInterfaceID()
void GeometricCutUserObject::setInterfaceID |
( |
unsigned int |
interface_id | ) |
|
|
inlineinherited |
◆ shouldHealMesh()
bool GeometricCutUserObject::shouldHealMesh |
( |
| ) |
const |
|
inlineinherited |
Should the elements cut by this cutting object be healed in the current time step?
- Returns
- true if the cut element should be healed
Definition at line 185 of file GeometricCutUserObject.h.
◆ threadJoin()
void GeometricCutUserObject::threadJoin |
( |
const UserObject & |
y | ) |
|
|
overridevirtualinherited |
Definition at line 133 of file GeometricCutUserObject.C.
140 "Element already inserted in map from a different thread");
146 "Element already inserted in map from a different thread");
◆ validParams()
InputParameters CrackFrontPointsProvider::validParams |
( |
| ) |
|
|
staticinherited |
Definition at line 15 of file CrackFrontPointsProvider.C.
18 params.addClassDescription(
"Base class for a class that can provide a set of points along a "
19 "crack front. The virtual functions must be overridden by a derived "
20 "class to provide this functionality.");
◆ _center
Point GeometricCut3DUserObject::_center |
|
protectedinherited |
◆ _cut_data
std::vector<Real> EllipseCutUserObject::_cut_data |
|
protected |
◆ _heal_always
bool GeometricCutUserObject::_heal_always |
|
protectedinherited |
◆ _interface_id
unsigned int GeometricCutUserObject::_interface_id |
|
protectedinherited |
◆ _last_step_initialized
unsigned int GeometricCutUserObject::_last_step_initialized |
|
protectedinherited |
◆ _long_axis
Real EllipseCutUserObject::_long_axis |
|
private |
◆ _marked_elems_2d
◆ _marked_elems_3d
◆ _normal
Point GeometricCut3DUserObject::_normal |
|
protectedinherited |
◆ _short_axis
Real EllipseCutUserObject::_short_axis |
|
private |
◆ _unit_vec1
Point EllipseCutUserObject::_unit_vec1 |
|
private |
◆ _unit_vec2
Point EllipseCutUserObject::_unit_vec2 |
|
private |
◆ _vertices
std::vector<Point> EllipseCutUserObject::_vertices |
|
private |
◆ _xfem
std::shared_ptr<XFEM> GeometricCutUserObject::_xfem |
|
protectedinherited |
The documentation for this class was generated from the following files:
std::vector< Real > _cut_data
void serialize(std::string &serialized_buffer)
Methods to pack/unpack the _marked_elems_2d and _marked_elems_3d data into a structure suitable for p...
virtual bool isFinalCut() const
std::vector< Point > _vertices
Data structure describing geometrically described cut through 2D element.
virtual bool isFinalCut() const
virtual bool intersectWithEdge(const Point &p1, const Point &p2, Point &pint) const
std::shared_ptr< XFEM > _xfem
Pointer to the XFEM controller object.
GeometricCut3DUserObject(const InputParameters ¶meters)
virtual bool isInsideCutPlane(Point p) const =0
bool isInsideEdge(const Point &p1, const Point &p2, const Point &p) const
void deserialize(std::vector< std::string > &serialized_buffers)
std::vector< Real > _position
Fractional distance along the cut edges where the cut is located.
std::vector< CutEdge > _elem_cut_edges
Container for data about all cut edges in this element.
std::vector< CutNode > _elem_cut_nodes
Container for data about all cut nodes in this element.
std::vector< std::vector< Point > > _frag_edges
Container for data about all cut edges in cut fragments in this element.
int plane_normal_line_exp_int_3d(double pp[3], double normal[3], double p1[3], double p2[3], double pint[3])
unsigned int _face_id
ID of the cut face.
std::vector< unsigned int > _face_edge
IDs of all cut faces.
std::map< unsigned int, std::vector< Xfem::GeomMarkedElemInfo3D > > _marked_elems_3d
virtual bool cutFragmentByGeometry(std::vector< std::vector< Point >> &frag_edges, std::vector< Xfem::CutEdge > &cut_edges, Real time) const =0
Check to see whether a fragment of a 2D element should be cut based on geometric conditions.
void dataLoad(std::istream &stream, Xfem::CutFace &cf, void *context)
void dataStore(std::ostream &stream, Xfem::CutFace &cf, void *context)
Data structure describing geometrically described cut through 3D element.
std::vector< CutEdge > _frag_cut_edges
Container for data about all cut fragments in this element.
InputParameters validParams()
unsigned int _interface_id
Associated interface id.
std::map< unsigned int, std::vector< Xfem::GeomMarkedElemInfo2D > > _marked_elems_2d
Containers with information about all 2D and 3D elements marked for cutting by this object.
void normalizePoint(Point &p)
Real getRelativePosition(const Point &p1, const Point &p2, const Point &p) const
bool _heal_always
Heal the mesh.
virtual bool cutElementByGeometry(const Elem *elem, std::vector< Xfem::CutEdge > &cut_edges, std::vector< Xfem::CutNode > &cut_nodes, Real time) const =0
Check to see whether a specified 2D element should be cut based on geometric conditions.
std::vector< std::vector< Point > > _frag_faces
Container for data about all cut faces in cut fragments in this element.
std::vector< CutFace > _frag_cut_faces
Container for data about all faces this element's fragment.
virtual unsigned int numFragments() const
Data structure defining a cut through a face.
std::vector< CutFace > _elem_cut_faces
Container for data about all cut faces in this element.