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");
enum Time::stopAtControls waitForMaster() const
Wait for master to complete.
static void noFunctionObjects(bool addWithOption=false)
Remove '-noFunctionObjects' option and ignore any occurrences.
static void addNote(const string ¬e)
Add extra notes for the usage information.
void size(const label n)
Older name for setAddressableSize.
Encapsulates the logic for coordinating between OpenFOAM and an external application.
A class for handling file names.
enum Time::stopAtControls useSlave(const bool wait=false) const
Remove lock file to indicate that the external program is in charge.
label size() const noexcept
The number of data sets.
static scalar visLength
The length for visualization triangles.
errorManipArg< error, int > exit(error &err, const int errNo=1)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
quaternion::eulerOrder rotationOrder() const
The Euler-angle rotation order.
void writeDict(Ostream &os) const
Output as dictionary content.
void writePlain(Ostream &os) const
Output as plain content.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Output to file stream, using an OSstream.
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
static bool & parRun() noexcept
Test if this a parallel run.
static void addBoolOption(const word &optName, const string &usage="", bool advanced=false)
Add a bool option to validOptions with usage information.
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
"plain" is a simple ASCII format
T getOrDefault(const word &optName, const T &deflt) const
Get a value from the named option if present, or return default.
word outputName("finiteArea-edges.obj")
Provides a means of accumulating and generating VTK file series.
A class for handling words, derived from Foam::string.
static void addDryRunOption(const string &usage, bool advanced=false)
Enable a 'dry-run' bool option, with usage information.
const word & executable() const noexcept
Name of executable without the path.
int dryRun() const noexcept
Return the dry-run flag.
enum Time::stopAtControls useMaster(const bool wait=false) const
Create lock file to indicate that OpenFOAM is in charge.
static void addOption(const word &optName, const string ¶m="", const string &usage="", bool advanced=false)
Add an option to validOptions with usage information.
virtual void setTime(const Time &t)
Reset the time and time-index to those of the given time.
fileName resolveFile(const word &file) const
Return the file path in the communications directory.
static word printf(const char *fmt, const PrimitiveType &val)
Use a printf-style formatter for a primitive.
bool degrees() const
Rotation angles in degrees.
const word & constant() const noexcept
Return constant name.
OBJstream os(runTime.globalPath()/outputName)
void scalePoints(const scalar scaleFactor)
Scale points by given factor.
An instant of time. Contains the time value and name. Uses Foam::Time when formatting the name...
pointField points0(pointIOField(IOobject("points", mesh.time().constant(), polyMesh::meshSubDir, mesh, IOobject::MUST_READ, IOobject::NO_WRITE, IOobject::NO_REGISTER)))
T get(const label index) const
Get a value from the argument at index.
void relax(const scalar alpha, const lumpedPointState &prev)
Relax the state.
static void write(const fileName &base, const UList< instant > &series, const char sep='_')
Write file series (JSON format) to disk, for specified instances.
static autoPtr< lumpedPointIOMovement > New(const objectRegistry &obr, label ownerId=-1)
Create a movement object in the registry by reading system dictionary.
static void addArgument(const string &argName, const string &usage="")
Append a (mandatory) argument to validArgs.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
bool readIfPresent(const word &optName, T &val) const
Read a value from the named option if present.
Foam::argList args(argc, argv)
A primitive field of type <T> with automated input and output.
bool found(const word &optName) const
Return true if the named option is found.
The state of lumped points corresponds to positions and rotations.
bool append(const fileNameInstant &inst)
Append the specified file instant.