24#include "libmesh/equation_systems.h"
25#include "libmesh/mesh_function.h"
26#include "libmesh/numeric_vector.h"
27#include "libmesh/nonlinear_implicit_system.h"
28#include "libmesh/transient_system.h"
29#include "libmesh/parallel_mesh.h"
30#include "libmesh/serial_mesh.h"
31#include "libmesh/exodusII_io.h"
32#include "libmesh/exodusII_io_helper.h"
33#include "libmesh/nemesis_io.h"
34#include "libmesh/nemesis_io_helper.h"
35#include "libmesh/enum_xdr_mode.h"
36#include "libmesh/string_to_enum.h"
37#include "libmesh/fe_interface.h"
47 "mesh",
"The name of the mesh file (must be xda/xdr, exodusII or nemesis file).");
48 params.
addParam<std::vector<std::string>>(
50 std::vector<std::string>(),
51 "The name of the nodal and elemental variables from the file you want to use for values");
53 "force_replicated_source_mesh",
55 "Whether to force the serialization of the source mesh. This can be useful for discontinuous "
56 "variables or if the partitioning of the source mesh and the current mesh are different");
62 "The name of the file holding the equation system info in xda/xdr format (xda/xdr only).");
66 "The name of the system to pull values out of (xda/xdr only). The default name for the "
67 "nonlinear system is 'nl0', auxiliary system is 'aux0'");
70 params.
addParam<std::string>(
"timestep",
71 "Index of the single timestep used or \"LATEST\" for "
72 "the last timestep (exodusII only). If not supplied, "
73 "time interpolation will occur.");
78 "Specifies the order of the nodal solution data.");
82 "scale", std::vector<Real>(LIBMESH_DIM, 1),
"Scale factor for points in the simulation");
83 params.
addParam<std::vector<Real>>(
"scale_multiplier",
84 std::vector<Real>(LIBMESH_DIM, 1),
85 "Scale multiplying factor for points in the simulation");
86 params.
addParam<std::vector<Real>>(
"translation",
87 std::vector<Real>(LIBMESH_DIM, 0),
88 "Translation factors for x,y,z coordinates of the simulation");
89 params.
addParam<RealVectorValue>(
"rotation0_vector",
90 RealVectorValue(0, 0, 1),
91 "Vector about which to rotate points of the simulation.");
95 "Anticlockwise rotation angle (in degrees) to use for rotation about rotation0_vector.");
96 params.
addParam<RealVectorValue>(
"rotation1_vector",
97 RealVectorValue(0, 0, 1),
98 "Vector about which to rotate points of the simulation.");
102 "Anticlockwise rotation angle (in degrees) to use for rotation about rotation1_vector.");
106 "rotation0 translation scale rotation1 scale_multiplier",
"translation scale");
108 "transformation_order",
109 default_transformation_order,
110 "The order to perform the operations in. Define R0 to be the rotation matrix encoded by "
111 "rotation0_vector and rotation0_angle. Similarly for R1. Denote the scale by s, the "
112 "scale_multiplier by m, and the translation by t. Then, given a point x in the simulation, "
113 "if transformation_order = 'rotation0 scale_multiplier translation scale rotation1' then "
114 "form p = R1*(R0*x*m - t)/s. Then the values provided by the SolutionUserObjectBase at "
116 "in the simulation are the variable values at point p in the mesh.");
117 params.
addParamNamesToGroup(
"scale scale_multiplier translation rotation0_vector rotation0_angle "
118 "rotation1_angle transformation_order",
119 "Coordinate system transformation");
129 _file_type(
MooseEnum(
"xda=0 exodusII=1 xdr=2 nemesis=3")),
130 _mesh_file(getParam<MeshFileName>(
"mesh")),
131 _es_file(getParam<FileName>(
"es")),
132 _system_name(getParam<
std::string>(
"system")),
133 _system_variables(getParam<
std::vector<
std::string>>(
"system_variables")),
134 _exodus_time_index(-1),
135 _interpolate_times(false),
138 _interpolation_time(0.0),
139 _interpolation_factor(0.0),
140 _exodus_times(nullptr),
143 _nodal_variable_order(getParam<
MooseEnum>(
"nodal_variable_order")),
144 _scale(getParam<
std::vector<Real>>(
"scale")),
145 _scale_multiplier(getParam<
std::vector<Real>>(
"scale_multiplier")),
146 _translation(getParam<
std::vector<Real>>(
"translation")),
147 _rotation0_vector(getParam<RealVectorValue>(
"rotation0_vector")),
148 _rotation0_angle(getParam<Real>(
"rotation0_angle")),
149 _r0(RealTensorValue()),
150 _rotation1_vector(getParam<RealVectorValue>(
"rotation1_vector")),
151 _rotation1_angle(getParam<Real>(
"rotation1_angle")),
152 _r1(RealTensorValue()),
153 _transformation_order(getParam<
MultiMooseEnum>(
"transformation_order")),
154 _force_replicated_source(getParam<bool>(
"force_replicated_source_mesh")),
165 RealTensorValue rot0_z(a, -b, 0, b, a, 0, 0, 0, 1);
170 _r0 = vec0_to_z.transpose() * (rot0_z * vec0_to_z);
175 RealTensorValue rot1_z(a, -b, 0, b, a, 0, 0, 0, 1);
180 _r1 = vec1_to_z.transpose() * (rot1_z * vec1_to_z);
182 if (
isParamValid(
"timestep") && getParam<std::string>(
"timestep") ==
"-1")
183 mooseError(
"A \"timestep\" of -1 is no longer supported for interpolation. Instead simply "
184 "remove this parameter altogether for interpolation");
189 "The mesh has second-order elements, be sure to set 'nodal_variable_order' if needed.");
196 paramError(
"es",
"Equation system file (.xda or .xdr) should have been specified");
206 _es = std::make_unique<EquationSystems>(*
_mesh);
212 EquationSystems::READ_HEADER | EquationSystems::READ_DATA |
213 EquationSystems::READ_ADDITIONAL_DATA);
219 EquationSystems::READ_HEADER | EquationSystems::READ_DATA |
220 EquationSystems::READ_ADDITIONAL_DATA);
224 mooseError(
"Failed to determine proper read method for XDA/XDR equation system file: ",
257 std::string s_timestep = getParam<std::string>(
"timestep");
260 if (s_timestep ==
"LATEST")
264 std::istringstream ss(s_timestep);
266 mooseError(
"Invalid value passed as \"timestep\". Expected \"LATEST\" or a valid integer "
279 if (num_exo_times == 0)
280 mooseError(
"In SolutionUserObjectBase, exodus file contains no timesteps.");
286 _mesh->allow_renumbering(
true);
287 _mesh->prepare_for_use();
291 _mesh->allow_renumbering(
false);
292 _mesh->prepare_for_use();
296 _es = std::make_unique<EquationSystems>(*
_mesh);
301 const std::vector<std::string> & all_nodal((
_file_type ==
"exodusII")
304 const std::vector<std::string> & all_elemental((
_file_type ==
"exodusII")
307 const std::vector<std::string> & all_scalar((
_file_type ==
"exodusII")
322 if (std::find(all_nodal.begin(), all_nodal.end(), var_name) != all_nodal.end())
324 else if (std::find(all_elemental.begin(), all_elemental.end(), var_name) !=
327 else if (std::find(all_scalar.begin(), all_scalar.end(), var_name) != all_scalar.end())
332 paramError(
"system_variables",
"Variable '" + var_name +
"' was not found in Exodus file");
340 for (
auto var_name : all_scalar)
361 const auto copy_solutions = [
this](
auto & io,
libMesh::System & system,
unsigned int index)
364 io.copy_nodal_solution(system, var_name, var_name, index);
367 io.copy_elemental_solution(system, var_name, var_name, index);
380 _es2 = std::make_unique<EquationSystems>(*
_mesh);
423 mooseError(
"In SolutionUserObjectBase, timestep = ",
425 ", but there are only ",
449 dof_id_type node_id = node->id();
451 mooseAssert(sys_node.n_dofs(sys_num, var_num) > 0,
452 "Variable " << var_name <<
" has no DoFs on node " << sys_node.id());
453 dof_id_type dof_id = sys_node.dof_number(sys_num, var_num, 0);
467 dof_id_type elem_id = elem->id();
469 mooseAssert(sys_elem.n_dofs(sys_num, var_num) > 0,
470 "Variable " << var_name <<
" has no DoFs on element " << sys_elem.id());
471 dof_id_type dof_id = sys_elem.dof_number(sys_num, var_num, 0);
495 _cached_p(0) = std::numeric_limits<Real>::max();
496 _cached_p2(0) = std::numeric_limits<Real>::max();
513 const bool has_exodus_extension =
516 const bool has_nemesis_extension =
519 if (has_exodus_extension)
521 else if (has_nemesis_extension)
532 if (has_exodus_extension || has_nemesis_extension)
552 "In SolutionUserObjectBase, invalid file type: only .xda, .xdr, .exo and .e supported");
562 std::vector<unsigned int> var_nums;
568 for (
const auto & var_num : var_nums)
587 DenseVector<Number> default_values;
641 "The local variable index is outside the range of imported solution variables.");
661 const auto update_solutions = [
this](
auto & io,
libMesh::System & system,
unsigned int index)
664 io.copy_nodal_solution(system, var_name, var_name, index);
666 io.copy_elemental_solution(system, var_name, var_name, index);
697 mooseError(
"getTimeInterpolationData only applicable for exodusII or Nemesis file type");
714 for (
int i = 0; i < num_exo_times - 1; ++i)
721 (solution_time - (*_exodus_times)[i]) / ((*
_exodus_times)[i + 1] - (*_exodus_times)[i]);
724 else if (i == num_exo_times - 2)
734 bool indices_modified(
false);
737 indices_modified =
true;
739 return indices_modified;
748 mooseError(
"Value requested for nonexistent variable '",
752 "' SolutionUserObjectBase.\nSystem selected: ",
754 "\nAvailable variables:\n",
762 const std::string & var_name,
763 WeightingType weighting_type,
764 const std::set<subdomain_id_type> * subdomain_ids)
const
768 const auto continuity = FEInterface::get_continuity(fe_type);
769 const auto field_type = FEInterface::field_type(fe_type);
773 return pointValue(t, p, var_name, subdomain_ids);
778 mooseAssert(!
values.empty(),
779 "discontinuousPointValue() should error rather than return an empty map.");
781 switch (weighting_type)
783 case WeightingType::AVERAGE:
788 return average / Real(
values.size());
792 mooseError(
"SolutionUserObjectBase::pointValue reaches line that it should not be able to "
800 const std::string & var_name,
801 const std::set<subdomain_id_type> * subdomain_ids)
const
804 return pointValue(t, p, local_var_index, subdomain_ids);
810 const unsigned int local_var_index,
811 const std::set<subdomain_id_type> * subdomain_ids)
const
814 "Point value evaluation requires a scalar-valued imported variable.");
825 for (
const auto i : make_range(
Moose::
dim))
828 for (
const auto i : make_range(
Moose::
dim))
831 for (
const auto i : make_range(
Moose::
dim))
844 "Time passed into value() must match time at last call to timestepSetup()");
852std::map<const Elem *, Real>
856 const std::string & var_name,
857 const std::set<subdomain_id_type> * subdomain_ids)
const
863std::map<const Elem *, Real>
865 Real libmesh_dbg_var(t),
867 const unsigned int local_var_index,
868 const std::set<subdomain_id_type> * subdomain_ids)
const
871 "Point value evaluation requires a scalar-valued imported variable.");
879 for (
const auto i : make_range(
Moose::
dim))
882 for (
const auto i : make_range(
Moose::
dim))
885 for (
const auto i : make_range(
Moose::
dim))
892 std::map<const Elem *, Real> map =
899 "Time passed into value() must match time at last call to timestepSetup()");
900 std::map<const Elem *, Real> map2 =
903 if (map.size() != map2.size())
905 "In SolutionUserObjectBase::discontinuousPointValue map and map2 have different size");
910 if (map2.find(k.first) == map2.end())
912 "In SolutionUserObjectBase::discontinuousPointValue map and map2 have differing keys");
914 Real val2 = map2[k.first];
925 const std::string & var_name,
926 WeightingType weighting_type,
927 const std::set<subdomain_id_type> * subdomain_ids)
const
931 std::map<const Elem *, RealGradient>
values =
934 mooseAssert(!
values.empty(),
935 "discontinuousPointValueGradient() should error rather than return an empty map.");
937 switch (weighting_type)
939 case WeightingType::AVERAGE:
941 RealGradient average = RealGradient(0.0, 0.0, 0.0);
944 return average / Real(
values.size());
948 mooseError(
"SolutionUserObjectBase::pointValueGradient reaches line that it should not be "
950 return RealGradient(0.0, 0.0, 0.0);
956 const std::string & var_name,
957 const std::set<subdomain_id_type> * subdomain_ids)
const
966 const unsigned int local_var_index,
967 const std::set<subdomain_id_type> * subdomain_ids)
const
970 "Point gradient evaluation requires a scalar-valued imported variable.");
978 for (
const auto i : make_range(
Moose::
dim))
981 for (
const auto i : make_range(
Moose::
dim))
984 for (
const auto i : make_range(
Moose::
dim))
997 "Time passed into value() must match time at last call to timestepSetup()");
1005std::map<const Elem *, RealGradient>
1009 const std::string & var_name,
1010 const std::set<subdomain_id_type> * subdomain_ids)
const
1016std::map<const Elem *, RealGradient>
1018 Real libmesh_dbg_var(t),
1020 const unsigned int local_var_index,
1021 const std::set<subdomain_id_type> * subdomain_ids)
const
1024 "Point gradient evaluation requires a scalar-valued imported variable.");
1032 for (
const auto i : make_range(
Moose::
dim))
1035 for (
const auto i : make_range(
Moose::
dim))
1038 for (
const auto i : make_range(
Moose::
dim))
1045 std::map<const Elem *, RealGradient> map =
1052 "Time passed into value() must match time at last call to timestepSetup()");
1053 std::map<const Elem *, RealGradient> map2 =
1056 if (map.size() != map2.size())
1057 mooseError(
"In SolutionUserObjectBase::discontinuousPointValueGradient map and map2 have "
1061 for (
auto & k : map)
1063 if (map2.find(k.first) == map2.end())
1064 mooseError(
"In SolutionUserObjectBase::discontinuousPointValueGradient map and map2 have "
1078 Real val = (*_serialized_solution)(dof_index);
1081 Real val2 = (*_serialized_solution2)(dof_index);
1089 const unsigned int local_var_index,
1090 unsigned int func_num,
1091 const std::set<subdomain_id_type> * subdomain_ids)
const
1094 DenseVector<Number> output;
1107 (*_mesh_function)(p, 0.0, output, subdomain_ids);
1118 else if (func_num == 2)
1125 (*_mesh_function2)(p, 0.0, output, subdomain_ids);
1140 if (output.size() == 0)
1142 std::ostringstream oss;
1144 mooseError(
"Failed to access the data for variable '",
1150 "' SolutionUserObjectBase");
1152 return output(local_var_index);
1155std::map<const Elem *, Real>
1158 const unsigned int local_var_index,
1159 unsigned int func_num,
1160 const std::set<subdomain_id_type> * subdomain_ids)
const
1163 std::map<const Elem *, DenseVector<Number>> temporary_output;
1169 _mesh_function->discontinuous_value(p, 0.0, temporary_output, subdomain_ids);
1172 else if (func_num == 2)
1173 _mesh_function2->discontinuous_value(p, 0.0, temporary_output, subdomain_ids);
1181 if (temporary_output.size() == 0)
1183 std::ostringstream oss;
1185 mooseError(
"Failed to access the data for variable '",
1191 "' SolutionUserObjectBase");
1195 std::map<const Elem *, Real> output;
1196 for (
auto & k : temporary_output)
1199 k.second.size() > local_var_index,
1200 "In SolutionUserObjectBase::evalMultiValuedMeshFunction variable with local_var_index "
1201 << local_var_index <<
" does not exist");
1202 output[k.first] = k.second(local_var_index);
1211 const unsigned int local_var_index,
1212 unsigned int func_num,
1213 const std::set<subdomain_id_type> * subdomain_ids)
const
1216 std::vector<Gradient> output;
1225 else if (func_num == 2)
1234 if (output.size() == 0)
1236 std::ostringstream oss;
1238 mooseError(
"Failed to access the data for variable '",
1244 "' SolutionUserObjectBase");
1246 return output[local_var_index];
1249std::map<const Elem *, RealGradient>
1252 const unsigned int local_var_index,
1253 unsigned int func_num,
1254 const std::set<subdomain_id_type> * subdomain_ids)
const
1257 std::map<const Elem *, std::vector<Gradient>> temporary_output;
1263 _mesh_function->discontinuous_gradient(p, 0.0, temporary_output, subdomain_ids);
1266 else if (func_num == 2)
1267 _mesh_function2->discontinuous_gradient(p, 0.0, temporary_output, subdomain_ids);
1275 if (temporary_output.size() == 0)
1277 std::ostringstream oss;
1279 mooseError(
"Failed to access the data for variable '",
1285 "' SolutionUserObjectBase");
1289 std::map<const Elem *, RealGradient> output;
1290 for (
auto & k : temporary_output)
1293 k.second.size() > local_var_index,
1294 "In SolutionUserObjectBase::evalMultiValuedMeshFunction variable with local_var_index "
1295 << local_var_index <<
" does not exist");
1296 output[k.first] = k.second[local_var_index];
1302const std::vector<std::string> &
1320 std::vector<dof_id_type> dofs;
1329#ifdef LIBMESH_HAVE_EXODUS_API
1332 const auto & id_to_block = exio_helper->id_to_block_names;
1335 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 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 bool isDistributedMesh() const
Returns the final Mesh distribution type.
bool hasSecondOrderElements()
check if the mesh has SECOND order elements
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)
bool isVariableADiscontinuousScalarField(const std::string &var_name) const
Returns whether the imported variable is a discontinuous scalar finite element field.
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.
bool isVariableScalarValued(const std::string &var_name) const
Returns whether the imported variable has a scalar finite element field type.
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
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.
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
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.
libMesh::RealGradient pointValueGradient(Real t, const Point &p, const std::string &var_name, WeightingType weighting_type, const std::set< subdomain_id_type > *subdomain_ids=nullptr) const
Returns the gradient at a specific location and variable, reducing multiple gradients according to th...
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.
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
const FEType & variable_type(const unsigned int i) 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