13 #include "libmesh/mesh_function.h" 14 #include "libmesh/exodusII_io.h" 22 params.
addClassDescription(
"Process an XYZ file of atomic coordinates and filter atoms via " 23 "threshold or map variable values.");
27 "variable",
"Variable from the mesh file to use for mapping to or filtering of the atoms.");
29 params.
addParam<
MooseEnum>(
"raster_mode", modeEnum,
"Rasterization mode (MAP|FILTER).");
31 "Accept atoms with a variable value above this threshold in FILTER mode.");
37 _xyz_input(getParam<FileName>(
"xyz_input")),
38 _xyz_output(getParam<FileName>(
"xyz_output")),
39 _variable(getParam<
std::string>(
"variable")),
40 _raster_mode(getParam<
MooseEnum>(
"raster_mode")),
46 mooseError(
"Please specify 'threshold' parameter for raster_mode = FILTER");
67 std::string line, dummy;
69 unsigned int current_line = 0;
70 unsigned int nfilter = 0, len0 = 0;
71 while (std::getline(stream_in, line))
76 stream_out << line <<
'\n';
80 if (current_line == 0)
85 std::istringstream iss(line);
87 if (iss >> dummy >>
x >>
y >> z)
96 stream_out << line <<
'\n';
113 std::ostringstream oss;
115 std::string newline0 = oss.str();
118 if (newline0.size() > len0)
120 mooseWarning(
"SolutionRasterizer could not update XYZ atom count in header.");
125 while (newline0.size() < len0)
129 std::ofstream stream_fix(
_xyz_output.c_str(), std::ios::binary | std::ios::in | std::ios::out);
130 stream_fix << newline0;
virtual void initialSetup()
Initialize the System and Mesh objects for the solution being read.
virtual void initialSetup() override
static InputParameters validParams()
SolutionRasterizer(const InputParameters ¶meters)
const std::vector< double > y
void mooseWarning(Args &&... args) const
bool isParamValid(const std::string &name) const
const std::vector< double > x
static InputParameters validParams()
registerMooseObject("PhaseFieldApp", SolutionRasterizer)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
This Userobject is the base class of Userobjects that generate one random number per timestep and qua...
void mooseError(Args &&... args) const
Real pointValue(Real t, const Point &p, const unsigned int local_var_index, const std::set< subdomain_id_type > *subdomain_ids=nullptr) const