Skip to content

Commit

Permalink
Merge pull request #24875 from GiudGiud/PR_doco25
Browse files Browse the repository at this point in the history
Another doco PR
  • Loading branch information
GiudGiud authored Jul 5, 2023
2 parents 52fafcd + 54c581e commit b12deee
Show file tree
Hide file tree
Showing 45 changed files with 57 additions and 38 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# PiecewiseLinearFromVectorPostprocessor

!syntax description /Functions/PiecewiseLinearFromVectorPostprocessor

## Description

The `PiecewiseLinearFromVectorPostprocessor` function performs linear interpolations between pairs of data generated by a vector post-processor object. The abscissa ([!param](/Functions/PiecewiseLinearFromVectorPostprocessor/argument_column)) and the ordinate ([!param](/Functions/PiecewiseLinearFromVectorPostprocessor/value_column)) values should correspond to the names of member vectors of the object specified for the [!param](/Functions/PiecewiseLinearFromVectorPostprocessor/vectorpostprocessor_name) parameter. By default, the abscissa values correspond to time, and the data will be interpolated at the actual simulation time-step values. However, it is possible to interpolate over spatial (x, y, or z) coordinates by specifying a direction with the [!param](/Functions/PiecewiseLinearFromVectorPostprocessor/component) parameter, where the inputs, `0`, `1`, and `2`, correspond to the `x`, `y`, and `z` directions, respectively.

## Example Input Syntax

In this example, three `PiecewiseLinearFromVectorPostprocessor`s are created and take data from three distinct
vector postprocessors. All three functions use a [!param](/Functions/PiecewiseLinearFromVectorPostprocessor/component)
parameter, which is set so they are functions of space rather than time (y for first two, x for the last one).

!listing test/tests/functions/piecewise_linear_from_vectorpostprocessor/vector_postprocessor_function.i block=Functions VectorPostprocessors

!syntax parameters /Functions/PiecewiseLinearFromVectorPostprocessor

!syntax inputs /Functions/PiecewiseLinearFromVectorPostprocessor

!syntax children /Functions/PiecewiseLinearFromVectorPostprocessor

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,34 @@ This VectorPostprocessor can be visualized using the
AuxKernel.
Both the IDs:

!media media/vectorpostprocessors/ss_grid.png style=width:32%;margin-left:30px;float:left;
!row!

!media media/vectorpostprocessors/ss_grid.png style=width:32%;float:left;
caption=Refined grid

!media media/vectorpostprocessors/ss_processor_id.png style=width:32%;margin-left:30px;float:left
!media media/vectorpostprocessors/ss_processor_id.png style=width:32%;float:left
caption=Processor id (using [`ProcessorIDAux`](/ProcessorIDAux.md))

!media media/vectorpostprocessors/ss_hardware_id.png style=width:32%;margin-left:30px;float:left
!media media/vectorpostprocessors/ss_hardware_id.png style=width:32%;float:left
caption=Hardware id (i.e. compute node)

!row-end!

and the memory used:

!row!

!media media/vectorpostprocessors/ss_physical_mem.png style=width:32%;margin-left:30px;float:left
!media media/vectorpostprocessors/ss_physical_mem.png style=width:32%;float:left
caption=Physical memory used by rank

!media media/vectorpostprocessors/ss_node_utilization.png style=width:32%;margin-left:30px;float:left
!media media/vectorpostprocessors/ss_node_utilization.png style=width:32%;float:left
caption=Fraction of RAM used by the current simulation on the compute node

!row-end!

!alert note
Due to differences in the data collection method, the memory consumption may be slightly different from
the [PerfGraphOutput.md].

