https://mooseframework.inl.gov
MeshCut2DNucleationBase.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 "ElementUserObject.h"
13 
14 class XFEM;
15 
17 {
18 public:
20 
22 
23  virtual void initialize() override;
24  virtual void execute() override;
25  virtual void threadJoin(const UserObject & y) override;
26  virtual void finalize() override;
32  std::map<unsigned int, std::pair<RealVectorValue, RealVectorValue>> getNucleatedElemsMap() const
33  {
34  return _nucleated_elems;
35  }
41 
42 protected:
48  virtual bool doesElementCrack(std::pair<RealVectorValue, RealVectorValue> & cutterElemNodes) = 0;
49 
50 private:
53  // New cracks can only be nucleated if they are at least this far from another crack
56  std::shared_ptr<XFEM> _xfem;
57  // Boundaries where cracks can nucleate
58  std::vector<BoundaryID> _initiation_boundary_ids;
59  // map with key for element id and value is a pair containing the node points for creating a
60  // nucleated element on the xfem cutter mesh.
61  std::map<unsigned int, std::pair<RealVectorValue, RealVectorValue>> _nucleated_elems;
62 };
virtual void threadJoin(const UserObject &y) override
MeshCut2DNucleationBase(const InputParameters &parameters)
virtual bool doesElementCrack(std::pair< RealVectorValue, RealVectorValue > &cutterElemNodes)=0
Determine whether the current element should be cut by a new crack.
MooseMesh & _mesh
The FE solution mesh.
const std::vector< double > y
This is the XFEM class.
Definition: XFEM.h:107
std::shared_ptr< XFEM > _xfem
shared pointer to XFEM
Real getNucleationRadius() const
Provide getter to MeshCut2DUserObjectBase for member data set in input.
virtual void initialize() override
std::map< unsigned int, std::pair< RealVectorValue, RealVectorValue > > getNucleatedElemsMap() const
Provide getter to MeshCut2DUserObjectBase for a map of nucleated cracks.
std::map< unsigned int, std::pair< RealVectorValue, RealVectorValue > > _nucleated_elems
virtual void finalize() override
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual void execute() override
const InputParameters & parameters() const
static InputParameters validParams()
std::vector< BoundaryID > _initiation_boundary_ids