www.mooseframework.org
CrystalPlasticityRotationOutAux.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
8 
9 #include <fstream>
10 
11 template <>
12 InputParameters
14 {
15  InputParameters params = validParams<AuxKernel>();
16  params.addClassDescription(
17  "Output updated rotation tensor to a file: Use for stereographic plots");
18  params.addParam<FileName>(
19  "rotout_file_name", "rot.out", "Name of rotation output file: Default rot.out");
20  params.addParam<unsigned int>("output_frequency", 1, "Frequency of Output");
21  return params;
22 }
23 
25  : AuxKernel(parameters),
26  _rotout_file_name(getParam<FileName>("rotout_file_name")),
27  _out_freq(getParam<unsigned int>("output_frequency")),
28  _update_rot(getMaterialProperty<RankTwoTensor>("update_rot"))
29 {
30 }
31 
32 Real
34 {
35  std::ofstream fileout;
36 
37  if (_t_step % _out_freq == 0)
38  {
39  fileout.open(_rotout_file_name.c_str(), std::ofstream::out | std::ofstream::app);
40  fileout << _t_step << ' ' << _dt << ' ' << _JxW[_qp] << ' ' << _update_rot[_qp](0, 0) << ' '
41  << _update_rot[_qp](0, 1) << ' ' << _update_rot[_qp](0, 2) << ' '
42  << _update_rot[_qp](1, 0) << ' ' << _update_rot[_qp](1, 1) << ' '
43  << _update_rot[_qp](1, 2) << ' ' << _update_rot[_qp](2, 0) << ' '
44  << _update_rot[_qp](2, 1) << ' ' << _update_rot[_qp](2, 2) << '\n';
45  }
46 
47  return 0;
48 }
CrystalPlasticityRotationOutAux(const InputParameters &parameters)
const MaterialProperty< RankTwoTensor > & _update_rot
InputParameters validParams< CrystalPlasticityRotationOutAux >()