https://mooseframework.inl.gov
Loading...
Searching...
No Matches
CZMRealVectorScalar.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 "CZMRealVectorScalar.h"
12
14
17{
19 params.addClassDescription("Compute the normal or tangent component of a vector quantity defined "
20 "on a cohesive interface.");
21 params.addRequiredParam<std::string>("real_vector_value", "The vector material name");
22 params.addRequiredParam<MaterialPropertyName>(
23 "property_name", "Name of the material property computed by this model");
24 MooseEnum directionType("Normal Tangent");
25 params.addRequiredParam<MooseEnum>("direction", directionType, "the direction: Normal, Tangent");
26 params.addParam<std::string>("base_name", "Material property base name");
27 return params;
28}
29
31 : InterfaceMaterial(parameters),
32 _base_name(isParamValid("base_name") && !getParam<std::string>("base_name").empty()
33 ? getParam<std::string>("base_name") + "_"
34 : ""),
35 _direction(getParam<MooseEnum>("direction").getEnum<DirectionType>()),
36 _property(declarePropertyByName<Real>(getParam<MaterialPropertyName>("property_name"))),
37 _vector(getMaterialPropertyByName<RealVectorValue>(_base_name +
38 getParam<std::string>("real_vector_value"))),
39 _czm_rotation(getMaterialPropertyByName<RankTwoTensor>(_base_name + "czm_total_rotation"))
40{
41}
42
43void
45{
46 const RealVectorValue normal = _czm_rotation[_qp] * RealVectorValue(1.0, 0.0, 0.0);
47 switch (_direction)
48 {
50 _property[_qp] =
52 break;
54 _property[_qp] =
56 break;
57 default:
58 mooseError("ScalarType type not recognized");
59 break;
60 }
61}
registerMooseObject("SolidMechanicsApp", CZMRealVectorScalar)
This interface material class extract a cartesiona component from a vector materail property defined ...
CZMRealVectorScalar(const InputParameters &parameters)
const MaterialProperty< RankTwoTensor > & _czm_rotation
the material property defining the czm normal
MaterialProperty< Real > & _property
the property created by this material
const MaterialProperty< RealVectorValue > & _vector
the vector material property
static InputParameters validParams()
enum CZMRealVectorScalar::DirectionType _direction
void computeQpProperties() override
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()
unsigned int _qp
void mooseError(Args &&... args) const
GenericRealVectorValue< is_ad > computeTangentComponents(const GenericRealVectorValue< is_ad > &normal, const GenericRealVectorValue< is_ad > &vector)
compute the tangent componets of a vector
GenericRealVectorValue< is_ad > computeNormalComponents(const GenericRealVectorValue< is_ad > &normal, const GenericRealVectorValue< is_ad > &vector)
compute the normal componets of a vector