https://mooseframework.inl.gov
CohesiveZoneAction.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 "CohesiveZoneActionBase.h"
13 
15 {
16 public:
18  CohesiveZoneAction(const InputParameters & params);
19 
22  virtual void addRelationshipManagers(Moose::RelationshipManagerType input_rm_type) override;
23 
24  void act() override;
25 
26 protected:
27  void actOutputGeneration();
28  void actOutputMatProp();
29 
32 
35 
38 
40  void prepareSaveInInputs(std::vector<AuxVariableName> & /*save_in_names*/,
41  std::string & /*save_in_side*/,
42  const std::vector<AuxVariableName> & /*var_name_master*/,
43  const std::vector<AuxVariableName> & /*var_name_slave*/,
44  const int & /*i*/) const;
45 
48 
49  template <typename T, typename T2>
50  bool setupOutput(std::string out, T table, T2 setup);
51 
53  std::vector<VariableName> _displacements;
54 
56  const unsigned int _ndisp;
57 
59  const bool _use_AD;
60 
62  const std::string _base_name;
63 
65  const std::vector<BoundaryName> _boundary;
66 
68  enum class Strain
69  {
70  Small,
71  Finite
72  } _strain;
73 
75  std::vector<AuxVariableName> _save_in_master;
76  std::vector<AuxVariableName> _diag_save_in_master;
77  std::vector<AuxVariableName> _save_in_slave;
78  std::vector<AuxVariableName> _diag_save_in_slave;
80 
83  std::string _czm_kernel_name;
87 
89  std::vector<std::string> _generate_output;
92 
94  std::set<BoundaryName> _boundary_name_union;
95 
97  std::set<Strain> _strain_formulation_union;
98 
100  const bool _verbose;
101 
103  std::string addBaseName(const std::string & name) const
104  {
105  return _base_name.empty() ? name : _base_name + "_" + name;
106  }
107 };
108 
109 template <typename T, typename T2>
110 bool
111 CohesiveZoneAction::setupOutput(std::string out, T table, T2 setup)
112 {
113  for (const auto & t1 : table)
114  {
115  // find the officially supported properties
116  for (const auto & t2 : t1.second.second)
117  if (t1.first + '_' + t2 == out)
118  {
119  const auto it = _real_vector_cartesian_component_table.find(t2);
121  {
122  setup(it->second, t1.second.first);
123  return true;
124  }
125  else
126  mooseError("Internal error. The permitted vector shortcuts must be keys in the "
127  "'_real_vector_cartesian_component_table'.");
128  }
129 
130  // check for custom properties
131  auto prefix = t1.first + '_';
132  if (out.substr(0, prefix.length()) == prefix)
133  {
134  setup(out.substr(prefix.length()), t1.second.first);
135  return true;
136  }
137  }
138 
139  return false;
140 }
std::vector< AuxVariableName > _diag_save_in_master
std::string _equilibrium_traction_calculator_name
RelationshipManagerType
MultiMooseEnum _material_output_family
void chekMultipleActionParameters()
method checking multiple CohesiveZoneAction block inputs
std::vector< AuxVariableName > _save_in_master
residual debugging
Strain
strain formulation
void addRequiredCZMInterfaceMaterials()
adds the required interface materials based on the selected strain formulation
std::string _disp_jump_provider_name
std::vector< std::string > _generate_output
output materials to generate scalar traction/jump vector quantities
void prepareSaveInInputs(std::vector< AuxVariableName > &, std::string &, const std::vector< AuxVariableName > &, const std::vector< AuxVariableName > &, const int &) const
method to prepare save_in and diag_save_in inputs for the interface kernel
const std::string _base_name
Base name of the material system.
std::vector< AuxVariableName > _diag_save_in_slave
MultiMooseEnum _material_output_order
const bool _verbose
display info
static const std::map< std::string, std::string > _real_vector_cartesian_component_table
table data for output generation
static InputParameters validParams()
const std::string & name() const
void addRequiredCZMInterfaceKernels()
adds the required interfacekernels based on the selected strain formulation
std::vector< VariableName > _displacements
the disaplcements varaible names
const unsigned int _ndisp
number of displacement components
std::set< Strain > _strain_formulation_union
set generated from the combined boundary restrictions of all CohesiveZoneAction action blocks ...
std::string addBaseName(const std::string &name) const
simple method for adding the base name to a variable
std::vector< AuxVariableName > _save_in_slave
virtual void addRelationshipManagers(Moose::RelationshipManagerType input_rm_type) override
OStreamProxy out
void setup(EquationSystems &systems, Mesh &mesh, GetPot &args)
std::set< BoundaryName > _boundary_name_union
set generated from the combined boundary restrictions of all CohesiveZoneAction action blocks ...
void verifyOrderAndFamilyOutputs()
verifies order and family of output variables
void mooseError(Args &&... args) const
CohesiveZoneAction(const InputParameters &params)
std::string _czm_kernel_name
kernel&#39;s and materials&#39;s names
virtual void addRelationshipManagers(Moose::RelationshipManagerType when_type)
const bool _use_AD
whether to use AD kernels and materials
enum CohesiveZoneAction::Strain _strain
const std::vector< BoundaryName > _boundary
Base name of the material system.
bool setupOutput(std::string out, T table, T2 setup)