www.mooseframework.org
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
CriticalTimeStep Class Reference

#include <CriticalTimeStep.h>

Inheritance diagram for CriticalTimeStep:
[legend]

Public Member Functions

 CriticalTimeStep (const InputParameters &parameters)
 
virtual void initialize () override
 
virtual void execute () override
 
virtual void initialSetup () override
 
virtual void finalize () override
 
virtual Real getValue () override
 
virtual void threadJoin (const UserObject &y) override
 

Static Public Member Functions

static InputParameters validParams ()
 

Protected Member Functions

bool hasGuaranteedMaterialProperty (const MaterialPropertyName &prop, Guarantee guarantee)
 

Protected Attributes

const MaterialProperty< Real > & _material_density
 Density of the material. More...
 
const MaterialProperty< Real > & _effective_stiffness
 Effective stiffness of element: function of material properties and element size. More...
 
const Real & _factor
 User defined factor to be multiplied to the critical time step. More...
 
Real _critical_time
 Critical time step for explicit solver. More...
 

Private Attributes

const InputParameters & _gc_params
 Parameters of the object with this interface. More...
 
FEProblemBase *const _gc_feproblem
 Reference to the FEProblemBase class. More...
 
BlockRestrictable *const _gc_block_restrict
 Access block restrictions of the object with this interface. More...
 

Detailed Description

Definition at line 27 of file CriticalTimeStep.h.

Constructor & Destructor Documentation

◆ CriticalTimeStep()

CriticalTimeStep::CriticalTimeStep ( const InputParameters &  parameters)

Definition at line 29 of file CriticalTimeStep.C.

30  : ElementPostprocessor(parameters),
31  GuaranteeConsumer(this),
32  _material_density(getMaterialPropertyByName<Real>("density")),
33  _effective_stiffness(getMaterialPropertyByName<Real>("effective_stiffness")),
34  _factor(getParam<Real>("factor")),
35  _critical_time(parameters.isParamValid("critical_time"))
36 {
37 }

Member Function Documentation

◆ execute()

void CriticalTimeStep::execute ( )
overridevirtual

Definition at line 54 of file CriticalTimeStep.C.

