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/nemesis_io.h"
32#include "libmesh/nemesis_io_helper.h"
33#include "libmesh/enum_xdr_mode.h"
34#include "libmesh/string_to_enum.h"
44 "mesh",
"The name of the mesh file (must be xda/xdr, exodusII or nemesis file).");
45 params.
addParam<std::vector<std::string>>(
47 std::vector<std::string>(),
48 "The name of the nodal and elemental variables from the file you want to use for values");
50 "force_replicated_source_mesh",
52 "Whether to force the serialization of the source mesh. This can be useful for discontinuous "
53 "variables or if the partitioning of the source mesh and the current mesh are different");
59 "The name of the file holding the equation system info in xda/xdr format (xda/xdr only).");
63 "The name of the system to pull values out of (xda/xdr only). The default name for the "
64 "nonlinear system is 'nl0', auxiliary system is 'aux0'");
67 params.
addParam<std::string>(
"timestep",
68 "Index of the single timestep used or \"LATEST\" for "
69 "the last timestep (exodusII only). If not supplied, "
70 "time interpolation will occur.");
75 "Specifies the order of the nodal solution data.");
79 "scale", std::vector<Real>(LIBMESH_DIM, 1),
"Scale factor for points in the simulation");
80 params.
addParam<std::vector<Real>>(
"scale_multiplier",
81 std::vector<Real>(LIBMESH_DIM, 1),
82 "Scale multiplying factor for points in the simulation");
83 params.
addParam<std::vector<Real>>(
"translation",
84 std::vector<Real>(LIBMESH_DIM, 0),
85 "Translation factors for x,y,z coordinates of the simulation");
86 params.
addParam<RealVectorValue>(
"rotation0_vector",
87 RealVectorValue(0, 0, 1),
88 "Vector about which to rotate points of the simulation.");
92 "Anticlockwise rotation angle (in degrees) to use for rotation about rotation0_vector.");
93 params.
addParam<RealVectorValue>(
"rotation1_vector",
94 RealVectorValue(0, 0, 1),
95 "Vector about which to rotate points of the simulation.");
99 "Anticlockwise rotation angle (in degrees) to use for rotation about rotation1_vector.");
103 "rotation0 translation scale rotation1 scale_multiplier",
"translation scale");
105 "transformation_order",
106 default_transformation_order,
107 "The order to perform the operations in. Define R0 to be the rotation matrix encoded by "
108 "rotation0_vector and rotation0_angle. Similarly for R1. Denote the scale by s, the "
109 "scale_multiplier by m, and the translation by t. Then, given a point x in the simulation, "
110 "if transformation_order = 'rotation0 scale_multiplier translation scale rotation1' then "
111 "form p = R1*(R0*x*m - t)/s. Then the values provided by the SolutionUserObjectBase at "
113 "in the simulation are the variable values at point p in the mesh.");
114 params.
addParamNamesToGroup(
"scale scale_multiplier translation rotation0_vector rotation0_angle "
115 "rotation1_angle transformation_order",
116 "Coordinate system transformation");
126 _file_type(
MooseEnum(
"xda=0 exodusII=1 xdr=2 nemesis=3")),
127 _mesh_file(getParam<MeshFileName>(
"mesh")),
128 _es_file(getParam<FileName>(
"es")),
129 _system_name(getParam<
std::string>(
"system")),
130 _system_variables(getParam<
std::vector<
std::string>>(
"system_variables")),
131 _exodus_time_index(-1),
132 _interpolate_times(false),
135 _interpolation_time(0.0),
136 _interpolation_factor(0.0),
137 _exodus_times(nullptr),
140 _nodal_variable_order(getParam<
MooseEnum>(
"nodal_variable_order")),
141 _scale(getParam<
std::vector<Real>>(
"scale")),
142 _scale_multiplier(getParam<
std::vector<Real>>(
"scale_multiplier")),
143 _translation(getParam<
std::vector<Real>>(
"translation")),
144 _rotation0_vector(getParam<RealVectorValue>(
"rotation0_vector")),
145 _rotation0_angle(getParam<Real>(
"rotation0_angle")),
146 _r0(RealTensorValue()),
147 _rotation1_vector(getParam<RealVectorValue>(
"rotation1_vector")),
148 _rotation1_angle(getParam<Real>(
"rotation1_angle")),
149 _r1(RealTensorValue()),
150 _transformation_order(getParam<
MultiMooseEnum>(
"transformation_order")),
151 _force_replicated_source(getParam<bool>(
"force_replicated_source_mesh")),
162 RealTensorValue rot0_z(a, -b, 0, b, a, 0, 0, 0, 1);
167 _r0 = vec0_to_z.transpose() * (rot0_z * vec0_to_z);
172 RealTensorValue rot1_z(a, -b, 0, b, a, 0, 0, 0, 1);
177 _r1 = vec1_to_z.transpose() * (rot1_z * vec1_to_z);
179 if (
isParamValid(
"timestep") && getParam<std::string>(
"timestep") ==
"-1")
180 mooseError(
"A \"timestep\" of -1 is no longer supported for interpolation. Instead simply "
181 "remove this parameter altogether for interpolation");
186 "The mesh has second-order elements, be sure to set 'nodal_variable_order' if needed.");
193 paramError(
"es",
"Equation system file (.xda or .xdr) should have been specified");
203 _es = std::make_unique<EquationSystems>(*
_mesh);
209 EquationSystems::READ_HEADER | EquationSystems::READ_DATA |
210 EquationSystems::READ_ADDITIONAL_DATA);
216 EquationSystems::READ_HEADER | EquationSystems::READ_DATA |
217 EquationSystems::READ_ADDITIONAL_DATA);
221 mooseError(
"Failed to determine proper read method for XDA/XDR equation system file: ",
254 std::string s_timestep = getParam<std::string>(
"timestep");
257 if (s_timestep ==
"LATEST")
261 std::istringstream ss(s_timestep);
263 mooseError(
"Invalid value passed as \"timestep\". Expected \"LATEST\" or a valid integer "
276 if (num_exo_times == 0)
277 mooseError(
"In SolutionUserObjectBase, exodus file contains no timesteps.");
283 _mesh->allow_renumbering(
true);
284 _mesh->prepare_for_use();
288 _mesh->allow_renumbering(
false);
289 _mesh->prepare_for_use();
293 _es = std::make_unique<EquationSystems>(*
_mesh);
298 const std::vector<std::string> & all_nodal((
_file_type ==
"exodusII")
301 const std::vector<std::string> & all_elemental((
_file_type ==
"exodusII")
304 const std::vector<std::string> & all_scalar((
_file_type ==
"exodusII")
319 if (std::find(all_nodal.begin(), all_nodal.end(), var_name) != all_nodal.end())
321 else if (std::find(all_elemental.begin(), all_elemental.end(), var_name) !=
324 else if (std::find(all_scalar.begin(), all_scalar.end(), var_name) != all_scalar.end())
329 paramError(
"system_variables",
"Variable '" + var_name +
"' was not found in Exodus file");
337 for (
auto var_name : all_scalar)
358 const auto copy_solutions = [
this](
auto & io,
libMesh::System & system,
unsigned int index)
361 io.copy_nodal_solution(system, var_name, var_name, index);
364 io.copy_elemental_solution(system, var_name, var_name, index);
377 _es2 = std::make_unique<EquationSystems>(*
_mesh);
420 mooseError(
"In SolutionUserObjectBase, timestep = ",
422 ", but there are only ",
446 dof_id_type node_id = node->id();
448 mooseAssert(sys_node.n_dofs(sys_num, var_num) > 0,
449 "Variable " << var_name <<
" has no DoFs on node " << sys_node.id());
450 dof_id_type dof_id = sys_node.dof_number(sys_num, var_num, 0);
464 dof_id_type elem_id = elem->id();
466 mooseAssert(sys_elem.n_dofs(sys_num, var_num) > 0,
467 "Variable " << var_name <<
" has no DoFs on element " << sys_elem.id());
468 dof_id_type dof_id = sys_elem.dof_number(sys_num, var_num, 0);
492 _cached_p(0) = std::numeric_limits<Real>::max();
493 _cached_p2(0) = std::numeric_limits<Real>::max();
510 const bool has_exodus_extension =
513 const bool has_nemesis_extension =
516 if (has_exodus_extension)
518 else if (has_nemesis_extension)
529 if (has_exodus_extension || has_nemesis_extension)
549 "In SolutionUserObjectBase, invalid file type: only .xda, .xdr, .exo and .e supported");
559 std::vector<unsigned int> var_nums;
565 for (
const auto & var_num : var_nums)
584 DenseVector<Number> default_values;
632 const auto update_solutions = [
this](
auto & io,
libMesh::System & system,
unsigned int index)
635 io.copy_nodal_solution(system, var_name, var_name, index);
637 io.copy_elemental_solution(system, var_name, var_name, index);
668 mooseError(
"getTimeInterpolationData only applicable for exodusII or Nemesis file type");
685 for (
int i = 0; i < num_exo_times - 1; ++i)
692 (solution_time - (*_exodus_times)[i]) / ((*
_exodus_times)[i + 1] - (*_exodus_times)[i]);
695 else if (i == num_exo_times - 2)
705 bool indices_modified(
false);
708 indices_modified =
true;
710 return indices_modified;
719 mooseError(
"Value requested for nonexistent variable '",
723 "' SolutionUserObjectBase.\nSystem selected: ",
725 "\nAvailable variables:\n",
733 const std::string & var_name,
735 const std::set<subdomain_id_type> * subdomain_ids)
const
747 if (weighting_type == 1 ||
748 (family != L2_LAGRANGE && family != MONOMIAL && family != L2_HIERARCHIC))
749 return pointValue(t, p, var_name, subdomain_ids);
753 switch (weighting_type)
760 return average / Real(
values.size());
764 Real smallest_elem_id_value = std::numeric_limits<Real>::max();
767 if (v.first->id() < smallest_elem_id)
769 smallest_elem_id = v.first->id();
770 smallest_elem_id_value = v.second;
772 return smallest_elem_id_value;
776 Real largest_elem_id_value = std::numeric_limits<Real>::lowest();
777 dof_id_type largest_elem_id = 0;
779 if (v.first->id() > largest_elem_id)
781 largest_elem_id = v.first->id();
782 largest_elem_id_value = v.second;
784 return largest_elem_id_value;
788 mooseError(
"SolutionUserObjectBase::pointValueWrapper reaches line that it should not be able to "
796 const std::string & var_name,
797 const std::set<subdomain_id_type> * subdomain_ids)
const
800 return pointValue(t, p, local_var_index, subdomain_ids);
806 const unsigned int local_var_index,
807 const std::set<subdomain_id_type> * subdomain_ids)
const
818 for (
const auto i : make_range(
Moose::
dim))
821 for (
const auto i : make_range(
Moose::
dim))
824 for (
const auto i : make_range(
Moose::
dim))
837 "Time passed into value() must match time at last call to timestepSetup()");
845std::map<const Elem *, Real>
849 const std::string & var_name,
850 const std::set<subdomain_id_type> * subdomain_ids)
const
856std::map<const Elem *, Real>
858 Real libmesh_dbg_var(t),
860 const unsigned int local_var_index,
861 const std::set<subdomain_id_type> * subdomain_ids)
const
869 for (
const auto i : make_range(
Moose::
dim))
872 for (
const auto i : make_range(
Moose::
dim))
875 for (
const auto i : make_range(
Moose::
dim))
882 std::map<const Elem *, Real> map =
889 "Time passed into value() must match time at last call to timestepSetup()");
892 if (map.size() != map2.size())
894 "In SolutionUserObjectBase::discontinuousPointValue map and map2 have different size");
899 if (map2.find(k.first) == map2.end())
901 "In SolutionUserObjectBase::discontinuousPointValue map and map2 have differing keys");
903 Real val2 = map2[k.first];
915 const std::string & var_name,
917 const std::set<subdomain_id_type> * subdomain_ids)
const
920 if (weighting_type == 1)
924 std::map<const Elem *, RealGradient>
values =
926 switch (weighting_type)
930 RealGradient average = RealGradient(0.0, 0.0, 0.0);
933 return average / Real(
values.size());
937 RealGradient smallest_elem_id_value;
940 if (v.first->id() < smallest_elem_id)
942 smallest_elem_id = v.first->id();
943 smallest_elem_id_value = v.second;
945 return smallest_elem_id_value;
949 RealGradient largest_elem_id_value;
950 dof_id_type largest_elem_id = 0;
952 if (v.first->id() > largest_elem_id)
954 largest_elem_id = v.first->id();
955 largest_elem_id_value = v.second;
957 return largest_elem_id_value;
961 mooseError(
"SolutionUserObjectBase::pointValueGradientWrapper reaches line that it should not be "
963 return RealGradient(0.0, 0.0, 0.0);
969 const std::string & var_name,
970 const std::set<subdomain_id_type> * subdomain_ids)
const
979 const unsigned int local_var_index,
980 const std::set<subdomain_id_type> * subdomain_ids)
const
988 for (
const auto i : make_range(
Moose::
dim))
991 for (
const auto i : make_range(
Moose::
dim))
994 for (
const auto i : make_range(
Moose::
dim))
1007 "Time passed into value() must match time at last call to timestepSetup()");
1015std::map<const Elem *, RealGradient>
1019 const std::string & var_name,
1020 const std::set<subdomain_id_type> * subdomain_ids)
const
1026std::map<const Elem *, RealGradient>
1028 Real libmesh_dbg_var(t),
1030 const unsigned int local_var_index,
1031 const std::set<subdomain_id_type> * subdomain_ids)
const
1039 for (
const auto i : make_range(
Moose::
dim))
1042 for (
const auto i : make_range(
Moose::
dim))
1045 for (
const auto i : make_range(
Moose::
dim))
1052 std::map<const Elem *, RealGradient> map =
1059 "Time passed into value() must match time at last call to timestepSetup()");
1060 std::map<const Elem *, RealGradient> map2 =
1063 if (map.size() != map2.size())
1065 "In SolutionUserObjectBase::discontinuousPointValue map and map2 have different size");
1068 for (
auto & k : map)
1070 if (map2.find(k.first) == map2.end())
1072 "In SolutionUserObjectBase::discontinuousPointValue map and map2 have differing keys");
1085 Real val = (*_serialized_solution)(dof_index);
1088 Real val2 = (*_serialized_solution2)(dof_index);
1096 const unsigned int local_var_index,
1097 unsigned int func_num,
1098 const std::set<subdomain_id_type> * subdomain_ids)
const
1101 DenseVector<Number> output;
1114 (*_mesh_function)(p, 0.0, output, subdomain_ids);
1123 else if (func_num == 2)
1130 (*_mesh_function2)(p, 0.0, output, subdomain_ids);
1143 if (output.size() == 0)
1145 std::ostringstream oss;
1147 mooseError(
"Failed to access the data for variable '",
1153 "' SolutionUserObjectBase");
1155 return output(local_var_index);
1158std::map<const Elem *, Real>
1161 const unsigned int local_var_index,
1162 unsigned int func_num,
1163 const std::set<subdomain_id_type> * subdomain_ids)
const
1166 std::map<const Elem *, DenseVector<Number>> temporary_output;
1172 _mesh_function->discontinuous_value(p, 0.0, temporary_output, subdomain_ids);
1175 else if (func_num == 2)
1176 _mesh_function2->discontinuous_value(p, 0.0, temporary_output, subdomain_ids);
1184 if (temporary_output.size() == 0)
1186 std::ostringstream oss;
1188 mooseError(
"Failed to access the data for variable '",
1194 "' SolutionUserObjectBase");
1198 std::map<const Elem *, Real> output;
1199 for (
auto & k : temporary_output)
1202 k.second.size() > local_var_index,
1203 "In SolutionUserObjectBase::evalMultiValuedMeshFunction variable with local_var_index "
1204 << local_var_index <<
" does not exist");
1205 output[k.first] = k.second(local_var_index);
1214 const unsigned int local_var_index,
1215 unsigned int func_num,
1216 const std::set<subdomain_id_type> * subdomain_ids)
const
1219 std::vector<Gradient> output;
1228 else if (func_num == 2)
1237 if (output.size() == 0)
1239 std::ostringstream oss;
1241 mooseError(
"Failed to access the data for variable '",
1247 "' SolutionUserObjectBase");
1249 return output[local_var_index];
1252std::map<const Elem *, RealGradient>
1255 const unsigned int local_var_index,
1256 unsigned int func_num,
1257 const std::set<subdomain_id_type> * subdomain_ids)
const
1260 std::map<const Elem *, std::vector<Gradient>> temporary_output;
1266 _mesh_function->discontinuous_gradient(p, 0.0, temporary_output, subdomain_ids);
1269 else if (func_num == 2)
1270 _mesh_function2->discontinuous_gradient(p, 0.0, temporary_output, subdomain_ids);
1278 if (temporary_output.size() == 0)
1280 std::ostringstream oss;
1282 mooseError(
"Failed to access the data for variable '",
1288 "' SolutionUserObjectBase");
1292 std::map<const Elem *, RealGradient> output;
1293 for (
auto & k : temporary_output)
1296 k.second.size() > local_var_index,
1297 "In SolutionUserObjectBase::evalMultiValuedMeshFunction variable with local_var_index "
1298 << local_var_index <<
" does not exist");
1299 output[k.first] = k.second[local_var_index];
1305const std::vector<std::string> &
1323 std::vector<dof_id_type> dofs;
1332#ifdef LIBMESH_HAVE_EXODUS_API
1335 const auto & id_to_block = exio_helper->id_to_block_names;
1338 for (
const auto & it : id_to_block)
void mooseInfo(Args &&... args)
Emit an informational message with the given stringified, concatenated args.
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
std::array< Real, 2 > values
virtual const MooseVariableFieldBase & getVariable(const THREAD_ID tid, const std::string &var_name, Moose::VarKindType expected_var_type=Moose::VarKindType::VAR_ANY, Moose::VarFieldType expected_var_field_type=Moose::VarFieldType::VAR_FIELD_ANY) const override
Returns the variable reference for requested variable which must be of the expected_var_type (Nonline...
virtual MooseMesh & mesh() override
static InputParameters validParams()
const std::string & name() const
Get the name of the class.
void paramError(const std::string ¶m, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
bool isParamSetByUser(const std::string &name) const
Test if the supplied parameter is set by a user, as opposed to not set or set to default.
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
virtual dof_id_type maxElemId() const
virtual bool isDistributedMesh() const
Returns the final Mesh distribution type.
bool hasSecondOrderElements()
check if the mesh has SECOND order elements
const libMesh::FEType & feType() const
Get the type of finite element object.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type.
unsigned int size() const
Return the number of active items in the MultiMooseEnum.
MooseEnum _file_type
File type to read (0 = xda; 1 = ExodusII, 2 = xdr, 3 = Nemesis)
virtual Real solutionSampleTime()=0
Get the time at which to sample the solution.
std::set< subdomain_id_type > _cached_subdomain_ids2
const bool _force_replicated_source
Whether to force the source mesh to be replicated.
MooseEnum getSolutionFileType() const
Get the type of file that was read.
Real pointValue(Real t, const Point &p, const unsigned int local_var_index, const std::set< subdomain_id_type > *subdomain_ids=nullptr) const
Returns a value at a specific location and variable (see SolutionFunction)
const MooseEnum _nodal_variable_order
Nodal variable order, used when reading in solution data.
std::string _system_name
The system name to extract from the XDA/XDR file (xda/xdr only)
RealTensorValue _r0
Rotation matrix that performs the "_rotation0_angle about rotation0_vector".
libMesh::RealGradient evalMeshFunctionGradient(const Point &p, const unsigned int local_var_index, unsigned int func_num, const std::set< subdomain_id_type > *subdomain_ids=nullptr) const
A wrapper method interfacing with the libMesh mesh function for evaluating the gradient.
std::unique_ptr< libMesh::MeshFunction > _mesh_function2
Pointer to second libMesh::MeshFuntion, used for interpolation.
std::map< SubdomainID, SubdomainName > _block_id_to_name
Map from block names to block IDs. Read from the ExodusII file.
std::vector< std::string > _system_variables
A list of variables to extract from the read system.
std::unique_ptr< libMesh::MeshBase > _mesh
Pointer the libMesh::mesh object.
std::vector< std::string > _nodal_variables
Stores names of nodal variables.
DenseVector< Number > _cached_values2
bool _interpolate_times
Flag for triggering interpolation of ExodusII data.
int _exodus_index2
Time index 2, used for interpolation.
unsigned int getLocalVarIndex(const std::string &var_name) const
Returns the local index for a given variable name.
std::vector< Real > _scale
Scale parameter.
std::unique_ptr< libMesh::EquationSystems > _es2
Pointer to second libMesh::EquationSystems object, used for interpolation.
Real _interpolation_factor
Interpolation weight factor.
std::unique_ptr< libMesh::EquationSystems > _es
Pointer to the libMesh::EquationSystems object.
virtual void timestepSetup() override
When reading ExodusII files, this will update the interpolation times.
std::vector< Real > _scale_multiplier
scale_multiplier parameter
void readBlockIdMapFromExodusII()
Read block ID map from the ExodusII file.
std::unique_ptr< NumericVector< Number > > _serialized_solution
Pointer to the serial solution vector.
std::unique_ptr< libMesh::MeshFunction > _mesh_function
Pointer the libMesh::MeshFunction object that the read data is stored.
void readXda()
Method for reading XDA mesh and equation systems file(s) This method is called by the constructor whe...
static Threads::spin_mutex _solution_user_object_mutex
Real pointValueWrapper(Real t, const Point &p, const std::string &var_name, const MooseEnum &weighting_type=weightingType(), const std::set< subdomain_id_type > *subdomain_ids=nullptr) const
Returns a value at a specific location and variable checking for multiple values and weighting these ...
std::map< const Elem *, libMesh::RealGradient > evalMultiValuedMeshFunctionGradient(const Point &p, const unsigned int local_var_index, unsigned int func_num, const std::set< subdomain_id_type > *subdomain_ids=nullptr) const
A wrapper method interfacing with the libMesh mesh function that calls the gradient functionality for...
Real _interpolation_time
Time in the current simulation at which the solution interpolation was last updated.
Real scalarValue(Real t, const std::string &var_name) const
Returns a value of a global variable.
static InputParameters validParams()
bool _initialized
True if initial_setup has executed.
std::vector< std::string > _scalar_variables
Stores names of scalar variables.
Point _cached_p
Cached points.
std::string _es_file
The XDA/XDR file that contians the EquationSystems data (xda/xdr only)
int _exodus_time_index
Current ExodusII time index.
RealVectorValue _rotation0_vector
vector about which to rotate
std::string _mesh_file
The XDA/ExodusII/XDR/Nemesis file that is being read.
void readExodusIIOrNemesis()
Method for reading an ExodusII or Nemesis file, which is called when a mesh file with a ....
MultiMooseEnum _transformation_order
transformations (rotations, translation, scales) are performed in this order
std::unique_ptr< libMesh::Nemesis_IO > _nemesis_io
Pointer to the libMesh::Nemesis_IO used to read the files.
const std::vector< std::string > & variableNames() const
RealTensorValue _r1
Rotation matrix that performs the "_rotation1_angle about rotation1_vector".
libMesh::System * _system2
Pointer to a second libMesh::System object, used for interpolation.
std::unique_ptr< libMesh::ExodusII_IO > _exodusII_io
Pointer to the libMesh::ExodusII used to read the files.
virtual void execute() override
Execute method.
libMesh::RealGradient pointValueGradient(Real t, const Point &p, const std::string &var_name, const std::set< subdomain_id_type > *subdomain_ids=nullptr) const
Returns the gradient at a specific location and variable (see SolutionFunction)
SolutionUserObjectBase(const InputParameters ¶meters)
DenseVector< Number > _cached_values
Cached values.
Real directValue(const Node *node, const std::string &var_name) const
Return a value directly from a Node.
virtual void initialSetup() override
Initialize the System and Mesh objects for the solution being read.
std::map< std::string, unsigned int > _local_variable_index
Stores the local index need by MeshFunction.
std::map< const Elem *, libMesh::RealGradient > discontinuousPointValueGradient(Real t, const Point &p, const std::string &var_name, const std::set< subdomain_id_type > *subdomain_ids=nullptr) const
Returns the gradient at a specific location and variable for cases where the gradient is multivalued ...
libMesh::System * _system
Pointer libMesh::System class storing the read solution.
std::unique_ptr< NumericVector< Number > > _serialized_solution2
Pointer to second serial solution, used for interpolation.
std::vector< std::string > _elemental_variables
Stores names of elemental variables.
virtual void finalize() override
Finalize.
void updateTimeInterpolationFromFile()
Updates the times for interpolating ExodusII or Nemesis data.
Real evalMeshFunction(const Point &p, const unsigned int local_var_index, unsigned int func_num, const std::set< subdomain_id_type > *subdomain_ids=nullptr) const
A wrapper method for calling the various MeshFunctions used for reading the data.
bool isVariableNodal(const std::string &var_name) const
libMesh::RealGradient pointValueGradientWrapper(Real t, const Point &p, const std::string &var_name, const MooseEnum &weighting_type=weightingType(), const std::set< subdomain_id_type > *subdomain_ids=nullptr) const
Returns the gradient at a specific location and variable checking for multiple values and weighting t...
const std::vector< Real > * _exodus_times
The times available in the ExodusII file.
bool updateInterpolationBracketingTimeIndices()
Updates the time indices to interpolate between for ExodusII or Nemesis data.
std::set< subdomain_id_type > _cached_subdomain_ids
Cached subdomain ids.
Real _rotation1_angle
angle (in degrees) which to rotate through about vector _rotation1_vector
std::map< SubdomainName, SubdomainID > _block_name_to_id
Map from block ID to block names. Read from the ExodusII file.
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
int _exodus_index1
Time index 1, used for interpolation.
RealVectorValue _rotation1_vector
vector about which to rotate
std::vector< Real > _translation
Translation.
Real _rotation0_angle
angle (in degrees) which to rotate through about vector _rotation0_vector
std::map< const Elem *, Real > discontinuousPointValue(Real t, Point pt, const unsigned int local_var_index, const std::set< subdomain_id_type > *subdomain_ids=nullptr) const
Returns a value at a specific location and variable for cases where the solution is multivalued at el...
std::map< const Elem *, Real > evalMultiValuedMeshFunction(const Point &p, const unsigned int local_var_index, unsigned int func_num, const std::set< subdomain_id_type > *subdomain_ids=nullptr) const
A wrapper method for calling the various MeshFunctions that calls the mesh function functionality for...
FEProblemBase & _fe_problem
Reference to the FEProblemBase for this user object.
const THREAD_ID _tid
Thread ID of this postprocessor.
void SCALAR_dof_indices(std::vector< dof_id_type > &di, const unsigned int vn, const bool old_dofs=false) const
virtual const Node & node_ref(const dof_id_type i) const
virtual const Elem & elem_ref(const dof_id_type i) const
const Parallel::Communicator & _communicator
void get_all_variable_numbers(std::vector< unsigned int > &all_variable_numbers) const
dof_id_type n_dofs() const
unsigned int add_variable(std::string_view var, const FEType &type, const std::set< subdomain_id_type > *const active_subdomains=nullptr)
std::unique_ptr< NumericVector< Number > > solution
const std::string & variable_name(const unsigned int i) const
unsigned int variable_number(std::string_view var) const
const DofMap & get_dof_map() const
unsigned int number() const
const MeshBase & get_mesh() const
std::string formatString(std::string message, const std::string &prefix)
Add new lines and prefixes to a string for pretty display in output NOTE: This makes a copy of the st...
bool hasExtension(const std::string &filename, std::string ext, bool strip_exodus_ext)
bool checkFileReadable(const std::string &filename, bool check_line_endings, bool throw_on_unreadable, bool check_for_git_lfs_pointer)
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
std::string stringify(const T &t)
conversion to string
GenericRealTensorValue< is_ad > rotVecToZ(GenericRealVectorValue< is_ad > vec)
provides a rotation matrix that will rotate the vector vec to the z axis (the "2" direction)
RealVectorValue RealGradient
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real