https://mooseframework.inl.gov
Loading...
Searching...
No Matches
TestCrackCounter.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
10#include "TestCrackCounter.h"
11#include "XFEM.h"
12
14
17{
20 "Test postprocessor for extracting the crack_tip_origin_direction_map from XFEM.");
21
22 return params;
23}
24
26 : GeneralPostprocessor(parameters), _number_of_cracks(0)
27{
28 FEProblemBase * fe_problem = dynamic_cast<FEProblemBase *>(&_subproblem);
29 if (fe_problem == nullptr)
30 mooseError("Problem casting _subproblem to FEProblemBase in TestCrackCounter");
31 _xfem = MooseSharedNamespace::dynamic_pointer_cast<XFEM>(fe_problem->getXFEM());
32 if (_xfem == nullptr)
33 mooseError("Problem casting to XFEM in TestCrackCounter");
34}
35
36void
41
42void
44{
45 const std::map<const Elem *, std::vector<Point>> & crack_origins_map =
46 _xfem->getCrackTipOriginMap();
47
48 _number_of_cracks = crack_origins_map.size();
49}
50
51Real
registerMooseObject("XFEMTestApp", TestCrackCounter)
std::shared_ptr< XFEMInterface > getXFEM()
static InputParameters validParams()
void addClassDescription(const std::string &doc_string)
void mooseError(Args &&... args) const
virtual void initialize() override
Initialize the number of Cracks.
unsigned int _number_of_cracks
Variable used to write out the number of Cracks.
TestCrackCounter(const InputParameters &parameters)
static InputParameters validParams()
virtual void execute() override
Calculates the number of Cracks.
virtual Real getValue() const override
Get number of Cracks.
std::shared_ptr< XFEM > _xfem
SubProblem & _subproblem