/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Copyright (C) 2011-2018 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 . Application displacementField \*---------------------------------------------------------------------------*/ #include "fvCFD.H" #include "vectorList.H" #include #include #include #include #include // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // void findPairs(labelList &, labelList &, labelPairList &); void findPairsUnordered(labelList &, labelList &, labelPairList &); void fillEmptyCells(fvMesh &, label, label, scalarList &, volVectorField &, volVectorField &, scalarList &, volVectorField &, volVectorField &, bool, scalar); void nearestNeighborCells(fvMesh &, label, label, label, scalarList &, labelList &); void normalizeFields(scalarList &, volVectorField &, volVectorField &); void readDump(std::string, labelList &, scalarList &, vectorList &); scalar weightFun(scalar); label maxNumParticles = 1000000; scalar minVol = 1e-12; scalar Pi43 = 4.1888; label posIndex = -1; label posRad = -1; label posX = -1; label posY = -1; label posZ = -1; int main(int argc, char *argv[]) { argList::addOption ( "totalProcs", "label", "total number of parallel processes, defaults to 1" ); argList::addOption ( "thisProc", "label", "number of current process, defaults to 0" ); #include "setRootCase.H" #include "createTime.H" #include "createMesh.H" const label thisProc = args.optionLookupOrDefault("thisProc", 0); const label totalProcs = args.optionLookupOrDefault("totalProcs", 1); Info << "This is number " << thisProc << " of " << totalProcs << " processes." << endl; // user-defined input for each case IOdictionary displacementProperties ( IOobject ( "displacementProperties", mesh.time().constant(), mesh, IOobject::MUST_READ, IOobject::NO_WRITE ) ); label dumpIndexStart(readLabel(displacementProperties.lookup("dumpIndexStart"))); label dumpIndexEnd(readLabel(displacementProperties.lookup("dumpIndexEnd"))); label dumpIndexInputIncrement(readLabel(displacementProperties.lookup("dumpIndexInputIncrement"))); label dumpIndexDisplacementIncrement(readLabel(displacementProperties.lookup("dumpIndexDisplacementIncrement"))); label nNeighMin(readLabel(displacementProperties.lookup("nNeighMin"))); label maxSearchLayers(displacementProperties.lookupOrDefault