/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see .
Application
lumpedPointMovement
Description
This utility can be used to produce VTK files to visualize the response
points/rotations and the corresponding movement of the building surfaces.
Uses the tabulated responses from the specified file.
Optionally, it can also be used to a dummy responder for the
externalFileCoupler logic, which makes it useful as a debugging facility
as well demonstrating how an external application could communicate
with the lumpedPointMovement point-patch boundary condition.
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "Time.H"
#include "OFstream.H"
#include "foamVtkSeriesWriter.H"
#include "lumpedPointTools.H"
#include "lumpedPointIOMovement.H"
using namespace Foam;
inline List getResponseTable
(
const fileName& file,
const lumpedPointState& state0
)
{
return lumpedPointTools::lumpedPointStates
(
file,
state0.rotationOrder(),
state0.degrees()
);
}
void echoTableLimits
(
const List& tbl,
const label span,
const label maxOut
)
{
Info<< "Using response table with " << tbl.size() << " entries" << nl;
if (span)
{
Info<< "Increment input by " << span << nl;
}
if (maxOut)
{
Info<< "Stopping after " << maxOut << " outputs" << nl;
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
argList::addNote
(
"Visualize lumpedPoint movements or provide a slave responder"
" for diagnostic purposes."
);
argList::noFunctionObjects(); // Never use function objects
argList::addOption
(
"max",
"N",
"Maximum number of outputs"
);
argList::addOption
(
"span",
"N",
"Increment each input by N (default: 1)"
);
argList::addOption
(
"scale",
"factor",
"Relaxation/scaling factor for movement (default: 1)"
);
argList::addOption
(
"visual-length",
"len",
"Visualization length for planes (visualized as triangles)"
);
argList::addDryRunOption
(
"Test movement without a mesh"
);
argList::addBoolOption
(
"removeLock",
"Remove lock-file on termination of slave"
);
argList::addBoolOption
(
"slave",
"Invoke as a slave responder for testing"
);
argList::addArgument("responseFile");
#include "setRootCase.H"
const label maxOut = Foam::max(0, args.getOrDefault