motionSolver.C
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include "motionSolver.H"
00028 #include "Time.H"
00029 #include "polyMesh.H"
00030 #include "dlLibraryTable.H"
00031
00032
00033
00034 namespace Foam
00035 {
00036 defineTypeNameAndDebug(motionSolver, 0);
00037 defineRunTimeSelectionTable(motionSolver, dictionary);
00038 }
00039
00040
00041
00042 Foam::motionSolver::motionSolver(const polyMesh& mesh)
00043 :
00044 IOdictionary
00045 (
00046 IOobject
00047 (
00048 "dynamicMeshDict",
00049 mesh.time().constant(),
00050 mesh,
00051 IOobject::MUST_READ,
00052 IOobject::NO_WRITE
00053 )
00054 ),
00055 mesh_(mesh),
00056 twoDPointCorrector_(mesh)
00057 {}
00058
00059
00060
00061
00062 Foam::autoPtr<Foam::motionSolver> Foam::motionSolver::New(const polyMesh& mesh)
00063 {
00064 IOdictionary solverDict
00065 (
00066 IOobject
00067 (
00068 "dynamicMeshDict",
00069 mesh.time().constant(),
00070 mesh,
00071 IOobject::MUST_READ,
00072 IOobject::NO_WRITE,
00073 false
00074 )
00075 );
00076
00077 Istream& msData = solverDict.lookup("solver");
00078
00079 word solverTypeName(msData);
00080
00081 Info << "Selecting motion solver: " << solverTypeName << endl;
00082
00083 dlLibraryTable::open
00084 (
00085 solverDict,
00086 "motionSolverLibs",
00087 dictionaryConstructorTablePtr_
00088 );
00089
00090 if (!dictionaryConstructorTablePtr_)
00091 {
00092 FatalErrorIn
00093 (
00094 "motionSolver::New(const polyMesh& mesh)"
00095 ) << "solver table is empty"
00096 << exit(FatalError);
00097 }
00098
00099 dictionaryConstructorTable::iterator cstrIter =
00100 dictionaryConstructorTablePtr_->find(solverTypeName);
00101
00102 if (cstrIter == dictionaryConstructorTablePtr_->end())
00103 {
00104 FatalErrorIn
00105 (
00106 "motionSolver::New(const polyMesh& mesh)"
00107 ) << "Unknown solver type " << solverTypeName
00108 << endl << endl
00109 << "Valid solver types are: " << endl
00110 << dictionaryConstructorTablePtr_->toc()
00111 << exit(FatalError);
00112 }
00113
00114 return autoPtr<motionSolver>(cstrIter()(mesh, msData));
00115 }
00116
00117
00118
00119
00120 Foam::motionSolver::~motionSolver()
00121 {}
00122
00123
00124
00125
00126 Foam::tmp<Foam::pointField> Foam::motionSolver::newPoints()
00127 {
00128 solve();
00129 return curPoints();
00130 }
00131
00132
00133 void Foam::motionSolver::twoDCorrectPoints(pointField& p) const
00134 {
00135 twoDPointCorrector_.correctPoints(p);
00136 }
00137
00138
00139 void Foam::motionSolver::updateMesh(const mapPolyMesh& mpm)
00140 {
00141 twoDPointCorrector_.updateMesh();
00142 }
00143
00144
00145
Copyright © 2000-2009 OpenCFD Ltd