Files
OpenFOAM-12/applications/utilities/mesh/manipulation/moveMesh/moveMesh.C
Henry Weller f0d3be60da utilities: Updated moveMesh -> setPoints
Mesh manipulation utilities do not need to generate or use mesh-motion fluxes so
it is more efficient to use setPoints rather than moveMesh.
2022-06-14 14:09:06 +01:00

81 lines
2.3 KiB
C++

/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
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 <http://www.gnu.org/licenses/>.
Application
moveMesh
Description
Solver for moving meshes.
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "Time.H"
#include "fvMesh.H"
#include "motionSolver.H"
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "createTime.H"
#include "createMeshNoChangers.H"
IOdictionary dynamicMeshDict
(
IOobject
(
"dynamicMeshDict",
mesh.time().constant(),
mesh,
IOobject::MUST_READ
)
);
autoPtr<motionSolver> motionPtr =
motionSolver::New("motionSolver", mesh, dynamicMeshDict);
while (runTime.loop())
{
Info<< "Time = " << runTime.userTimeName() << endl;
mesh.setPoints(motionPtr->newPoints());
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
}
Info<< "End\n" << endl;
return 0;
}
// ************************************************************************* //