https://mooseframework.inl.gov
MeshCut2DUserObjectBase.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 "GeometricCutUserObject.h"
22 {
23 public:
25 
27 
28  // initialSetup needs to be called by every derived class
29  virtual void initialSetup() override final;
30 
31  virtual bool cutElementByGeometry(const Elem * elem,
32  std::vector<Xfem::CutEdge> & cut_edges,
33  std::vector<Xfem::CutNode> & cut_nodes) const override;
34  virtual bool cutElementByGeometry(const Elem * elem,
35  std::vector<Xfem::CutFace> & cut_faces) const override;
36  virtual bool cutFragmentByGeometry(std::vector<std::vector<Point>> & frag_edges,
37  std::vector<Xfem::CutEdge> & cut_edges) const override;
38  virtual bool cutFragmentByGeometry(std::vector<std::vector<Point>> & frag_faces,
39  std::vector<Xfem::CutFace> & cut_faces) const override;
40  virtual const std::vector<Point>
41  getCrackFrontPoints(unsigned int num_crack_front_points) const override;
42 
49  virtual const std::vector<RealVectorValue>
50  getCrackPlaneNormals(unsigned int num_crack_front_points) const override;
51 
52  MeshBase & getCutterMesh() const;
53 
54 protected:
57 
59  std::unique_ptr<MeshBase> _cutter_mesh;
60 
63 
66 
75  std::vector<std::pair<dof_id_type, dof_id_type>> _original_and_current_front_node_ids;
76 
78  std::vector<std::pair<dof_id_type, Point>> _active_front_node_growth_vectors;
79 
82 
86  virtual void findActiveBoundaryGrowth() = 0;
87 
93 
95  void growFront();
96 
101 
102 private:
110  std::map<unsigned int, std::pair<RealVectorValue, RealVectorValue>> & nucleated_elems_map,
111  Real nucleationRadius);
119  std::map<unsigned int, std::pair<RealVectorValue, RealVectorValue>> & nucleated_elems_map,
120  Real nucleationRadius);
121 };
virtual bool cutElementByGeometry(const Elem *elem, std::vector< Xfem::CutEdge > &cut_edges, std::vector< Xfem::CutNode > &cut_nodes) const override
static InputParameters validParams()
void findOriginalCrackFrontNodes()
Find the original crack front nodes in the cutter mesh and use to populate _original_and_current_fron...
MeshCut2DUserObjectBase(const InputParameters &parameters)
virtual void findActiveBoundaryGrowth()=0
Find growth direction at each active node
std::unique_ptr< MeshBase > _cutter_mesh
The xfem cutter mesh.
std::vector< std::pair< dof_id_type, dof_id_type > > _original_and_current_front_node_ids
This vector of pairs orders crack tips to make the order used in this class the same as those for the...
virtual bool cutFragmentByGeometry(std::vector< std::vector< Point >> &frag_edges, std::vector< Xfem::CutEdge > &cut_edges) const override
Class used in fracture integrals to define geometric characteristics of the crack front...
MeshCut2DUserObjectBase: (1) reads in a mesh describing the crack surface, (2) Fills xfem cut element...
MooseMesh & _mesh
The FE solution mesh.
void addNucleatedCracksToMesh()
Calls into MeshCutNucleation UO to add cracks.
const MeshCut2DNucleationBase * _nucleate_uo
2D UO for nucleating cracks
virtual void initialSetup() override final
bool _is_mesh_modified
Indicator that shows if the cutting mesh is modified or not in this calculation step.
virtual const std::vector< Point > getCrackFrontPoints(unsigned int num_crack_front_points) const override
get a set of points along a crack front from a XFEM GeometricCutUserObject
const InputParameters & parameters() const
void growFront()
grow the cutter mesh
void removeNucleatedCracksTooCloseToExistingCracks(std::map< unsigned int, std::pair< RealVectorValue, RealVectorValue >> &nucleated_elems_map, Real nucleationRadius)
Remove nucleated cracks that are too close to a pre-existing crack in the mesh.
void removeNucleatedCracksTooCloseToEachOther(std::map< unsigned int, std::pair< RealVectorValue, RealVectorValue >> &nucleated_elems_map, Real nucleationRadius)
Remove nucleated cracks that are too close too each other.
std::vector< std::pair< dof_id_type, Point > > _active_front_node_growth_vectors
contains the active node ids and their growth vectors
virtual const std::vector< RealVectorValue > getCrackPlaneNormals(unsigned int num_crack_front_points) const override
get a set of normal vectors along a crack front from a XFEM GeometricCutUserObject CrackFrontDefiniti...
CrackFrontDefinition * _crack_front_definition
user object for communicating between solid_mechanics interaction integrals and xfem cutter mesh ...