!syntax parameters /VectorPostprocessors/VectorMemoryUsage

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
* Function which provides a piecewise continuous linear interpolation
* of a data set provided as two columns of a VectorPostprocessor.
*/
class VectorPostprocessorFunction : public Function, public VectorPostprocessorInterface
class PiecewiseLinearFromVectorPostprocessor : public Function, public VectorPostprocessorInterface
{
public:
static InputParameters validParams();

VectorPostprocessorFunction(const InputParameters & parameters);
PiecewiseLinearFromVectorPostprocessor(const InputParameters & parameters);

using Function::value;
virtual Real value(Real t, const Point & p) const override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html

#include "VectorPostprocessorFunction.h"
#include "PiecewiseLinearFromVectorPostprocessor.h"

registerMooseObject("MooseApp", VectorPostprocessorFunction);
registerMooseObject("MooseApp", PiecewiseLinearFromVectorPostprocessor);
registerMooseObjectRenamed("MooseApp",
VectorPostprocessorFunction,
"02/03/2024 00:00",
PiecewiseLinearFromVectorPostprocessor);

InputParameters
VectorPostprocessorFunction::validParams()
PiecewiseLinearFromVectorPostprocessor::validParams()
{
InputParameters params = Function::validParams();
params.addRequiredParam<VectorPostprocessorName>(
Expand Down Expand Up @@ -41,7 +45,8 @@ VectorPostprocessorFunction::validParams()
return params;
}

VectorPostprocessorFunction::VectorPostprocessorFunction(const InputParameters & parameters)
PiecewiseLinearFromVectorPostprocessor::PiecewiseLinearFromVectorPostprocessor(
const InputParameters & parameters)
: Function(parameters),
VectorPostprocessorInterface(this),
_argument_column(getVectorPostprocessorValue("vectorpostprocessor_name",
Expand All @@ -61,25 +66,25 @@ VectorPostprocessorFunction::VectorPostprocessorFunction(const InputParameters &
}
catch (std::domain_error & e)
{
mooseError("In VectorPostprocessorFunction ", _name, ": ", e.what());
mooseError("In PiecewiseLinearFromVectorPostprocessor ", _name, ": ", e.what());
}
}

Real
VectorPostprocessorFunction::value(Real t, const Point & p) const
PiecewiseLinearFromVectorPostprocessor::value(Real t, const Point & p) const
{
return valueInternal(t, p);
}

ADReal
VectorPostprocessorFunction::value(const ADReal & t, const ADPoint & p) const
PiecewiseLinearFromVectorPostprocessor::value(const ADReal & t, const ADPoint & p) const
{
return valueInternal(t, p);
}

template <typename T, typename P>
T
VectorPostprocessorFunction::valueInternal(const T & t, const P & p) const
PiecewiseLinearFromVectorPostprocessor::valueInternal(const T & t, const P & p) const
{
if (_argument_column.empty())
return 0.0;
Expand Down
1 change: 1 addition & 0 deletions modules/doc/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ Extensions:
restart: application_usage/restart_recover.md
samplers: syntax/Samplers/index.md
scalarkernels: syntax/ScalarKernels/index.md
solidproperties: syntax/SolidProperties/index.md
splits: syntax/Preconditioning/index.md
surrogates: syntax/Surrogates/index.md
systems: syntax/Systems/index.md
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ the overall type of property. The overall design of this module is as follows:
of dependent quantities (temperature, porosity, etc.). Different "categories" of
solid properties are grouped together into different userobjects. For example,
common solid properties used in thermal simulations (specific heat, thermal conductivity),
are provided by derived classes of the [ThermalSolidProperties](/userobjects/ThermalSolidProperties.md)
are provided by derived classes of the [ThermalSolidProperties](/solidproperties/ThermalSolidProperties.md)
userobject. Mechanics properties (Youngs modulus, Poisson ratio), would be provided by
a separate "family" of userobjects.
2. *Materials* call these userobject functions to compute the material properties at
Expand All @@ -38,7 +38,7 @@ the overall type of property. The overall design of this module is as follows:
## Thermal properties

Thermal properties (density, specific heat, and thermal conductivity) are computed by
userobjects inheriting from the [ThermalSolidProperties](/userobjects/ThermalSolidProperties.md) base class. This class
userobjects inheriting from the [ThermalSolidProperties](/solidproperties/ThermalSolidProperties.md) base class. This class
defines functions to compute these properties as a function of temperature:

- compute isobaric specific heat - `Real cp_from_T(const Real & T)`
Expand Down Expand Up @@ -157,7 +157,7 @@ to the formulation and overriding the methods that describe the solid properties

For example, suppose new thermal solid properties were desired for granite.
The first step is to create a userobject named `ThermalGraniteProperties` by
inheriting from [ThermalSolidProperties](/userobjects/ThermalSolidProperties.md) and
inheriting from [ThermalSolidProperties](/solidproperties/ThermalSolidProperties.md) and
overriding all methods that you would like to implement.
The header file for your new userobject indicates all methods that will be defined.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[Tests]
design = 'VectorPostprocessorFunction.md'
design = 'PiecewiseLinearFromVectorPostprocessor.md'

[test_spatial_data]
issues = '#8713'
Expand All @@ -8,7 +8,7 @@
input = 'vector_postprocessor_function.i'
exodiff = 'out.e'
superlu = true
requirement = "The VectorPostprocessorFunction shall be capable of linear interpolating data "
requirement = "The system shall be capable of linear interpolating data "
"generated by a VectorPostprocessor object."
[]
[test_time_data]
Expand All @@ -17,7 +17,7 @@
type = CSVDiff
input = vpp_time_interpolation.i
csvdiff = vpp_time_interpolation_out.csv
requirement = "The VectorPostprocessorFunction shall be capable of linear interpolating data "
requirement = "The system shall be capable of linear interpolating data "
"generated by a VPP with respect to time."
[]
[]

0 comments on commit b12deee

Please sign in to comment.