https://mooseframework.inl.gov
Loading...
Searching...
No Matches
CrackGrowthReporterBase.C
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
13#include "MathUtils.h"
14
17{
19 params.addRequiredParam<UserObjectName>("crackMeshCut3DUserObject_name",
20 "The CrackMeshCut3DUserObject user object name");
22 "max_growth_increment",
23 "max_growth_increment>0",
24 "the max growth size at the crack front in each increment of a fatigue simulation");
25 params.addParam<VectorPostprocessorName>(
26 "ki_vectorpostprocessor", "II_KI_1", "The name of the vectorpostprocessor that contains KI");
27
28 // these flags must must match those used by the InteractionIntegral set in the
29 // DomainIntegralAction
30 ExecFlagEnum & exec = params.set<ExecFlagEnum>("execute_on");
32 params.setDocString("execute_on", exec.getDocString());
33 params.set<ExecFlagEnum>("execute_on") = {EXEC_XFEM_MARK, EXEC_TIMESTEP_END};
34 return params;
35}
36
38 : GeneralReporter(parameters),
39 _cutter_name(getParam<UserObjectName>("crackMeshCut3DUserObject_name")),
40 _3Dcutter(&_fe_problem.getUserObject<CrackMeshCut3DUserObject>(_cutter_name)),
41 _max_growth_increment(getParam<Real>("max_growth_increment")),
42 _ki_vpp(getVectorPostprocessorValue(
43 "ki_vectorpostprocessor", getParam<VectorPostprocessorName>("ki_vectorpostprocessor"))),
44 _ki_x(getVectorPostprocessorValue("ki_vectorpostprocessor", "x")),
45 _ki_y(getVectorPostprocessorValue("ki_vectorpostprocessor", "y")),
46 _ki_z(getVectorPostprocessorValue("ki_vectorpostprocessor", "z")),
47 _ki_id(getVectorPostprocessorValue("ki_vectorpostprocessor", "id")),
48 _x(declareValueByName<std::vector<Real>>("x", REPORTER_MODE_ROOT)),
49 _y(declareValueByName<std::vector<Real>>("y", REPORTER_MODE_ROOT)),
50 _z(declareValueByName<std::vector<Real>>("z", REPORTER_MODE_ROOT)),
51 _id(declareValueByName<std::vector<Real>>("id", REPORTER_MODE_ROOT))
52{
53}
54
55void
57{
59 std::vector<int> index = getCutterMeshIndices();
60 computeGrowth(index);
61}
62
63void
65{
66 _x.resize(_ki_x.size());
67 _y.resize(_ki_y.size());
68 _z.resize(_ki_z.size());
69 _id.resize(_ki_id.size());
70 std::copy(_ki_x.begin(), _ki_x.end(), _x.begin());
71 std::copy(_ki_y.begin(), _ki_y.end(), _y.begin());
72 std::copy(_ki_z.begin(), _ki_z.end(), _z.begin());
73 std::copy(_ki_id.begin(), _ki_id.end(), _id.begin());
74}
75
76std::vector<int>
78{
79 // Generate _active_boundary and _inactive_boundary_pos;
80 // This is a duplicated call before the one in CrackMeshCut3DUserObject;
81 // That one cannot be deleted because this one is for subcritical cracking only
82 // the test still pass so lynn is not sure if this is actually needed but it was
83 // in the original post processor so I'll keep it, even though it is non const.
86}
const ExecFlagType EXEC_TIMESTEP_END
const ReporterMode REPORTER_MODE_ROOT
const ExecFlagType EXEC_XFEM_MARK
Exec flag used to execute MooseObjects while elements are being marked for cutting by XFEM.
const std::vector< Real > & _ki_y
static InputParameters validParams()
virtual void execute() override final
const std::vector< Real > & _ki_x
CrackGrowthReporterBase(const InputParameters &parameters)
std::vector< int > getCutterMeshIndices() const
get indexing from the cutter mesh
CrackMeshCut3DUserObject * _3Dcutter
3D mesh cutter object that provides active nodes
void copyCoordinates() const
copy data into coordinate reporters
const std::vector< Real > & _ki_z
virtual void computeGrowth(std::vector< int > &index)=0
Compute crack growth increment at the specified crack front point and store increments in an internal...
const std::vector< Real > & _ki_id
CrackMeshCut3DUserObject: (1) reads in a mesh describing the crack surface, (2) uses the mesh to do i...
std::vector< int > getFrontPointsIndex() const
Get crack front points in the active segment -1 means inactive; positive is the point's index in the ...
void findActiveBoundaryNodes()
Find all active boundary nodes in the cutter mesh Find boundary nodes that will grow; nodes outside o...
void addAvailableFlags(const ExecFlagType &flag, Args... flags)
static InputParameters validParams()
void addRequiredRangeCheckedParam(const std::string &name, const std::string &parsed_function, const std::string &doc_string)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void setDocString(const std::string &name, const std::string &doc)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
T & set(const std::string &name, bool quiet_mode=false)