https://mooseframework.inl.gov
BlockOrientationVectorPostprocessor.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 
11 #include "EulerAngleProvider.h"
12 #include "Assembly.h"
13 
15 
18 {
20  params += SamplerBase::validParams();
21  params.addRequiredParam<UserObjectName>(
22  "euler_angle_provider",
23  "The EulerAngleProvider user object that provides Euler angle values in degrees.");
24  params.addClassDescription("This object outputs the coordinates, block id, and Euler Angles "
25  "(degrees) associated with each element from a EulerAngleProvider.");
26  return params;
27 }
28 
30  const InputParameters & parameters)
31  : ElementVectorPostprocessor(parameters),
32  SamplerBase(parameters, this, _communicator),
33  _euler(getUserObject<EulerAngleProvider>("euler_angle_provider")),
34  _grain_num(_euler.getGrainNum()),
35  _sample(4)
36 {
37  std::vector<std::string> output_variables(4);
38  output_variables[0] = "block_id";
39  output_variables[1] = "euler_angle_0";
40  output_variables[2] = "euler_angle_1";
41  output_variables[3] = "euler_angle_2";
42  SamplerBase::setupVariables(output_variables);
43 }
44 
45 void
47 {
49 }
50 
51 void
53 {
54  auto sid = _current_elem->subdomain_id();
55  _sample[0] = sid;
56 
57  const EulerAngles & angle = _euler.getEulerAngles(sid);
58  _sample[1] = angle.phi1;
59  _sample[2] = angle.Phi;
60  _sample[3] = angle.phi2;
61  SamplerBase::addSample(_current_elem->vertex_average() /* x,y,z coordinates of elem centroid */,
62  _current_elem->id(),
63  _sample);
64 }
65 
66 void
68 {
69  const auto & vpp = static_cast<const BlockOrientationVectorPostprocessor &>(y);
71 }
72 
73 void
75 {
77 }
BlockOrientationVectorPostprocessor(const InputParameters &parameters)
virtual void initialize()
const std::vector< double > y
BlockOrientationVectorPostprocessor is a VectorPostprocessor that outputs the the coordinates...
void addRequiredParam(const std::string &name, const std::string &doc_string)
void setupVariables(const std::vector< std::string > &variable_names)
virtual void threadJoin(const SamplerBase &y)
registerMooseObject("SolidMechanicsTestApp", BlockOrientationVectorPostprocessor)
static InputParameters validParams()
virtual void finalize()
virtual void addSample(const Point &p, const Real &id, const std::vector< Real > &values)
const Elem *const & _current_elem
Euler angle triplet.
Definition: EulerAngles.h:24
virtual const EulerAngles & getEulerAngles(unsigned int i) const
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()
Abstract base class for user objects that implement the Euler Angle provider interface.