https://mooseframework.inl.gov
Sampler1DVector.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 "Sampler1DVector.h"
11 
12 registerMooseObject("ThermalHydraulicsApp", Sampler1DVector);
13 
16 {
18  params.addRequiredParam<unsigned int>("index",
19  "Index of the vector property component to sample");
20  params.addClassDescription("Samples a single component of array material properties at all "
21  "quadrature points in mesh block(s)");
22  return params;
23 }
24 
26  : Sampler1DBase<std::vector<Real>>(parameters), _index(getParam<unsigned int>("index"))
27 {
28 }
29 
30 Real
31 Sampler1DVector::getScalarFromProperty(const std::vector<Real> & property,
32  const Point & /*curr_point*/)
33 {
34  return property[_index];
35 }
void addRequiredParam(const std::string &name, const std::string &doc_string)
This is a base class for sampling material properties for the integration points in all elements in a...
Definition: Sampler1DBase.h:35
This class samples a component of a vector material property in a 1-D mesh.
Sampler1DVector(const InputParameters &parameters)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static InputParameters validParams()
void addClassDescription(const std::string &doc_string)
virtual Real getScalarFromProperty(const std::vector< Real > &property, const Point &curr_point) override
Reduce the material property to a scalar for output.
static InputParameters validParams()
registerMooseObject("ThermalHydraulicsApp", Sampler1DVector)
const unsigned int _index
index of the component of the vector-valued material property
void ErrorVector unsigned int