1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation, either version 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
26 #include "processorFaMeshes.H"
29 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
31 void Foam::processorFaMeshes::read()
33 forAll (fvMeshes_, procI)
38 new faMesh(fvMeshes_[procI])
41 pointProcAddressing_.set
48 "pointProcAddressing",
49 meshes_[procI].time().findInstance
51 meshes_[procI].meshDir(),
54 meshes_[procI].meshSubDir,
62 edgeProcAddressing_.set
70 meshes_[procI].time().findInstance
72 meshes_[procI].meshDir(),
75 meshes_[procI].meshSubDir,
83 faceProcAddressing_.set
91 meshes_[procI].time().findInstance
93 meshes_[procI].meshDir(),
96 meshes_[procI].meshSubDir,
104 boundaryProcAddressing_.set
111 "boundaryProcAddressing",
112 meshes_[procI].time().findInstance
114 meshes_[procI].meshDir(),
117 meshes_[procI].meshSubDir,
128 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
130 Foam::processorFaMeshes::processorFaMeshes
132 const PtrList<fvMesh>& processorFvMeshes
135 fvMeshes_(processorFvMeshes),
136 meshes_(processorFvMeshes.size()),
137 pointProcAddressing_(processorFvMeshes.size()),
138 edgeProcAddressing_(processorFvMeshes.size()),
139 faceProcAddressing_(processorFvMeshes.size()),
140 boundaryProcAddressing_(processorFvMeshes.size())
146 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
148 // Foam::fvMesh::readUpdateState Foam::processorFaMeshes::readUpdate()
150 // fvMesh::readUpdateState stat = fvMesh::UNCHANGED;
152 // forAll (databases_, procI)
154 // // Check if any new meshes need to be read.
155 // fvMesh::readUpdateState procStat = meshes_[procI].readUpdate();
158 // if (procStat != fvMesh::UNCHANGED)
160 // Info<< "Processor " << procI
161 // << " at time " << databases_[procI].timeName()
162 // << " detected mesh change " << procStat
167 // // Combine into overall mesh change status
168 // if (stat == fvMesh::UNCHANGED)
174 // if (stat != procStat)
176 // FatalErrorIn("processorFaMeshes::readUpdate()")
177 // << "Processor " << procI
178 // << " has a different polyMesh at time "
179 // << databases_[procI].timeName()
180 // << " compared to any previous processors." << nl
181 // << "Please check time " << databases_[procI].timeName()
182 // << " directories on all processors for consistent"
184 // << exit(FatalError);
191 // stat == fvMesh::TOPO_CHANGE
192 // || stat == fvMesh::TOPO_PATCH_CHANGE
195 // // Reread all meshes and addresssing
202 // void Foam::processorFaMeshes::reconstructPoints(fvMesh& mesh)
204 // // Read the field for all the processors
205 // PtrList<pointIOField> procsPoints(meshes_.size());
207 // forAll (meshes_, procI)
217 // meshes_[procI].time().timeName(),
218 // polyMesh::meshSubDir,
220 // IOobject::MUST_READ,
221 // IOobject::NO_WRITE
227 // // Create the new points
228 // vectorField newPoints(mesh.nPoints());
230 // forAll (meshes_, procI)
232 // const vectorField& procPoints = procsPoints[procI];
234 // // Set the cell values in the reconstructed field
236 // const labelList& pointProcAddressingI = pointProcAddressing_[procI];
238 // if (pointProcAddressingI.size() != procPoints.size())
240 // FatalErrorIn("processorFaMeshes")
242 // << " pointProcAddressingI:" << pointProcAddressingI.size()
243 // << " procPoints:" << procPoints.size()
244 // << abort(FatalError);
247 // forAll(pointProcAddressingI, pointI)
249 // newPoints[pointProcAddressingI[pointI]] = procPoints[pointI];
253 // mesh.movePoints(newPoints);
258 // ************************************************************************* //