// Sync mesh update with changes on other processors void Foam::polyMesh::syncUpdateMesh() { // Update zones. Since boundary depends on zones, they need to be // updated first. HJ, 20/May/2014 pointZones_.updateMesh(); faceZones_.updateMesh(); cellZones_.updateMesh(); // Update boundaryMesh (note that patches themselves already ok) boundary_.updateMesh(); // Clear out parallel data. HJ, 27/Nov/2009 deleteDemandDrivenData(globalMeshDataPtr_); setInstance(time().timeName()); // Reset valid directions (could change by faces put into empty patches) geometricD_ = Vector<label>::zero; solutionD_ = Vector<label>::zero; // Update all function objects // Moved from fvMesh.C in 1.6.x merge. HJ, 29/Aug/2010 // Instantiate a dummy mapPolyMesh autoPtr<mapPolyMesh> mapPtr(new mapPolyMesh(*this)); meshObjectBase::allUpdateTopology<polyMesh>(*this, mapPtr()); }
// Inplace add mesh1 to mesh0 Foam::autoPtr<Foam::mapAddedPolyMesh> Foam::fvMeshAdder::add ( fvMesh& mesh0, const fvMesh& mesh1, const faceCoupleInfo& coupleInfo, const bool validBoundary ) { mesh0.clearOut(); // Resulting merged mesh (polyMesh only!) autoPtr<mapAddedPolyMesh> mapPtr ( polyMeshAdder::add ( mesh0, mesh1, coupleInfo, validBoundary ) ); // Adjust the fvMesh part. const polyBoundaryMesh& patches = mesh0.boundaryMesh(); fvBoundaryMesh& fvPatches = const_cast<fvBoundaryMesh&>(mesh0.boundary()); fvPatches.setSize(patches.size()); forAll(patches, patchI) { fvPatches.set(patchI, fvPatch::New(patches[patchI], fvPatches)); }
Map::Ptr TiledMapLoader::loadMap(const std::string &mapFile, const std::string &mapPath) { Map::Ptr mapPtr(new Map); changeCurrentDirectory(mapPath); std::ifstream in(mapFile); std::string fileContentString; if (in.fail()) { throw std::logic_error("File not found: " + mapPath + "/" + mapFile); } fileContentString.assign(std::istreambuf_iterator<char>(in), std::istreambuf_iterator<char>()); fileContentString.push_back(0); loadInternalMap(*mapPtr.get(), &fileContentString[0]); restoreCurrentDirectory(); return std::move(mapPtr); }
void Value::clear() { switch (mType) { case Type_String: stringPtr()->~String(); break; case Type_Map: mapPtr()->~Map<String, Value>(); break; case Type_List: listPtr()->~List<Value>(); break; case Type_Custom: customPtr()->~shared_ptr<Custom>(); break; default: break; } mType = Type_Invalid; }