https://mooseframework.inl.gov
Loading...
Searching...
No Matches
PhaseNormalTensor.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 "PhaseNormalTensor.h"
11
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
32void
37
38void
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}
registerMooseObject("PhaseFieldApp", PhaseNormalTensor)
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()
Calculate phase normal tensor based on gradient.
virtual void initQpStatefulProperties()
static InputParameters validParams()
MaterialProperty< RankTwoTensor > & _normal_tensor
virtual void computeQpProperties()
PhaseNormalTensor(const InputParameters &parameters)
const VariableGradient & _grad_u
static RankTwoTensorTempl< T > selfOuterProduct(const libMesh::TypeVector< T > &)