Functions | |
void | lineRemoverMoveNode (libMesh::ReplicatedMesh &mesh, const std::vector< Real > &bdry_pars, const subdomain_id_type block_id_to_remove, const std::set< subdomain_id_type > &subdomain_ids_set, const boundary_id_type trimming_section_boundary_id, const boundary_id_type external_boundary_id, const std::vector< boundary_id_type > &other_boundaries_to_conform=std::vector< boundary_id_type >(), const bool assign_ext_to_new=false, const bool side_to_remove=true) |
Removes all the elements on one side of a given line and deforms the elements intercepted by the line to form a flat new boundary. More... | |
bool | lineSideDeterminator (const Real px, const Real py, const Real param_1, const Real param_2, const Real param_3, const bool direction_param, const Real dis_tol=libMesh::TOLERANCE) |
Determines whether a point on XY-plane is on the side of a given line that needs to be removed. More... | |
Point | twoLineIntersection (const Real param_11, const Real param_12, const Real param_13, const Real param_21, const Real param_22, const Real param_23) |
Calculates the intersection Point of two given straight lines. More... | |
Point | twoPointandLineIntersection (const Point &pt1, const Point &pt2, const Real param_1, const Real param_2, const Real param_3) |
Calculates the intersection Point of a straight line defined by two given points and another straight line. More... | |
bool | quasiTriElementsFixer (libMesh::ReplicatedMesh &mesh, const std::set< subdomain_id_type > &subdomain_ids_set, const subdomain_id_type tri_elem_subdomain_shift=Moose::INVALID_BLOCK_ID, const SubdomainName tri_elem_subdomain_name_suffix="tri") |
Fixes degenerate QUAD elements created by the hexagonal mesh trimming by converting them into TRI elements. More... | |
std::vector< std::pair< Real, unsigned int > > | vertex_angles (const Elem &elem) |
Calculates the internal angles of a given 2D element. More... | |
std::vector< std::pair< Real, unsigned int > > | vertex_distances (const Elem &elem) |
Calculates the distances between the vertices of a given 2D element. More... | |
void | triElemSplitter (libMesh::ReplicatedMesh &mesh, const dof_id_type elem_id, const unsigned short node_shift, const dof_id_type nid_3, const dof_id_type nid_4, const subdomain_id_type single_elem_side_id, const subdomain_id_type double_elem_side_id) |
Split a TRI3 element into three TRI3 elements based on two nodes on the two sides of the triangle. More... | |
void | triElemSplitter (libMesh::ReplicatedMesh &mesh, const dof_id_type elem_id, const unsigned short node_shift, const dof_id_type nid_m, const subdomain_id_type first_elem_side_id, const subdomain_id_type second_elem_side_id) |
Split a TRI3 element into two TRI3 elements based on one node on one side of the triangle. More... | |
void | quadElemSplitter (libMesh::ReplicatedMesh &mesh, const dof_id_type elem_id, const subdomain_id_type tri_elem_subdomain_shift) |
Split a QUAD4 element into two TRI3 elements. More... | |
void | quadToTriOnLine (libMesh::ReplicatedMesh &mesh, const std::vector< Real > &cut_line_params, const dof_id_type tri_subdomain_id_shift, const SubdomainName tri_elem_subdomain_name_suffix) |
Convert all the QUAD4 elements in the mesh that are crossed by the given line into TRI3 elements. More... | |
void | lineRemoverCutElemTri (libMesh::ReplicatedMesh &mesh, const std::vector< Real > &cut_line_params, const subdomain_id_type block_id_to_remove, const boundary_id_type new_boundary_id) |
Trim the 2D mesh by removing all the elements on one side of the given line. More... | |
void | lineRemoverCutElem (libMesh::ReplicatedMesh &mesh, const std::vector< Real > &cut_line_params, const dof_id_type tri_subdomain_id_shift, const SubdomainName tri_elem_subdomain_name_suffix, const subdomain_id_type block_id_to_remove, const boundary_id_type new_boundary_id, const bool improve_boundary_tri_elems=false) |
Trim the 2D mesh by removing all the elements on one side of the given line. More... | |
void | boundaryTriElemImprover (libMesh::ReplicatedMesh &mesh, const boundary_id_type boundary_to_improve) |
Improve the element quality of the boundary TRI3 elements of the given boundary. More... | |
void | makeImprovedTriElement (libMesh::ReplicatedMesh &mesh, const dof_id_type node_id_0, const dof_id_type node_id_1, const dof_id_type node_id_2, const subdomain_id_type subdomain_id, const std::vector< dof_id_type > &extra_elem_ids, const std::vector< boundary_id_type > &boundary_ids_for_side_1=std::vector< boundary_id_type >(), const std::vector< boundary_id_type > &boundary_ids_for_side_0=std::vector< boundary_id_type >(), const std::vector< boundary_id_type > &boundary_ids_for_side_2=std::vector< boundary_id_type >()) |
Make a TRI3 element with the given node ids and subdomain id with boundary information. More... | |
bool | elemSideLocator (libMesh::ReplicatedMesh &mesh, const dof_id_type elem_id, const dof_id_type node_id_0, const dof_id_type node_id_1, unsigned short &side_id, bool &is_inverse) |
Check if there is a side in an element that contains the given pair of nodes; if yes, also find the side id and the direction of the two nodes in the side. More... | |
Point | twoPointandLineIntersection (const Point &pt1, const Point &pt2, const Real param_1, const Real param_2, const Real param_3) |
std::vector< std::pair< Real, unsigned int > > | vertex_angles (const Elem &elem) |
std::vector< std::pair< Real, unsigned int > > | vertex_distances (const Elem &elem) |
void MooseMeshXYCuttingUtils::boundaryTriElemImprover | ( | libMesh::ReplicatedMesh & | mesh, |
const boundary_id_type | boundary_to_improve | ||
) |
Improve the element quality of the boundary TRI3 elements of the given boundary.
mesh | input mesh with the boundary TRI3 elements that need to be improved |
boundary_to_improve | boundary id of the boundary that needs to be improved |
Definition at line 981 of file MooseMeshXYCuttingUtils.C.
Referenced by lineRemoverCutElem().
bool MooseMeshXYCuttingUtils::elemSideLocator | ( | libMesh::ReplicatedMesh & | mesh, |
const dof_id_type | elem_id, | ||
const dof_id_type | node_id_0, | ||
const dof_id_type | node_id_1, | ||
unsigned short & | side_id, | ||
bool & | is_inverse | ||
) |
Check if there is a side in an element that contains the given pair of nodes; if yes, also find the side id and the direction of the two nodes in the side.
mesh | input mesh with the element that needs to be checked |
elem_id | id of the element that needs to be checked |
node_id_0 | id of the first node of the pair |
node_id_1 | id of the second node of the pair |
side_id | id of the side that contains the pair of nodes |
is_inverse | flag to indicate if the two nodes are in the same direction as the side |
Definition at line 1215 of file MooseMeshXYCuttingUtils.C.
Referenced by boundaryTriElemImprover().
void MooseMeshXYCuttingUtils::lineRemoverCutElem | ( | libMesh::ReplicatedMesh & | mesh, |
const std::vector< Real > & | cut_line_params, | ||
const dof_id_type | tri_subdomain_id_shift, | ||
const SubdomainName | tri_elem_subdomain_name_suffix, | ||
const subdomain_id_type | block_id_to_remove, | ||
const boundary_id_type | new_boundary_id, | ||
const bool | improve_boundary_tri_elems = false |
||
) |
Trim the 2D mesh by removing all the elements on one side of the given line.
Note that the mesh can only contain QUAD4 and TRI3 elements
mesh | input mesh that need to be trimmed |
cut_line_params | parameters of the line that cuts the input mesh |
tri_subdomain_id_shift | subdomain id shift used to define the TRI element subdomains formed due to the trimming |
tri_elem_subdomain_name_suffix | suffix used to name the TRI element subdomains formed due to the trimming |
block_id_to_remove | a temporary subdomain id used to mark the elements that need to be removed |
new_boundary_id | boundary id of the new boundary that forms due to the trimming |
improve_boundary_tri_elems | flag to indicate whether the boundary TRI3 elements need to be improved |
Definition at line 962 of file MooseMeshXYCuttingUtils.C.
Referenced by XYMeshLineCutter::generate().
void MooseMeshXYCuttingUtils::lineRemoverCutElemTri | ( | libMesh::ReplicatedMesh & | mesh, |
const std::vector< Real > & | cut_line_params, | ||
const subdomain_id_type | block_id_to_remove, | ||
const boundary_id_type | new_boundary_id | ||
) |
Trim the 2D mesh by removing all the elements on one side of the given line.
Note that the mesh needs to be pre-processed so that only TRI3 are crossed by the given line
mesh | input mesh that need to be trimmed |
cut_line_params | parameters of the line that cuts the input mesh |
block_id_to_remove | a temporary subdomain id used to mark the elements that need to be removed |
new_boundary_id | boundary id of the new boundary that forms due to the trimming |
Definition at line 755 of file MooseMeshXYCuttingUtils.C.
Referenced by lineRemoverCutElem().
void MooseMeshXYCuttingUtils::lineRemoverMoveNode | ( | libMesh::ReplicatedMesh & | mesh, |
const std::vector< Real > & | bdry_pars, | ||
const subdomain_id_type | block_id_to_remove, | ||
const std::set< subdomain_id_type > & | subdomain_ids_set, | ||
const boundary_id_type | trimming_section_boundary_id, | ||
const boundary_id_type | external_boundary_id, | ||
const std::vector< boundary_id_type > & | other_boundaries_to_conform = std::vector<boundary_id_type>() , |
||
const bool | assign_ext_to_new = false , |
||
const bool | side_to_remove = true |
||
) |
Removes all the elements on one side of a given line and deforms the elements intercepted by the line to form a flat new boundary.
mesh | input mesh to perform line-based elements removing on |
bdry_pars | line parameter sets {a, b, c} as in a*x+b*y+c=0 |
block_id_to_remove | subdomain id used to mark the elements that need to be removed |
subdomain_ids_set | all the subdomain ids in the input mesh |
trimming_section_boundary_id | ID of the new external boundary formed due to trimming |
external_boundary_id | ID of the external boundary of the input mesh |
other_boundaries_to_conform | IDs of the other boundaries that need to be conformed to during nodes moving |
assign_ext_to_new | whether to assign external_boundary_id to the new boundary formed by removal |
side_to_remove | which side of the mesh needs to be removed: true means ax+by+c>0 and false means ax+by+c<0 |
Definition at line 27 of file MooseMeshXYCuttingUtils.C.
Referenced by XYMeshLineCutter::generate().
bool MooseMeshXYCuttingUtils::lineSideDeterminator | ( | const Real | px, |
const Real | py, | ||
const Real | param_1, | ||
const Real | param_2, | ||
const Real | param_3, | ||
const bool | direction_param, | ||
const Real | dis_tol = libMesh::TOLERANCE |
||
) |
Determines whether a point on XY-plane is on the side of a given line that needs to be removed.
px | x coordinate of the point |
py | y coordinate of the point |
param_1 | parameter 1 (a) in line formula a*x+b*y+c=0 |
param_2 | parameter 2 (b) in line formula a*x+b*y+c=0 |
param_3 | parameter 3 (c) in line formula a*x+b*y+c=0 |
direction_param | which side is the side that needs to be removed |
dis_tol | tolerance used in determining side |
Definition at line 264 of file MooseMeshXYCuttingUtils.C.
Referenced by lineRemoverCutElemTri(), lineRemoverMoveNode(), and quadToTriOnLine().
void MooseMeshXYCuttingUtils::makeImprovedTriElement | ( | libMesh::ReplicatedMesh & | mesh, |
const dof_id_type | node_id_0, | ||
const dof_id_type | node_id_1, | ||
const dof_id_type | node_id_2, | ||
const subdomain_id_type | subdomain_id, | ||
const std::vector< dof_id_type > & | extra_elem_ids, | ||
const std::vector< boundary_id_type > & | boundary_ids_for_side_1 = std::vector<boundary_id_type>() , |
||
const std::vector< boundary_id_type > & | boundary_ids_for_side_0 = std::vector<boundary_id_type>() , |
||
const std::vector< boundary_id_type > & | boundary_ids_for_side_2 = std::vector<boundary_id_type>() |
||
) |
Make a TRI3 element with the given node ids and subdomain id with boundary information.
mesh | input mesh where the TRI3 element needs to be added |
node_id_0 | id of the first node of the TRI3 element |
node_id_1 | id of the second node of the TRI3 element |
node_id_2 | id of the third node of the TRI3 element |
subdomain_id | subdomain id of the TRI3 element |
extra_elem_ids | extra element ids to be assigned to the TRI3 element |
boundary_ids_for_side_1 | boundary ids of the second side of the TRI3 element |
boundary_ids_for_side_0 | boundary ids of the first side of the TRI3 element |
boundary_ids_for_side_2 | boundary ids of the third side of the TRI3 element |
Definition at line 1185 of file MooseMeshXYCuttingUtils.C.
Referenced by boundaryTriElemImprover().
void MooseMeshXYCuttingUtils::quadElemSplitter | ( | libMesh::ReplicatedMesh & | mesh, |
const dof_id_type | elem_id, | ||
const subdomain_id_type | tri_elem_subdomain_shift | ||
) |
Split a QUAD4 element into two TRI3 elements.
mesh | input mesh with the QUAD4 element that needs to be split |
elem_id | id of the QUAD4 element that needs to be split |
tri_elem_subdomain_shift | subdomain id shift used to define the TRI element subdomains |
Definition at line 601 of file MooseMeshXYCuttingUtils.C.
Referenced by quadToTriOnLine().
void MooseMeshXYCuttingUtils::quadToTriOnLine | ( | libMesh::ReplicatedMesh & | mesh, |
const std::vector< Real > & | cut_line_params, | ||
const dof_id_type | tri_subdomain_id_shift, | ||
const SubdomainName | tri_elem_subdomain_name_suffix | ||
) |
Convert all the QUAD4 elements in the mesh that are crossed by the given line into TRI3 elements.
mesh | input mesh with the QUAD4 elements that need to be converted |
cut_line_params | parameters of the line that cuts the input mesh |
tri_subdomain_id_shift | subdomain id shift used to define the TRI element subdomains generated due to the conversion |
tri_elem_subdomain_name_suffix | suffix used to name the TRI element subdomains generated due to the conversion |
Definition at line 696 of file MooseMeshXYCuttingUtils.C.
Referenced by lineRemoverCutElem().
bool MooseMeshXYCuttingUtils::quasiTriElementsFixer | ( | libMesh::ReplicatedMesh & | mesh, |
const std::set< subdomain_id_type > & | subdomain_ids_set, | ||
const subdomain_id_type | tri_elem_subdomain_shift = Moose::INVALID_BLOCK_ID , |
||
const SubdomainName | tri_elem_subdomain_name_suffix = "tri" |
||
) |
Fixes degenerate QUAD elements created by the hexagonal mesh trimming by converting them into TRI elements.
mesh | input mesh with degenerate QUAD elements that need to be fixed |
subdomain_ids_set | all the subdomain ids in the input mesh |
tri_elem_subdomain_shift | subdomain id shift used to define the TRI element subdomains |
tri_elem_subdomain_name_suffix | suffix used to name the TRI element subdomains |
Definition at line 306 of file MooseMeshXYCuttingUtils.C.
Referenced by XYMeshLineCutter::generate().
void MooseMeshXYCuttingUtils::triElemSplitter | ( | libMesh::ReplicatedMesh & | mesh, |
const dof_id_type | elem_id, | ||
const unsigned short | node_shift, | ||
const dof_id_type | nid_3, | ||
const dof_id_type | nid_4, | ||
const subdomain_id_type | single_elem_side_id, | ||
const subdomain_id_type | double_elem_side_id | ||
) |
Split a TRI3 element into three TRI3 elements based on two nodes on the two sides of the triangle.
mesh | input mesh with the TRI3 element that needs to be split |
elem_id | id of the TRI3 element that needs to be split |
node_shift | shift used to rotate the vertices to make sure the vertex that the two cut sides share is the first vertex |
nid_3 | id of the node on the first cut side of the triangle |
nid_4 | id of the node on the second cut side of the triangle |
single_elem_side_id | subdomain id of the single element side |
double_elem_side_id | subdomain id of the double element side |
Definition at line 459 of file MooseMeshXYCuttingUtils.C.
Referenced by lineRemoverCutElemTri().
void MooseMeshXYCuttingUtils::triElemSplitter | ( | libMesh::ReplicatedMesh & | mesh, |
const dof_id_type | elem_id, | ||
const unsigned short | node_shift, | ||
const dof_id_type | nid_m, | ||
const subdomain_id_type | first_elem_side_id, | ||
const subdomain_id_type | second_elem_side_id | ||
) |
Split a TRI3 element into two TRI3 elements based on one node on one side of the triangle.
mesh | input mesh with the TRI3 element that needs to be split |
elem_id | id of the TRI3 element that needs to be split |
node_shift | shift used to rotate the vertices to make sure the vertex corresponding to the cut side is the first vertex |
nid_m | id of the node on the cut side of the triangle |
first_elem_side_id | subdomain id of the first element side |
second_elem_side_id | subdomain id of the second element side |
Definition at line 539 of file MooseMeshXYCuttingUtils.C.
Point MooseMeshXYCuttingUtils::twoLineIntersection | ( | const Real | param_11, |
const Real | param_12, | ||
const Real | param_13, | ||
const Real | param_21, | ||
const Real | param_22, | ||
const Real | param_23 | ||
) |
Calculates the intersection Point of two given straight lines.
param_11 | parameter 1 (a) in line formula a*x+b*y+c=0 for the first line |
param_12 | parameter 2 (b) in line formula a*x+b*y+c=0 for the first line |
param_13 | parameter 3 (c) in line formula a*x+b*y+c=0 for the first line |
param_21 | parameter 1 (a) in line formula a*x+b*y+c=0 for the second line |
param_22 | parameter 2 (b) in line formula a*x+b*y+c=0 for the second line |
param_23 | parameter 3 (c) in line formula a*x+b*y+c=0 for the second line |
Definition at line 277 of file MooseMeshXYCuttingUtils.C.
Referenced by twoPointandLineIntersection().
Point MooseMeshXYCuttingUtils::twoPointandLineIntersection | ( | const Point & | pt1, |
const Point & | pt2, | ||
const Real | param_1, | ||
const Real | param_2, | ||
const Real | param_3 | ||
) |
Calculates the intersection Point of a straight line defined by two given points and another straight line.
pt1 | point 1 that defines the first straight line |
pt2 | point 2 that defines the first straight line |
param_1 | parameter 1 (a) in line formula a*x+b*y+c=0 for the second straight line |
param_2 | parameter 2 (b) in line formula a*x+b*y+c=0 for the second straight line |
param_3 | parameter 3 (c) in line formula a*x+b*y+c=0 for the second straight line |
Point MooseMeshXYCuttingUtils::twoPointandLineIntersection | ( | const Point & | pt1, |
const Point & | pt2, | ||
const Real | param_1, | ||
const Real | param_2, | ||
const Real | param_3 | ||
) |
Definition at line 291 of file MooseMeshXYCuttingUtils.C.
Referenced by lineRemoverCutElemTri(), and lineRemoverMoveNode().
std::vector<std::pair<Real, unsigned int> > MooseMeshXYCuttingUtils::vertex_angles | ( | const Elem & | elem | ) |
Calculates the internal angles of a given 2D element.
elem | the element that needs to be investigated |
std::vector<std::pair<Real, unsigned int> > MooseMeshXYCuttingUtils::vertex_angles | ( | const Elem & | elem | ) |
Definition at line 423 of file MooseMeshXYCuttingUtils.C.
Referenced by quasiTriElementsFixer().
std::vector<std::pair<Real, unsigned int> > MooseMeshXYCuttingUtils::vertex_distances | ( | const Elem & | elem | ) |
Calculates the distances between the vertices of a given 2D element.
elem | the element that needs to be investigated |
std::vector<std::pair<Real, unsigned int> > MooseMeshXYCuttingUtils::vertex_distances | ( | const Elem & | elem | ) |
Definition at line 444 of file MooseMeshXYCuttingUtils.C.
Referenced by quasiTriElementsFixer().