https://mooseframework.inl.gov
Loading...
Searching...
No Matches
SolutionUserObject.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 "SolutionUserObject.h"
11
12// MOOSE includes
13#include "ConsoleUtils.h"
14#include "MooseError.h"
15#include "MooseMesh.h"
16#include "MooseUtils.h"
17#include "MooseVariableFE.h"
18#include "RotationMatrix.h"
19#include "Function.h"
20
21// libMesh includes
22#include "libmesh/equation_systems.h"
23#include "libmesh/mesh_function.h"
24#include "libmesh/numeric_vector.h"
25#include "libmesh/nonlinear_implicit_system.h"
26#include "libmesh/transient_system.h"
27#include "libmesh/parallel_mesh.h"
28#include "libmesh/serial_mesh.h"
29#include "libmesh/exodusII_io.h"
30#include "libmesh/exodusII_io_helper.h"
31#include "libmesh/enum_xdr_mode.h"
32#include "libmesh/nemesis_io.h"
33
35
38{
39 // Get the input parameters from the parent class
42
43 params.addCustomTypeParam<std::string>(
44 "time_transformation",
45 "t",
46 "FunctionExpression",
47 "Expression to transform from current simulation time to time at "
48 "which to sample the solution.");
49
50 return params;
51}
52
54 : SolutionUserObjectBase(parameters), FunctionParserUtils<false>(parameters)
55{
56 // Create parsed function
57 _time_transformation = std::make_shared<SymFunction>();
59 _time_transformation, getParam<std::string>("time_transformation"), "t", {}, {}, comm());
60
61 // the only parameter is time
62 _func_params.resize(1);
63}
64
65Real
registerMooseObject("MooseApp", SolutionUserObject)
std::vector< GenericReal< is_ad > > _func_params
Array to stage the parameters passed to the functions when calling Eval.
void parsedFunctionSetup(SymFunctionPtr &function, const std::string &expression, const std::string &variables, const std::vector< std::string > &constant_names, const std::vector< std::string > &constant_expressions, const libMesh::Parallel::Communicator &comm) const
Performs setup steps on a SymFunction.
GenericReal< is_ad > evaluate(SymFunctionPtr &, const std::string &object_name="")
Evaluate FParser object and check EvalError.
static InputParameters validParams()
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
void addCustomTypeParam(const std::string &name, const T &value, const std::string &custom_type, const std::string &doc_string)
User object that reads an existing solution from an input file and uses it in the current simulation.
static InputParameters validParams()
User object that reads an existing solution from an input file and uses it in the current simulation.
static InputParameters validParams()
SymFunctionPtr _time_transformation
function parser object for transforming the solution sample time
virtual Real solutionSampleTime() override
Get the time at which to sample the solution.
SolutionUserObject(const InputParameters &parameters)
const Parallel::Communicator & comm() const