https://mooseframework.inl.gov
Loading...
Searching...
No Matches
SolutionAux.h
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#pragma once
11
12#include "AuxKernel.h"
14#include <optional>
15
22class SolutionAux : public AuxKernel
23{
24public:
26
28
32 virtual void initialSetup() override;
33
37 virtual void compute() override;
38
39protected:
43 void validateVariable();
44
51 virtual Real computeValue() override;
52
55
57 std::string _var_name;
58
61
63 const std::optional<SolutionUserObjectBase::WeightingType> _weighting_type;
64
66 bool _direct;
67
69 const Real _scale_factor;
70
72 const Real _add_factor;
73};
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
AuxKernel for reading a solution from file.
Definition SolutionAux.h:23
const std::optional< SolutionUserObjectBase::WeightingType > _weighting_type
Policy used when the imported solution is multivalued at the query point.
Definition SolutionAux.h:63
virtual void initialSetup() override
Sets up the variable name for extraction from the SolutionUserObject.
Definition SolutionAux.C:58
void validateVariable()
Validates that the selected imported variable is compatible with this AuxKernel.
Definition SolutionAux.C:95
static InputParameters validParams()
Definition SolutionAux.C:17
bool _variable_is_validated
Whether the imported variable has been validated.
Definition SolutionAux.h:60
const Real _scale_factor
Multiplier for the solution, the a of ax+b.
Definition SolutionAux.h:69
const SolutionUserObjectBase & _solution_object
Reference to the SolutionUserObject storing the solution.
Definition SolutionAux.h:54
virtual Real computeValue() override
Computes a value for a node or element depending on the type of kernel, it also uses the 'direct' fla...
virtual void compute() override
Validates the imported variable once before computing values.
Definition SolutionAux.C:86
bool _direct
Flag for directly grabbing the data based on the dof.
Definition SolutionAux.h:66
std::string _var_name
The variable name of interest.
Definition SolutionAux.h:57
const Real _add_factor
Additional factor added to the solution, the b of ax+b.
Definition SolutionAux.h:72
User object that reads an existing solution from an input file and uses it in the current simulation.