19 params.
addClassDescription(
"UserObject to eliminate the existance of singular shape tensor");
43 auto last_elem =
_mesh.
getMesh().active_local_elements_end();
45 unsigned int singularity_count, loop_count = 0;
46 bool should_print =
true;
50 singularity_count = 0;
51 for (
auto elem =
first_elem; elem != last_elem; ++elem)
68 if (singularity_count == 0)
76 if (singularity_count > 0 && should_print)
78 _console << COLOR_MAGENTA <<
" Singular shape tensor detected! Elimination in process ... " 79 << COLOR_DEFAULT << std::endl;
84 if ((loop_count == 1 && singularity_count != 0) || loop_count > 1)
85 _console << COLOR_MAGENTA <<
" Loop: " << loop_count
86 <<
", Singularities: " << singularity_count << COLOR_DEFAULT << std::endl;
90 _console << COLOR_MAGENTA <<
" Elimination done!" << COLOR_DEFAULT << std::endl;
102 bool singular =
false;
105 Real vol_nb, weight_nb, horizon_nd;
107 for (
unsigned int nd = 0; nd <
_nnodes; ++nd)
110 std::vector<dof_id_type> bonds =
116 shape_tensor(2, 2) = 1.0;
118 for (
unsigned int nb = 0; nb < neighbors.size(); ++nb)
124 weight_nb = horizon_nd / origin_vec_nb.
norm();
126 for (
unsigned int k = 0;
k <
_dim; ++
k)
127 for (
unsigned int l = 0; l <
_dim; ++l)
128 shape_tensor(
k, l) += weight_nb * origin_vec_nb(
k) * origin_vec_nb(l) * vol_nb;
131 if (shape_tensor.
det() == 0.)
registerMooseObject("PeridynamicsApp", SingularShapeTensorEliminatorUserObjectPD)
AuxiliarySystem & _aux
Reference to auxiliary system.
auto norm() const -> decltype(std::norm(Real()))
virtual void execute() override
virtual Elem * elemPtr(const dof_id_type i)
MooseMesh & _mesh
Reference to Moose mesh.
NumericVector< Number > & solution()
unsigned int number() const
std::vector< dof_id_type > getNeighbors(dof_id_type node_id)
Function to return neighbor nodes indices for node node_id.
SingularShapeTensorEliminatorUserObjectPD(const InputParameters ¶meters)
UserObject class to eliminate the existance of singular shape tensor due to bond breakage determined ...
const unsigned int _dim
Problem dimension.
static InputParameters validParams()
virtual void finalize() override
OutputData getElementalValue(const Elem *elem, unsigned int idx=0) const
bool converged(const std::vector< std::pair< unsigned int, Real >> &residuals, const std::vector< Real > &abs_tolerances)
Based on the residuals, determine if the iterative process converged or not.
const unsigned int _nnodes
number of nodes for a edge element
PeridynamicsMesh & _pdmesh
Reference to peridynamics mesh.
unsigned int number() const
static InputParameters validParams()
Real getNodeVolume(dof_id_type node_id)
Function to return nodal volume for node node_id.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Point getNodeCoord(dof_id_type node_id)
Function to return coordinates for node node_id.
bool checkShapeTensorSingularity(const Elem *elem)
function to compute and check the singularity of shape tensor of a bond
virtual void set(const numeric_index_type i, const Number value)=0
const ConsoleStream _console
virtual void initialize() override
std::vector< dof_id_type > getBonds(dof_id_type node_id)
Function to return the bond number connected with node node_id.
static const std::string k
MooseVariable * _bond_status_var
Bond status aux variable.
Real getHorizon(dof_id_type node_id)
Function to return horizon size.