www.mooseframework.org
PhaseNormalTensor.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 "PhaseNormalTensor.h"
11 
12 registerMooseObject("PhaseFieldApp", PhaseNormalTensor);
13 
16 {
18  params.addClassDescription("Calculate normal tensor of a phase based on gradient");
19  params.addRequiredCoupledVar("phase", "Phase variable");
20  params.addRequiredParam<MaterialPropertyName>("normal_tensor_name", "Name of normal tensor");
21  return params;
22 }
23 
26  _grad_u(coupledGradient("phase")),
27  _normal_tensor(
28  declareProperty<RankTwoTensor>(getParam<MaterialPropertyName>("normal_tensor_name")))
29 {
30 }
31 
32 void
34 {
35  _normal_tensor[_qp].zero();
36 }
37 
38 void
40 {
41  const Real magnitude = _grad_u[_qp].norm();
42 
43  if (magnitude > 0.0)
44  {
45  const RealVectorValue vector = _grad_u[_qp] / magnitude;
47  }
48  else
49  _normal_tensor[_qp].zero();
50 }
void addRequiredParam(const std::string &name, const std::string &doc_string)
static RankTwoTensorTempl< Real > selfOuterProduct(const libMesh::TypeVector< Real > &)
const VariableGradient & _grad_u
MaterialProperty< RankTwoTensor > & _normal_tensor
static InputParameters validParams()
Calculate phase normal tensor based on gradient.
static InputParameters validParams()
registerMooseObject("PhaseFieldApp", PhaseNormalTensor)
PhaseNormalTensor(const InputParameters &parameters)
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
virtual void computeQpProperties()
virtual void initQpStatefulProperties()