https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
12registerMooseObject("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
30Real
31Sampler1DVector::getScalarFromProperty(const std::vector<Real> & property,
32 const Point & /*curr_point*/)
33{
34 return property[_index];
35}
registerMooseObject("ThermalHydraulicsApp", Sampler1DVector)
void ErrorVector unsigned int
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
This is a base class for sampling material properties for the integration points in all elements in a...
static InputParameters validParams()
This class samples a component of a vector material property in a 1-D mesh.
virtual Real getScalarFromProperty(const std::vector< Real > &property, const Point &curr_point) override
Reduce the material property to a scalar for output.
Sampler1DVector(const InputParameters &parameters)
const unsigned int _index
index of the component of the vector-valued material property
static InputParameters validParams()