https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
45void
50
51void
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
66void
72
73void
registerMooseObject("SolidMechanicsTestApp", BlockOrientationVectorPostprocessor)
const std::vector< double > y
BlockOrientationVectorPostprocessor is a VectorPostprocessor that outputs the the coordinates,...
BlockOrientationVectorPostprocessor(const InputParameters &parameters)
const Elem *const & _current_elem
static InputParameters validParams()
Abstract base class for user objects that implement the Euler Angle provider interface.
virtual const EulerAngles & getEulerAngles(unsigned int i) const
Euler angle triplet.
Definition EulerAngles.h:25
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
virtual void addSample(const Point &p, const Real &id, const std::vector< Real > &values)
void setupVariables(const std::vector< std::string > &variable_names)
virtual void initialize()
virtual void threadJoin(const SamplerBase &y)
virtual void finalize()
static InputParameters validParams()