diff --git a/applications/solvers/discreteMethods/molecularDynamics/mdEquilibrationFoam/mdEquilibrationFoam.C b/applications/solvers/discreteMethods/molecularDynamics/mdEquilibrationFoam/mdEquilibrationFoam.C index f2ddf13741..c3ae69847d 100644 --- a/applications/solvers/discreteMethods/molecularDynamics/mdEquilibrationFoam/mdEquilibrationFoam.C +++ b/applications/solvers/discreteMethods/molecularDynamics/mdEquilibrationFoam/mdEquilibrationFoam.C @@ -39,6 +39,20 @@ int main(int argc, char *argv[]) # include "createTime.H" # include "createMesh.H" + Info<< "\nReading field U\n" << endl; + volVectorField U + ( + IOobject + ( + "U", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + potential pot(mesh); moleculeCloud molecules(mesh, pot); diff --git a/applications/solvers/discreteMethods/molecularDynamics/mdFoam/mdFoam.C b/applications/solvers/discreteMethods/molecularDynamics/mdFoam/mdFoam.C index 3aa2532c3e..ade0895a2a 100644 --- a/applications/solvers/discreteMethods/molecularDynamics/mdFoam/mdFoam.C +++ b/applications/solvers/discreteMethods/molecularDynamics/mdFoam/mdFoam.C @@ -39,6 +39,20 @@ int main(int argc, char *argv[]) # include "createTime.H" # include "createMesh.H" + Info<< "\nReading field U\n" << endl; + volVectorField U + ( + IOobject + ( + "U", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + potential pot(mesh); moleculeCloud molecules(mesh, pot); diff --git a/src/lagrangian/molecularDynamics/molecule/Make/files b/src/lagrangian/molecularDynamics/molecule/Make/files index a8a36e5967..9086ba7ffa 100644 --- a/src/lagrangian/molecularDynamics/molecule/Make/files +++ b/src/lagrangian/molecularDynamics/molecule/Make/files @@ -1,24 +1,9 @@ -interactionLists = interactionLists -referredMolecule = $(interactionLists)/referredMolecule -referredCellList = $(interactionLists)/referredCellList -referredCell = $(interactionLists)/referredCell -directInteractionList = $(interactionLists)/directInteractionList +reducedUnits/reducedUnits.C +reducedUnits/reducedUnitsIO.C -$(referredCellList)/referredCellList.C -$(referredCell)/referredCell.C -$(referredMolecule)/referredMolecule.C -$(directInteractionList)/directInteractionList.C -$(interactionLists)/interactionLists.C +molecule/molecule.C +molecule/moleculeIO.C -reducedUnits = reducedUnits -$(reducedUnits)/reducedUnits.C -$(reducedUnits)/reducedUnitsIO.C - -molecule = molecule -$(molecule)/molecule.C -$(molecule)/moleculeIO.C - -moleculeCloud = moleculeCloud -$(moleculeCloud)/moleculeCloud.C +moleculeCloud/moleculeCloud.C LIB = $(FOAM_LIBBIN)/libmolecule diff --git a/src/lagrangian/molecularDynamics/molecule/Make/options b/src/lagrangian/molecularDynamics/molecule/Make/options index 9354036e6f..1bdb57a0d0 100644 --- a/src/lagrangian/molecularDynamics/molecule/Make/options +++ b/src/lagrangian/molecularDynamics/molecule/Make/options @@ -1,11 +1,13 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/lagrangian/basic/lnInclude \ -I$(LIB_SRC)/lagrangian/molecularDynamics/potential/lnInclude \ -I$(LIB_SRC)/lagrangian/molecularDynamics/molecularMeasurements/lnInclude EXE_LIBS = \ -lfiniteVolume \ + -lmeshTools \ -llagrangian \ -lpotential \ -lmolecularMeasurements diff --git a/src/lagrangian/molecularDynamics/molecule/interactionLists/directInteractionList/directInteractionList.C b/src/lagrangian/molecularDynamics/molecule/interactionLists/directInteractionList/directInteractionList.C deleted file mode 100644 index da9511daf5..0000000000 --- a/src/lagrangian/molecularDynamics/molecule/interactionLists/directInteractionList/directInteractionList.C +++ /dev/null @@ -1,346 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. - \\/ 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 . - -\*---------------------------------------------------------------------------*/ - -#include "directInteractionList.H" -#include "interactionLists.H" - -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // - -void Foam::directInteractionList::buildDirectInteractionList -( - bool pointPointListBuild -) -{ - Info<< nl << "Building list of direct interaction neighbours" << endl; - - const polyMesh& mesh(il_.mesh()); - - List > directInteractionList(mesh.nCells()); - - if (pointPointListBuild) - { - Info<< tab << "Point-Point direct interaction list build." << endl; - - label pointJIndex; - - forAll(mesh.points(), pointIIndex) - { - for - ( - pointJIndex = pointIIndex; - pointJIndex != mesh.points().size(); - ++pointJIndex - ) - { - if (il_.testPointPointDistance(pointIIndex, pointJIndex)) - { - const labelList& ptICells - ( - mesh.pointCells()[pointIIndex] - ); - - const labelList& ptJCells - ( - mesh.pointCells()[pointJIndex] - ); - - forAll(ptICells, pIC) - { - const label cellI(ptICells[pIC]); - - forAll(ptJCells, pJC) - { - const label cellJ(ptJCells[pJC]); - - if (cellJ > cellI) - { - if - ( - findIndex - ( - directInteractionList[cellI], - cellJ - ) - == -1 - ) - { - directInteractionList[cellI].append(cellJ); - } - } - - if (cellI > cellJ) - { - if - ( - findIndex - ( - directInteractionList[cellJ], - cellI - ) - == - -1 - ) - { - directInteractionList[cellJ].append(cellI); - } - } - } - } - } - } - } - } - else - { - Info<< tab << "Point-Face, Edge-Edge direct interaction list build." - << endl; - - forAll(mesh.points(), p) - { - forAll(mesh.faces(), f) - { - if (il_.testPointFaceDistance(p, f)) - { - const labelList& pCells(mesh.pointCells()[p]); - - const label cellO(mesh.faceOwner()[f]); - - forAll(pCells, pC) - { - const label cellI(pCells[pC]); - - // cells are not added to their own DIL - - if (cellO > cellI) - { - if - ( - findIndex - ( - directInteractionList[cellI], - cellO - ) - == - -1 - ) - { - directInteractionList[cellI].append(cellO); - } - } - - if (cellI > cellO) - { - if - ( - findIndex - ( - directInteractionList[cellO], - cellI - ) - == - -1 - ) - { - directInteractionList[cellO].append(cellI); - } - } - - if (mesh.isInternalFace(f)) - { - // boundary faces will not have neighbour - // information - - const label cellN(mesh.faceNeighbour()[f]); - - if (cellN > cellI) - { - if - ( - findIndex - ( - directInteractionList[cellI], - cellN - ) - == - -1 - ) - { - directInteractionList[cellI].append(cellN); - } - } - - if (cellI > cellN) - { - if - ( - findIndex - ( - directInteractionList[cellN], - cellI - ) - == - -1 - ) - { - directInteractionList[cellN].append(cellI); - } - } - } - } - } - } - } - - label edgeJIndex; - - forAll(mesh.edges(), edgeIIndex) - { - const edge& eI(mesh.edges()[edgeIIndex]); - - for - ( - edgeJIndex = edgeIIndex + 1; - edgeJIndex != mesh.edges().size(); - ++edgeJIndex - ) - { - const edge& eJ(mesh.edges()[edgeJIndex]); - - if (il_.testEdgeEdgeDistance(eI, eJ)) - { - const labelList& eICells(mesh.edgeCells()[edgeIIndex]); - - const labelList& eJCells(mesh.edgeCells()[edgeJIndex]); - - forAll(eICells, eIC) - { - const label cellI(eICells[eIC]); - - forAll(eJCells, eJC) - { - const label cellJ(eJCells[eJC]); - - if (cellJ > cellI) - { - if - ( - findIndex - ( - directInteractionList[cellI], - cellJ - ) - == - -1 - ) - { - directInteractionList[cellI].append(cellJ); - } - } - - if (cellI > cellJ) - { - if - ( - findIndex - ( - directInteractionList[cellJ], - cellI - ) - == - -1 - ) - { - directInteractionList[cellJ].append(cellI); - } - } - } - } - } - } - } - } - - forAll(directInteractionList, transDIL) - { - (*this)[transDIL].transfer - ( - directInteractionList[transDIL].shrink() - ); - } - - // sorting DILs - - forAll((*this), dIL) - { - sort((*this)[dIL]); - } -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::directInteractionList::directInteractionList -( - const interactionLists& il, - bool pointPointListBuild -) -: - labelListList(il.mesh().nCells()), - il_(il) -{ - if ((*this).size() > 1) - { - buildDirectInteractionList(pointPointListBuild); - } - else if ((*this).size() == 1) - { - Info<< nl - << "Single cell mesh, no direct interaction lists required." - << endl; - - (*this)[0].setSize(0); - } -} - - -Foam::directInteractionList::directInteractionList -( - const interactionLists& il -) -: - labelListList(il.mesh().nCells()), - il_(il) -{ - Info<< "Read directInteractionList from disk not implemented" << endl; -} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::directInteractionList::~directInteractionList() -{} - - -// ************************************************************************* // diff --git a/src/lagrangian/molecularDynamics/molecule/interactionLists/directInteractionList/directInteractionList.H b/src/lagrangian/molecularDynamics/molecule/interactionLists/directInteractionList/directInteractionList.H deleted file mode 100644 index 1c7c6272ee..0000000000 --- a/src/lagrangian/molecularDynamics/molecule/interactionLists/directInteractionList/directInteractionList.H +++ /dev/null @@ -1,124 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. - \\/ 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 . - -Class - Foam::directInteractionList - -Description - -SourceFiles - directInteractionListI.H - directInteractionList.C - -\*---------------------------------------------------------------------------*/ - -#ifndef directInteractionList_H -#define directInteractionList_H - -#include "polyMesh.H" -#include "List.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// Forward declaration of classes -class interactionLists; - -/*---------------------------------------------------------------------------*\ - Class directInteractionList Declaration -\*---------------------------------------------------------------------------*/ - -class directInteractionList -: - public labelListList -{ - // Private data - - const interactionLists& il_; - - - // Private Member Functions - - void buildDirectInteractionList - ( - bool pointPointListBuild - ); - - //- Disallow default bitwise copy construct - directInteractionList(const directInteractionList&); - - //- Disallow default bitwise assignment - void operator=(const directInteractionList&); - - -public: - - // Constructors - - //- Construct lists by searching the mesh - directInteractionList - ( - const interactionLists& il, - bool pointPointListBuild - ); - - //- Construct from file - directInteractionList - ( - const interactionLists& il - ); - - - //- Destructor - ~directInteractionList(); - - - // Member Functions - - // Access - - inline const interactionLists& il() const; - - - // IOstream Operators - - friend Istream& operator>>(Istream&, directInteractionList&); - friend Ostream& operator<<(Ostream&, const directInteractionList&); -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "directInteractionListI.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/molecularDynamics/molecule/interactionLists/directInteractionList/directInteractionListI.H b/src/lagrangian/molecularDynamics/molecule/interactionLists/directInteractionList/directInteractionListI.H deleted file mode 100644 index 41b30a8ab1..0000000000 --- a/src/lagrangian/molecularDynamics/molecule/interactionLists/directInteractionList/directInteractionListI.H +++ /dev/null @@ -1,34 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. - \\/ 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 . - -\*---------------------------------------------------------------------------*/ - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -inline const Foam::interactionLists& Foam::directInteractionList::il() const -{ - return il_; -} - - -// ************************************************************************* // diff --git a/src/lagrangian/molecularDynamics/molecule/interactionLists/interactionLists.C b/src/lagrangian/molecularDynamics/molecule/interactionLists/interactionLists.C deleted file mode 100644 index c9e7a6aa4e..0000000000 --- a/src/lagrangian/molecularDynamics/molecule/interactionLists/interactionLists.C +++ /dev/null @@ -1,691 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. - \\/ 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 . - -\*---------------------------------------------------------------------------*/ - -#include "interactionLists.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -Foam::scalar Foam::interactionLists::transTol = 1e-12; - - -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // - -void Foam::interactionLists::buildCellReferralLists() -{ - Info<< nl << "Determining molecule referring schedule" << endl; - - const referredCellList& refIntL(ril()); - - DynamicList