55 {
56  Real dens = _material_density[0];
57  // In the above line, density is inferred only at the first quadrature point
58  // of each element. Since critical time step is computed across all elements and
59  // a minimum is then taken, this is okay.
61  std::min(_factor * _current_elem->hmin() * std::sqrt(dens) / (_effective_stiffness[0]),
63 }

◆ finalize()

void CriticalTimeStep::finalize ( )
overridevirtual

Definition at line 66 of file CriticalTimeStep.C.

67 {
68  gatherMin(_critical_time);
69 }

◆ getValue()

Real CriticalTimeStep::getValue ( )
overridevirtual

Definition at line 72 of file CriticalTimeStep.C.

73 {
74  return _critical_time;
75 }

◆ hasGuaranteedMaterialProperty()

bool GuaranteeConsumer::hasGuaranteedMaterialProperty ( const MaterialPropertyName &  prop,
Guarantee  guarantee 
)
protectedinherited

Definition at line 28 of file GuaranteeConsumer.C.

30 {
31  if (!_gc_feproblem->startedInitialSetup())
32  mooseError("hasGuaranteedMaterialProperty() needs to be called in initialSetup()");
33 
34  // Reference to MaterialWarehouse for testing and retrieving block ids
35  const auto & warehouse = _gc_feproblem->getMaterialWarehouse();
36 
37  // Complete set of ids that this object is active
38  const auto & ids = (_gc_block_restrict && _gc_block_restrict->blockRestricted())
39  ? _gc_block_restrict->blockIDs()
40  : _gc_feproblem->mesh().meshSubdomains();
41 
42  // Loop over each id for this object
43  for (const auto & id : ids)
44  {
45  // If block materials exist, look if any issue the required guarantee
46  if (warehouse.hasActiveBlockObjects(id))
47  {
48  const std::vector<std::shared_ptr<MaterialBase>> & mats = warehouse.getActiveBlockObjects(id);
49  for (const auto & mat : mats)
50  {
51  const auto & mat_props = mat->getSuppliedItems();
52  if (mat_props.count(prop_name))
53  {
54  auto guarantee_mat = dynamic_cast<GuaranteeProvider *>(mat.get());
55  if (guarantee_mat && !guarantee_mat->hasGuarantee(prop_name, guarantee))
56  {
57  // we found at least one material on the set of block we operate on
58  // that does _not_ provide the requested guarantee
59  return false;
60  }
61  }
62  }
63  }
64  }
65 
66  return true;
67 }

Referenced by ComputeFiniteStrainElasticStress::initialSetup(), ComputeSmearedCrackingStress::initialSetup(), ComputeLinearElasticPFFractureStress::initialSetup(), initialSetup(), and ComputeMultipleInelasticStress::initialSetup().

◆ initialize()

void CriticalTimeStep::initialize ( )
overridevirtual

Definition at line 48 of file CriticalTimeStep.C.

49 {
50  _critical_time = std::numeric_limits<Real>::max();
51 }

◆ initialSetup()

void CriticalTimeStep::initialSetup ( )
overridevirtual

Definition at line 40 of file CriticalTimeStep.C.

41 {
42  if (!hasGuaranteedMaterialProperty("effective_stiffness", Guarantee::ISOTROPIC))
43  paramError("CriticalTimeStep can only be used with elasticity tensor materials "
44  "that guarantee isotropic tensors.");
45 }

◆ threadJoin()

void CriticalTimeStep::threadJoin ( const UserObject &  y)
overridevirtual

Definition at line 78 of file CriticalTimeStep.C.

79 {
80  const CriticalTimeStep & pps = static_cast<const CriticalTimeStep &>(y);
82 }

◆ validParams()

InputParameters CriticalTimeStep::validParams ( )
static

Definition at line 17 of file CriticalTimeStep.C.

18 {
19  InputParameters params = ElementPostprocessor::validParams();
20  params.addClassDescription(
21  "Computes and reports the critical time step for the explicit solver.");
22  params.addParam<MaterialPropertyName>(
23  "density",
24  "Name of Material Property or a constant real number defining the density of the material.");
25  params.addParam<Real>("factor", 1.0, "Factor to mulitply to the critical time step.");
26  return params;
27 }

Member Data Documentation

◆ _critical_time

Real CriticalTimeStep::_critical_time
protected

Critical time step for explicit solver.

Definition at line 53 of file CriticalTimeStep.h.

Referenced by execute(), finalize(), getValue(), initialize(), and threadJoin().

◆ _effective_stiffness

const MaterialProperty<Real>& CriticalTimeStep::_effective_stiffness
protected

Effective stiffness of element: function of material properties and element size.

Definition at line 47 of file CriticalTimeStep.h.

Referenced by execute().

◆ _factor

const Real& CriticalTimeStep::_factor
protected

User defined factor to be multiplied to the critical time step.

Definition at line 50 of file CriticalTimeStep.h.

Referenced by execute().

◆ _gc_block_restrict

BlockRestrictable* const GuaranteeConsumer::_gc_block_restrict
privateinherited

Access block restrictions of the object with this interface.

Definition at line 41 of file GuaranteeConsumer.h.

Referenced by GuaranteeConsumer::hasGuaranteedMaterialProperty().

◆ _gc_feproblem

FEProblemBase* const GuaranteeConsumer::_gc_feproblem
privateinherited

Reference to the FEProblemBase class.

Definition at line 38 of file GuaranteeConsumer.h.

Referenced by GuaranteeConsumer::hasGuaranteedMaterialProperty().

◆ _gc_params

const InputParameters& GuaranteeConsumer::_gc_params
privateinherited

Parameters of the object with this interface.

Definition at line 35 of file GuaranteeConsumer.h.

◆ _material_density

const MaterialProperty<Real>& CriticalTimeStep::_material_density
protected

Density of the material.

Definition at line 44 of file CriticalTimeStep.h.

Referenced by execute().


The documentation for this class was generated from the following files:
GuaranteeConsumer::GuaranteeConsumer
GuaranteeConsumer(MooseObject *moose_object)
Definition: GuaranteeConsumer.C:20
GuaranteeConsumer::_gc_block_restrict
BlockRestrictable *const _gc_block_restrict
Access block restrictions of the object with this interface.
Definition: GuaranteeConsumer.h:41
CriticalTimeStep::_factor
const Real & _factor
User defined factor to be multiplied to the critical time step.
Definition: CriticalTimeStep.h:50
CriticalTimeStep::_critical_time
Real _critical_time
Critical time step for explicit solver.
Definition: CriticalTimeStep.h:53
GuaranteeConsumer::_gc_feproblem
FEProblemBase *const _gc_feproblem
Reference to the FEProblemBase class.
Definition: GuaranteeConsumer.h:38
CriticalTimeStep::_effective_stiffness
const MaterialProperty< Real > & _effective_stiffness
Effective stiffness of element: function of material properties and element size.
Definition: CriticalTimeStep.h:47
validParams
InputParameters validParams()
GuaranteeConsumer::hasGuaranteedMaterialProperty
bool hasGuaranteedMaterialProperty(const MaterialPropertyName &prop, Guarantee guarantee)
Definition: GuaranteeConsumer.C:28
CriticalTimeStep::_material_density
const MaterialProperty< Real > & _material_density
Density of the material.
Definition: CriticalTimeStep.h:44
CriticalTimeStep
Definition: CriticalTimeStep.h:27
Guarantee::ISOTROPIC