Go to the documentation of this file.
73 Info<<
"Using response table with " << tbl.size() <<
" entries" <<
nl;
77 Info<<
"Increment input by " << span <<
nl;
82 Info<<
"Stopping after " << maxOut <<
" outputs" <<
nl;
89 int main(
int argc,
char *argv[])
93 "Visualize lumpedPoint movements or provide a slave responder"
94 " for diagnostic purposes."
102 "Maximum number of outputs"
108 "Increment each input by N (default: 1)"
114 "Relaxation/scaling factor for movement (default: 1)"
120 "Visualization length for planes (visualized as triangles)"
124 "Test movement without a mesh"
129 "Remove lock-file on termination of slave"
134 "Invoke as a slave responder for testing"
146 const bool removeLock =
args.
found(
"removeLock");
160 Info<<
"Running as slave responder" <<
endl;
165 <<
"Running as slave responder is not permitted in parallel"
178 Info<<
"No valid movement found" <<
endl;
181 auto& movement = *movementPtr;
187 getResponseTable(responseFile, state0);
189 echoTableLimits(responseTable, span, maxOut);
193 Info<<
"dry-run: response table with " << responseTable.size()
195 <<
"\nEnd\n" <<
endl;
203 label timei = 0, outputCount = 0;
204 timei < responseTable.size();
214 <<
": stopping status=done was detected" <<
endl;
225 movement.inputFormat()
238 <<
": updated to state " << timei
239 <<
" - switch to master"
247 if (maxOut && outputCount >= maxOut)
250 <<
": stopping after " << maxOut <<
" outputs" <<
endl;
274 Info<<
"dry-run: creating states only" <<
nl;
284 Info<<
"No valid movement found" <<
endl;
287 auto& movement = *movementPtr;
293 getResponseTable(responseFile, state0);
295 echoTableLimits(responseTable, span, maxOut);
302 label timei = 0, outputCount = 0;
303 timei < responseTable.size();
309 state += movement.origin();
313 Info<<
"output [" << timei <<
'/' << responseTable.size() <<
']';
330 if (maxOut && outputCount >= maxOut)
332 Info<<
"Max output " << maxOut <<
" ... stopping" <<
endl;
339 if (stateSeries.
size())
341 Info<<
nl <<
"write state.vtp.series" <<
nl;
342 stateSeries.
write(
"state.vtp");
366 Info<<
"No valid movement found" <<
endl;
369 auto& movement = *movementPtr;
375 getResponseTable(responseFile, state0);
377 echoTableLimits(responseTable, span, maxOut);
384 Info<<
"No point patches with lumped movement found" <<
endl;
388 Info<<
"Lumped point patch controls set on "
399 movement.writeVTP(
"geom_init.vtp", state0,
mesh,
points0);
405 label timei = 0, outputCount = 0;
406 timei < responseTable.size();
412 state += movement.origin();
416 Info<<
"output [" << timei <<
'/' << responseTable.size() <<
']';
443 if (maxOut && outputCount >= maxOut)
445 Info<<
"Max output " << maxOut <<
" ... stopping" <<
endl;
453 if (geomSeries.
size())
455 Info<<
nl <<
"write geom.vtp.series" <<
nl;
456 geomSeries.
write(
"geom.vtp");
458 if (stateSeries.
size())
460 Info<<
nl <<
"write state.vtp.series" <<
nl;
461 stateSeries.
write(
"state.vtp");
A class for handling words, derived from Foam::string.
void writeDict(Ostream &os) const
A class for handling file names.
A primitive field of type <T> with automated input and output.
T getOrDefault(const word &optName, const T &deflt) const
void relax(const scalar alpha, const lumpedPointState &prev)
enum Time::stopAtControls useMaster(const bool wait=false) const
static void addNote(const string ¬e)
Ostream & endl(Ostream &os)
enum Time::stopAtControls waitForMaster() const
T get(const label index) const
bool readIfPresent(const word &optName, T &val) const
@ PLAIN
"plain" is a simple ASCII format
static void addArgument(const string &argName, const string &usage="")
word outputName("finiteArea-edges.obj")
The state of lumped points corresponds to positions and rotations.
static void noFunctionObjects(bool addWithOption=false)
void scalePoints(const scalar scaleFactor)
int dryRun() const noexcept
void writePlain(Ostream &os) const
quaternion::eulerOrder rotationOrder() const
label max(const labelHashSet &set, label maxValue=labelMin)
fileName resolveFile(const word &file) const
OBJstream os(runTime.globalPath()/outputName)
Provides a means of accumulating and generating VTK file series.
static void write(const fileName &base, const UList< instant > &series, const char sep='_')
static void addDryRunOption(const string &usage, bool advanced=false)
errorManipArg< error, int > exit(error &err, const int errNo=1)
Output to file stream, using an OSstream.
enum Time::stopAtControls useSlave(const bool wait=false) const
static void addBoolOption(const word &optName, const string &usage="", bool advanced=false)
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
pointField points0(pointIOField(IOobject("points", mesh.time().constant(), polyMesh::meshSubDir, mesh, IOobject::MUST_READ, IOobject::NO_WRITE, false)))
Encapsulates the logic for coordinating between OpenFOAM and an external application.
#define FatalErrorInFunction
label size() const noexcept
const word & executable() const noexcept
static bool & parRun() noexcept
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
virtual void setTime(const Time &t)
Ostream & writeEntry(const keyType &key, const T &value)
static word printf(const char *fmt, const PrimitiveType &val)
bool append(const fileNameInstant &inst)
An instant of time. Contains the time value and name.
const word & constant() const
static void addOption(const word &optName, const string ¶m="", const string &usage="", bool advanced=false)
Foam::argList args(argc, argv)
static autoPtr< lumpedPointIOMovement > New(const objectRegistry &obr, label ownerId=-1)
bool found(const word &optName) const