diff --git a/.gitignore b/.gitignore index decd85b32..dd3b2d803 100644 --- a/.gitignore +++ b/.gitignore @@ -133,4 +133,12 @@ src/lduSolvers/amg/amgPolicy/samgPolicy.H src/lduSolvers/amg/amgPolicy/aamgPolicy.C src/lduSolvers/amg/amgPolicy/aamgPolicy.H +# The following files are blacklisted because of a DMCA complaint by ANSYS. +src/lduSolvers/tools/PriorityArray.C +src/lduSolvers/tools/PriorityArray.H +src/lduSolvers/amg/amgPolicy/samgPolicy.C +src/lduSolvers/amg/amgPolicy/samgPolicy.H +src/lduSolvers/amg/amgPolicy/aamgPolicy.C +src/lduSolvers/amg/amgPolicy/aamgPolicy.H + # end-of-file diff --git a/applications/solvers/equationReader/equationReaderDemo/Make/files b/applications/solvers/equationReader/equationReaderDemo/Make/files new file mode 100644 index 000000000..e27a623a6 --- /dev/null +++ b/applications/solvers/equationReader/equationReaderDemo/Make/files @@ -0,0 +1,3 @@ +equationReaderDemo.C + +EXE = $(FOAM_APPBIN)/equationReaderDemo diff --git a/applications/solvers/equationReader/equationReaderDemo/Make/options b/applications/solvers/equationReader/equationReaderDemo/Make/options new file mode 100644 index 000000000..e69de29bb diff --git a/applications/solvers/equationReader/equationReaderDemo/equationReaderDemo.C b/applications/solvers/equationReader/equationReaderDemo/equationReaderDemo.C new file mode 100644 index 000000000..263201aed --- /dev/null +++ b/applications/solvers/equationReader/equationReaderDemo/equationReaderDemo.C @@ -0,0 +1,171 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Application + equationReaderDemo + +Description + Sample application testing the equationReader extension, and demonstrating + its use. + +Author + David L. F. Gaden + +\*---------------------------------------------------------------------------*/ + + +#include "argList.H" +#include "IFstream.H" +#include "OFstream.H" +#include "equationReader.H" + +using namespace Foam; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + +int main(int argc, char *argv[]) +{ +# include "setRootCase.H" + + fileName path(args.rootPath()/args.caseName()); + + // Create dictionary + Info << "Reading testDict dictionary" << token::NL << endl; + IFstream tfIF(path/"testDict"); + const dictionary testDict(tfIF); + + // Demonstrate stand-alone operation + Info << "Begin stand-alone operation..." << endl; + + Info << "Reading a scalar... "; + scalar readSa(readScalar(testDict.lookup("standAloneScalar"))); + Info << "done. Result = " << readSa << endl; + Info << "Reading a dimensionedScalar ... "; + dimensionedScalar readDSa(testDict.lookup("standAloneDScalar")); + Info << "done. Result = " << readDSa << token::NL << endl; + + // Create the equationReader object + Info << "Creating the equationReader object" << token::NL << endl; + equationReader eqns; + + // Demonstrate giving data sources to equationReader + // -First create the data sources + Info << "Creating data sources: dictionary ptrs... "; + IFstream tfIF2(path/"testDict2"); + const dictionary testDict2(tfIF2); + IFstream tfIF3(path/"testDict3"); + const dictionary testDict3(tfIF3); + Info << "scalars... "; + scalar Sa(0.1); + scalar Sb(0.2); + scalar Sc(0.3); + Info << "dimensionedScalar ptrs... "; + dimensionedScalar DSa("DSa", dimless, 1); + dimensionedScalar DSb("DSb", dimless, 2); + dimensionedScalar DSc("DSc", dimless, 3); + Info << "output dimensionedScalar ptrs... "; + dimensionedScalar passiveOutA("passiveOutA", dimless, 0); + dimensionedScalar activeOutB("activeOutB", dimless, 0); + dimensionedScalar passiveOutC("passiveOutC", dimless, 0); + dimensionedScalar passiveOutD("passiveOutD", dimless, 0); + dimensionedScalar passiveOutF("passiveOutF", dimless, 0); + Info << "done." << endl; + + Info << "Linking in the data sources: dictionary ptrs... "; + eqns.addDataSource(testDict); + eqns.addDataSource(testDict2); + eqns.addDataSource(testDict3); + + Info << "dimensionedScalar ptrs... "; + eqns.addDataSource(DSa); + eqns.addDataSource(DSb); + eqns.addDataSource(DSc); + + Info << "scalar ptrs... "; + eqns.addDataSource(Sa, "Sa"); + eqns.addDataSource(Sb, "Sb"); + eqns.addDataSource(Sc, "Sc"); + Info << "done." << token::NL << endl; + + // Demonstrate passive output + Info << "Reading equation a from testDict with no output variable" << endl; + eqns.readEquation(testDict, "a"); + + Info << "Evaluating equation a ... "; + passiveOutA = eqns.evaluate("a"); + Info << "done. Result = " << passiveOutA << token::NL << endl; + + // Demonstrate active output + Info << "Reading equation b from testDict, linking an output variable" + << endl; + eqns.readEquation(testDict, "b", activeOutB); + + Info << "Output variable before update() = " << activeOutB << endl; + Info << "Begining .update() - this evaluates all equations with active " + << "output..." << endl; + eqns.update(); + Info << "Done. Output variable after update() = " << activeOutB + << token::NL << endl; + + // Demonstrating variable dependence + Info << "Equation c depends on equation a. Reading it will link them." + << endl; + Info << "Reading equation c from testDict... "; + eqns.readEquation(testDict, "c"); + Info << "done." << endl; + Info << "Evaluating c will force an evaluate of a." << endl; + Info << "Evaluating ... "; + passiveOutC = eqns.evaluate("c"); + Info << "done. Result = " << passiveOutC << token::NL << endl; + + // Demonstrate on-the-fly equation creation + Info << "Equation d depends on equation e, but equation e is never " + << "explicitly " << endl << "read by equationReaderDemo. Reading equation" + << " d will automatically " << endl << "create equation e on-the-fly. " + << endl; + Info << "Reading equation d from testDict ... "; + eqns.readEquation(testDict, "d"); + Info << "done." << endl << "Again, evaluating d will force an evaluate of " + << "e." << endl; + Info << "Evaluating d ... "; + passiveOutD = eqns.evaluate("d"); + Info << "done. The result is = " << passiveOutD << token::NL << endl; + + // Demonstrate dependence + Info << "Equations can draw from any sources added to equationReader." << endl; + Info << "Equation f is very complex, drawing from numerous sources." << endl; + Info << "Reading equation f ... "; + eqns.readEquation(testDict, "f"); + Info << "done. Evaluating equation f ... "; + passiveOutF = eqns.evaluate("f"); + Info << "done." << token::NL << "The result is: " << passiveOutF << endl; + + Info << token::NL << "Creating output..." << endl; + OFstream os(path/"outputDict"); + os << eqns; + eqns.dataSourceStatus(os); + + return(0); +} diff --git a/applications/solvers/equationReader/equationReaderTester/Make/files b/applications/solvers/equationReader/equationReaderTester/Make/files new file mode 100644 index 000000000..5fb77c325 --- /dev/null +++ b/applications/solvers/equationReader/equationReaderTester/Make/files @@ -0,0 +1,3 @@ +equationReaderTester.C + +EXE = $(FOAM_APPBIN)/equationReaderTester diff --git a/applications/solvers/equationReader/equationReaderTester/Make/options b/applications/solvers/equationReader/equationReaderTester/Make/options new file mode 100644 index 000000000..0a3a4b653 --- /dev/null +++ b/applications/solvers/equationReader/equationReaderTester/Make/options @@ -0,0 +1,6 @@ +EXE_INC = \ + -I$(LIB_SRC)/finiteVolume/lnInclude + +EXE_LIBS = \ + -lfiniteVolume \ + diff --git a/applications/solvers/equationReader/equationReaderTester/createFields.H b/applications/solvers/equationReader/equationReaderTester/createFields.H new file mode 100644 index 000000000..bd1a2bbe3 --- /dev/null +++ b/applications/solvers/equationReader/equationReaderTester/createFields.H @@ -0,0 +1,74 @@ + Info<< "Reading transportProperties\n" << endl; + + IOdictionary transportProperties + ( + IOobject + ( + "transportProperties", + runTime.constant(), + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ); + + dimensionedScalar nu + ( + transportProperties.lookup("nu") + ); + + Info<< "Reading field p\n" << endl; + volScalarField p + ( + IOobject + ( + "p", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + + Info<< "Creating dummy field\n" << endl; + volScalarField dummy + ( + IOobject + ( + "dummy", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + p + ); + dummy.dimensions().reset(dimless); + Info << "Dummy name " << dummy.name() << endl; + forAll(dummy, i) + { + dummy[i] = i; + } + + Info<< "Reading field U\n" << endl; + volVectorField U + ( + IOobject + ( + "U", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + + +# include "createPhi.H" + + + label pRefCell = 0; + scalar pRefValue = 0.0; + setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue); diff --git a/applications/solvers/equationReader/equationReaderTester/equationReaderTester.C b/applications/solvers/equationReader/equationReaderTester/equationReaderTester.C new file mode 100644 index 000000000..becb0cc04 --- /dev/null +++ b/applications/solvers/equationReader/equationReaderTester/equationReaderTester.C @@ -0,0 +1,357 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Application + equationReaderTester + +Description + Sample application testing the equationReader in a finite volume solver + environment. + +Author + David L. F. Gaden + +\*---------------------------------------------------------------------------*/ + + +#include "argList.H" +#include "IFstream.H" +#include "IOEquationReader.H" +#include "fvCFD.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ + +# include "setRootCase.H" + +# include "createTime.H" +# include "createMesh.H" +# include "createFields.H" +# include "initContinuityErrs.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + fileName path(args.rootPath()/args.caseName()); + + // Create the equationReader object + Info << "Creating the equationReader object" << token::NL << endl; + IOEquationReader eqns + ( + IOobject + ( + "eqns", + runTime.timeName(), + runTime, + IOobject::READ_IF_PRESENT, + IOobject::AUTO_WRITE + ), + true + ); + + // Create dictionaries + Info << "Reading testDict dictionaries" << token::NL << endl; + IFstream tfIF1(path/"testDict1"); + const dictionary testDict1(tfIF1); + IFstream tfIF2(path/"testDict2"); + const dictionary testDict2(tfIF2); + IFstream tfIF3(path/"testDict3"); + const dictionary testDict3(tfIF3); + IFstream tfIF4(path/"testDict4"); + const dictionary testDict4(tfIF4); + IFstream tfIF5(path/"testDict5"); + const dictionary testDict5(tfIF5); + IFstream tfIF6(path/"testDict6"); + const dictionary testDict6(tfIF6); + IFstream tfIF7(path/"testDict7"); + const dictionary testDict7(tfIF7); + IFstream tfIF8(path/"testDict8"); + const dictionary testDict8(tfIF8); + IFstream tfIF9(path/"testDict9"); + const dictionary testDict9(tfIF9); + IFstream tfIF10(path/"testDict10"); + const dictionary testDict10(tfIF10); + scalar Sa(0.1); + scalar Sb(0.2); + scalar Sc(0.3); + scalar Sd(0.4); + scalar Se(0.5); + scalar Sf(0.6); + scalar Sg(0.7); + scalar Sh(0.8); + scalar Si(0.9); + scalar Sj(0.10); + scalar Sk(0.11); + scalar Sl(0.12); + dimensionedScalar DSa("DSa", dimless, 1); + dimensionedScalar DSb("DSb", dimless, 2); + dimensionedScalar DSc("DSc", dimless, 3); + dimensionedScalar DSd("DSd", dimless, 4); + dimensionedScalar DSe("DSe", dimless, 5); + dimensionedScalar DSf("DSf", dimless, 6); + dimensionedScalar DSg("DSg", dimless, 7); + dimensionedScalar DSh("DSh", dimless, 8); + dimensionedScalar DSi("DSi", dimless, 9); + dimensionedScalar DSj("DSj", dimless, 10); + dimensionedScalar DSk("DSk", dimless, 11); + dimensionedScalar DSl("DSl", dimless, 12); + dimensionedScalar DSm("DSm", dimless, 13); + dimensionedScalar DSn("DSn", dimless, 14); + dimensionedScalar DSo("DSo", dimless, 15); + dimensionedScalar DStime("DStime", dimless, 0); + dimensionedScalar Aa("Aa", dimless, 0); + dimensionedScalar Ab("Ab", dimless, 0); + dimensionedScalar Ac("Ac", dimless, 0); + dimensionedScalar Ad("Ad", dimless, 0); + dimensionedScalar Ae("Ae", dimless, 0); + dimensionedScalar Af("Af", dimless, 0); + dimensionedScalar Pa("Pa", dimless, 0); + dimensionedScalar Pb("Pb", dimless, 0); + dimensionedScalar Pc("Pc", dimless, 0); + dimensionedScalar Pd("Pd", dimless, 0); + dimensionedScalar Pe("Pe", dimless, 0); + dimensionedScalar Pf("Pf", dimless, 0); + + eqns.addDataSource(testDict1); + eqns.addDataSource(testDict2); + eqns.addDataSource(testDict3); + eqns.addDataSource(testDict4); + eqns.addDataSource(testDict5); + eqns.addDataSource(testDict6); + eqns.addDataSource(testDict7); + eqns.addDataSource(testDict8); + eqns.addDataSource(testDict9); + eqns.addDataSource(testDict10); + + eqns.addDataSource(DSa); + eqns.addDataSource(DSb); + eqns.addDataSource(DSc); + eqns.addDataSource(DSd); + eqns.addDataSource(DSe); + eqns.addDataSource(DSf); + eqns.addDataSource(DSg); + eqns.addDataSource(DSh); + eqns.addDataSource(DSi); + eqns.addDataSource(DSj); + eqns.addDataSource(DSk); + eqns.addDataSource(DSl); + eqns.addDataSource(DSm); + eqns.addDataSource(DSn); + eqns.addDataSource(DSo); + eqns.addDataSource(DStime); + + eqns.addDataSource(Sa, "Sa"); + eqns.addDataSource(Sb, "Sb"); + eqns.addDataSource(Sc, "Sc"); + eqns.addDataSource(Sd, "Se"); + eqns.addDataSource(Se, "Sd"); + eqns.addDataSource(Sf, "Sf"); + eqns.addDataSource(Sg, "Sg"); + eqns.addDataSource(Sh, "Sh"); + eqns.addDataSource(Si, "Si"); + eqns.addDataSource(Sj, "Sj"); + eqns.addDataSource(Sk, "Sk"); + eqns.addDataSource(Sl, "Sl"); + + label listIndex(0); + eqns.addDataSource(p); + eqns.addDataSource(dummy); + eqns.setListIndex(listIndex); + + eqns.readEquation(testDict1, "Pa"); + eqns.readEquation(testDict1, "Pb"); + eqns.readEquation(testDict1, "Pc"); + eqns.readEquation(testDict1, "Pd"); + eqns.readEquation(testDict1, "Pe"); + eqns.readEquation(testDict1, "Pf"); + + eqns.readEquation(testDict1, "Aa", Aa); + eqns.readEquation(testDict1, "Ab", Ab); + eqns.readEquation(testDict1, "Ac", Ac); + eqns.readEquation(testDict1, "Ad", Ad); + eqns.readEquation(testDict1, "Ae", Ae); + eqns.readEquation(testDict1, "Af", Af); + eqns.readEquation(testDict1, "nu", nu); + + scalar saA(readScalar(testDict1.lookup("saA"))); + scalar saB(readScalar(testDict1.lookup("saB"))); + scalar saC(readScalar(testDict1.lookup("saC"))); + scalar saD(readScalar(testDict1.lookup("saD"))); + scalar saE(readScalar(testDict1.lookup("saE"))); + scalar saF(readScalar(testDict1.lookup("saF"))); + + dimensionedScalar dsaA(testDict1.lookup("dsaA")); + dimensionedScalar dsaB(testDict1.lookup("dsaB")); + dimensionedScalar dsaC(testDict1.lookup("dsaC")); + dimensionedScalar dsaD(testDict1.lookup("dsaD")); + dimensionedScalar dsaE(testDict1.lookup("dsaE")); + dimensionedScalar dsaF(testDict1.lookup("dsaF")); + + Info << "Stand-alone test:" << endl; + Info << "saA = " << saA << endl; + Info << "saB = " << saB << endl; + Info << "saC = " << saC << endl; + Info << "saD = " << saD << endl; + Info << "saE = " << saE << endl; + Info << "saF = " << saF << endl; + + Info << "dsaA = " << dsaA << endl; + Info << "dsaB = " << dsaB << endl; + Info << "dsaC = " << dsaC << endl; + Info << "dsaD = " << dsaD << endl; + Info << "dsaE = " << dsaE << endl; + Info << "dsaF = " << dsaF << endl; + + Info << "Pa is at index " << eqns.lookup("Pa") << endl; + Info << "Pb is at index " << eqns.lookup("Pb") << endl; + Info << "Pc is at index " << eqns.lookup("Pc") << endl; + Info << "Pd is at index " << eqns.lookup("Pd") << endl; + Info << "Pe is at index " << eqns.lookup("Pe") << endl; + Info << "Pf is at index " << eqns.lookup("Pf") << endl; + Info << "Aa is at index " << eqns.lookup("Aa") << endl; + Info << "Ab is at index " << eqns.lookup("Ab") << endl; + Info << "Ac is at index " << eqns.lookup("Ac") << endl; + Info << "Ad is at index " << eqns.lookup("Ad") << endl; + Info << "Ae is at index " << eqns.lookup("Ae") << endl; + Info << "Af is at index " << eqns.lookup("Af") << endl; + Info << "nu is at index " << eqns.lookup("nu") << endl; + + Info<< "\nStarting time loop\n" << endl; + + for (runTime++; !runTime.end(); runTime++) + { + Info<< "Time = " << runTime.timeName() << nl << endl; + DStime.value() = runTime.value(); + + Info << "Moving p index to "; + listIndex++; + if (listIndex == p.size()) + { + listIndex = 0; + } + Info << listIndex << "..." << endl; + eqns.setListIndex(listIndex); + + Info << "Passive reread..." << endl; + eqns.readEquation(testDict1, "Pa"); + eqns.readEquation(testDict1, "Pb"); + eqns.readEquation(testDict1, "Pc"); + + Info << "Active reread..." << endl; + eqns.readEquation(testDict1, "Aa", Aa); + eqns.readEquation(testDict1, "Ab", Ab); + eqns.readEquation(testDict1, "Ac", Ac); + + Info << "Updating active equations..." << endl; + eqns.update(); + Info << "Aa = " << Aa << endl; + Info << "Ab = " << Ab << endl; + Info << "Ac = " << Ac << endl; + Info << "Ad = " << Ad << endl; + Info << "Ae = " << Ae << endl; + Info << "Af = " << Af << endl; + Info << "nu = " << nu << endl; + + Info << "Evaluating passive equations: Pa, "; + Pa = eqns.evaluate("Pa"); + Info << "Pb, "; + Pb = eqns.evaluate("Pb"); + Info << "Pc, "; + Pc = eqns.evaluate("Pc"); + Info << "Pd, "; + Pe = eqns.evaluate("Pd"); + Info << "Pe, "; + Pd = eqns.evaluate("Pe"); + Info << "Pf." << endl; + Pf = eqns.evaluate("Pf"); + + Info << "Pa = " << Pa << endl; + Info << "Pb = " << Pb << endl; + Info << "Pc = " << Pc << endl; + Info << "Pd = " << Pd << endl; + Info << "Pe = " << Pe << endl; + Info << "Pf = " << Pf << endl; + +# include "readPISOControls.H" +# include "CourantNo.H" + + fvVectorMatrix UEqn + ( + fvm::ddt(U) + + fvm::div(phi, U) + - fvm::laplacian(nu, U) + ); + + solve(UEqn == -fvc::grad(p)); + + // --- PISO loop + + for (int corr=0; corr> *this; + close(); + } +} + + +// * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * * // + +Foam::IOEquationReader::~IOEquationReader() +{} + + +// * * * * * * * * * * * * * * * Members Functions * * * * * * * * * * * * * // + +const Foam::word& Foam::IOEquationReader::name() const +{ + return regIOobject::name(); +} + + +// ************************************************************************* // diff --git a/src/OpenFOAM/db/IOobjects/IOEquationReader/IOEquationReader.H b/src/OpenFOAM/db/IOobjects/IOEquationReader/IOEquationReader.H new file mode 100644 index 000000000..1b21c2d64 --- /dev/null +++ b/src/OpenFOAM/db/IOobjects/IOEquationReader/IOEquationReader.H @@ -0,0 +1,116 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::IOEquationReader + +Description + IOEquationReader is an equationReader with IOobject functionality for easy + input and output. Originally created so equations can be written out at + every timestep if desired. + +SourceFiles + IOEquationReader.C + IOEquationReaderIO.C + +\*---------------------------------------------------------------------------*/ + +#ifndef IOEquationReader_H +#define IOEquationReader_H + +#include "equationReader.H" +#include "regIOobject.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class IOEquationReader Declaration +\*---------------------------------------------------------------------------*/ + +class IOEquationReader +: + public regIOobject, + public equationReader +{ + + // Private member data + + //- Output flag - true = include data source info in output file + bool showDataSourceInfo_; + +public: + + TypeName("equationReader"); + + + // Constructors + + //- Construct given an IOobject. When true, showDataSourceInfo causes + // IOequationReader to include the dataSource info in its output file, + // even though it cannot read this data. + IOEquationReader + ( + const IOobject&, + const bool showDataSourceInfo = false + ); + + + // Destructor + + virtual ~IOEquationReader(); + + + // Member functions + + //- Access showDataSourceInfo flag + inline bool& showDataSourceInfo() + { + return showDataSourceInfo_; + } + + //- Name function is needed to disambiguate those inherited + // from regIOobject and dictionary + const word& name() const; + + //- ReadData function required for regIOobject read operation + virtual bool readData(Istream&); + + //- WriteData function required for regIOobject write operation + virtual bool writeData(Ostream&) const; + +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/OpenFOAM/db/IOobjects/IOEquationReader/IOEquationReaderIO.C b/src/OpenFOAM/db/IOobjects/IOEquationReader/IOEquationReaderIO.C new file mode 100644 index 000000000..1eb0eef35 --- /dev/null +++ b/src/OpenFOAM/db/IOobjects/IOEquationReader/IOEquationReaderIO.C @@ -0,0 +1,58 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "IOEquationReader.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +bool IOEquationReader::readData(Istream& is) +{ + is >> *this; + return !is.bad(); +} + + +bool IOEquationReader::writeData(Ostream& os) const +{ + os << *this; + if (showDataSourceInfo_) + { + dataSourceStatus(os); + } + return os.good(); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/OpenFOAM/db/dictionary/equation/equation/equation.C b/src/OpenFOAM/db/dictionary/equation/equation/equation.C new file mode 100644 index 000000000..c76594166 --- /dev/null +++ b/src/OpenFOAM/db/dictionary/equation/equation/equation.C @@ -0,0 +1,98 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "equation.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +const char* const Foam::equation::typeName = "equation"; + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::equation::equation() +: + equationName_(word::null), + rawText_(""), + lastResult_(word::null, dimless, 0), + overrideDimensions_(dimless), + changeDimensions_(false) +{ +// internalScalars_ = new scalarList(0); + setSize(0); +} + + +Foam::equation::equation(Istream& is, const word& name) +: + equationName_(name), + rawText_(""), + lastResult_(word::null, dimless, 0), + overrideDimensions_(dimless), + changeDimensions_(false) +{ +// internalScalars_ = new scalarList(0); + operator>>(is, *this); +} + + +Foam::equation::equation +( + const Foam::word& equationName, + const Foam::string& rawText, + const Foam::dimensionSet& overrideDimensions, + const bool& changeDimensions +) +: + equationName_(equationName), + rawText_(rawText), + lastResult_(equationName, dimless, 0), + overrideDimensions_(overrideDimensions), + changeDimensions_(changeDimensions) +{ +// internalScalars_ = new scalarList(0); + setSize(0); +} + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::equation::~equation() +{} + +// * * * * * * * * * * * * * * * * * Operators * * * * * * * * * * * * * * * // + +void Foam::equation::operator=(Foam::equation& eqn) +{ + equationName_ = eqn.equationName_; + rawText_ = eqn.rawText_; +// this->operations() = eqn.operations(); + overrideDimensions_.reset(eqn.overrideDimensions_); + changeDimensions_ = eqn.changeDimensions_; +} + + + +// ************************************************************************* // diff --git a/src/OpenFOAM/db/dictionary/equation/equation/equation.H b/src/OpenFOAM/db/dictionary/equation/equation/equation.H new file mode 100644 index 000000000..0aaa1024a --- /dev/null +++ b/src/OpenFOAM/db/dictionary/equation/equation/equation.H @@ -0,0 +1,199 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::equation + +Description + An equation, read from a dictionary. Effectively just a container class + holding all data associated with an individual equation. Functions are + implemented in masterDictionary. + +SourceFiles + equationI.H + equation.C + equationIO.C + +Author + David L. F. Gaden + +\*---------------------------------------------------------------------------*/ + +#ifndef equation_H +#define equation_H + +#include "equationOperationList.H" +//#include "dimensionedScalar.H" +#include "scalarList.H" +#include "dimensionSet.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of friend functions and operators + +class equation; + +// Friend IOstream Operators + +Istream& operator>>(Istream&, equation&); +Ostream& operator<<(Ostream&, const equation&); + +/*---------------------------------------------------------------------------*\ + Class equation Declaration +\*---------------------------------------------------------------------------*/ + +class equation +: + public equationOperationList +{ + + // Private data + + word equationName_; + + //- raw text read from the dictionary + string rawText_; + + //- Result of most recent evaluate() or update() + dimensionedScalar lastResult_; + + //- Constants appearing in the equation are stored here +// scalarList * internalScalars_; + + //- Names of variables that need to be read from a dictionary are + // stored here +// wordList dictLookups_; + + //- Override dimensions - if read from a dictionary with dimensions, + // eg: nu nu [0 2 -1 0 0 0 0] "sin(theta)"; + // the dimensionedScalar resulting from evaluate() is given these + // dimensions + dimensionSet overrideDimensions_; + + //- true if there is a dimension override + bool changeDimensions_; + +public: + + // Static data members + + static const char* const typeName; + + + // Constructors + + //- Construct null + equation(); + + //- Construct from Istream with optional name + equation(Istream& is, const word& name = word::null); + + //- Construct from components + equation + ( + const word& equationName, + const string& rawText, + const dimensionSet& overrideDimensions = dimless, + const bool& changeDimensions = false + ); + + // Destructor + ~equation(); + + // Member functions + + // Access + + //- Equation name + inline const word& equationName() const; + + //- Change the equation name + inline word& equationName(); + + //- Equation text + inline const string& rawText() const; + + //- Set the equation text + inline string& rawText(); + + //- Last result + inline const dimensionedScalar& lastResult() const; + + //- Set the last result + inline dimensionedScalar& lastResult(); + + //- Easy access to operations + inline const equationOperationList& ops() const; + + inline equationOperationList& ops(); + + //- Locally stored constants +// inline const scalarList * internalScalars() const; + + //- Set the locally stored constants +// inline scalarList * internalScalars(); + + //- Dictionary variable lookup names +// inline const wordList& dictLookups() const; + + //- Set the dictionary variable lookup names +// inline wordList& dictLookups(); + + //- Dimension override + inline const dimensionSet& overrideDimensions() const; + + //- Set the dimension override + inline dimensionSet& overrideDimensions(); + + //- changeDimensions flag + inline const bool& changeDimensions() const; + + //- Set the changeDimensions flag + inline bool& changeDimensions(); + + // Operators + // Copy only the header info - rawText, equationName, dimensionOverride + // and changeDimensions + void operator=(equation&); + + // Friend IOstream Operators + + friend Istream& operator>>(Istream&, equation&); + friend Ostream& operator<<(Ostream&, const equation&); + +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "equationI.H" + +#endif diff --git a/src/OpenFOAM/db/dictionary/equation/equation/equationI.H b/src/OpenFOAM/db/dictionary/equation/equation/equationI.H new file mode 100644 index 000000000..551a4bb13 --- /dev/null +++ b/src/OpenFOAM/db/dictionary/equation/equation/equationI.H @@ -0,0 +1,126 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +inline const word& equation::equationName() const +{ + return equationName_; +} + + +inline word& equation::equationName() +{ + return equationName_; +} + + +inline const string& equation::rawText() const +{ + return rawText_; +} + + +inline string& equation::rawText() +{ + return rawText_; +} + + +inline const dimensionedScalar& equation::lastResult() const +{ + return lastResult_; +} + + +inline dimensionedScalar& equation::lastResult() +{ + return lastResult_; +} + + +inline const equationOperationList& equation::ops() const +{ + const equationOperationList& oplist(*this); + return oplist; +} + +inline equationOperationList& equation::ops() +{ + equationOperationList& opList(*this); + return opList; +} + +/*inline const scalarList * equation::internalScalars() const +{ + return internalScalars_; +} + +inline scalarList * equation::internalScalars() +{ + return internalScalars_; +}*/ + +/*inline const wordList& equation::dictLookups() const +{ + return dictLookups_; +} + +inline wordList& equation::dictLookups() +{ + return dictLookups_; +}*/ + +inline const dimensionSet& equation::overrideDimensions() const +{ + return overrideDimensions_; +} + + +inline dimensionSet& equation::overrideDimensions() +{ + return overrideDimensions_; +} + + +inline const bool& equation::changeDimensions() const +{ + return changeDimensions_; +} + + +inline bool& equation::changeDimensions() +{ + return changeDimensions_; +} + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/db/dictionary/equation/equation/equationIO.C b/src/OpenFOAM/db/dictionary/equation/equation/equationIO.C new file mode 100644 index 000000000..98ab60471 --- /dev/null +++ b/src/OpenFOAM/db/dictionary/equation/equation/equationIO.C @@ -0,0 +1,109 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "equation.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +// * * * * * * * * * * * * * Friend IOstream Operators * * * * * * * * * * * // + +Foam::Istream& Foam::operator>>(Istream& is, equation& I) +{ + // Acceptable istream formats: + // scalar; + // string; + // [dimensionSet] scalar; + // [dimensionSet] string; + // name [dimensionSet] scalar; + // name [dimensionSet] string; + + if (I.equationName_ == word::null) + { + I.equationName_ = "fromIstream"; + } + + token t(is); + if (t.isString()) + { + I.rawText_ = t.stringToken(); + } + else if (t.isNumber()) + { + I.rawText_ = string(name(t.number())); + } + else if (t.isPunctuation()) + { + is.putBack(t); + I.changeDimensions_ = true; + I.overrideDimensions_.reset(dimensionSet(is)); + token t2(is); + if (t2.isString()) + { + is.putBack(t2); + I.rawText_ = string(is); + } + else // number + { + I.rawText_ = string(name(t.number())); + } + } + else if (t.isWord()) + { + word garbage(t.wordToken()); + I.changeDimensions_ = true; + I.overrideDimensions_.reset(dimensionSet(is)); + token t2(is); + if (t2.isString()) + { + is.putBack(t2); + I.rawText_ = string(is); + } + else // number + { + I.rawText_ = string(name(t.number())); + } + } + return is; +} + + +Foam::Ostream& Foam::operator<<(Ostream& os, const equation& I) +{ + if (I.changeDimensions_) + { + os << I.overrideDimensions_ << token::TAB + << I.rawText_; + } + else + { + os << I.rawText_; + } + return os; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +// ************************************************************************* // diff --git a/src/OpenFOAM/db/dictionary/equation/equation/equationList.H b/src/OpenFOAM/db/dictionary/equation/equation/equationList.H new file mode 100644 index 000000000..912d4f53f --- /dev/null +++ b/src/OpenFOAM/db/dictionary/equation/equation/equationList.H @@ -0,0 +1,53 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Typedef + Foam::equationList + +Description + List of equations + +Author + David L. F. Gaden + +\*---------------------------------------------------------------------------*/ + +#ifndef equationList_H +#define equationList_H + +#include "equation.H" +#include "List.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + typedef PtrList equationList; +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/OpenFOAM/db/dictionary/equation/equationOperation/equationOperation.C b/src/OpenFOAM/db/dictionary/equation/equationOperation/equationOperation.C new file mode 100644 index 000000000..a15d0a64e --- /dev/null +++ b/src/OpenFOAM/db/dictionary/equation/equationOperation/equationOperation.C @@ -0,0 +1,553 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "dimensionedScalar.H" +#include "equationReader.H" +#include "equationOperation.H" +//#include "equationOperationList.H" + +class dimensionedScalar; + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +const char* const Foam::equationOperation::typeName = "equationOperation"; + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::equationOperation::equationOperation() +{} + + +Foam::equationOperation::equationOperation +( + sourceListType sourceList, + label sourceIndex, + label dictLookupIndex, + operationType operation, + dimensionedScalar (Foam::equationReader::*getSourceFunction) + ( + equationReader *, + const label, + const label, + const label, + const label + ), + void (Foam::equationReader::*opFunction) + ( + equationReader *, + const label, + const label, + const label, + label&, + dimensionedScalar&, + dimensionedScalar + ) +) +: + sourceList_(sourceList), + sourceIndex_(sourceIndex), + dictLookupIndex_(dictLookupIndex), + operation_(operation), + getSourceFunction_(getSourceFunction), + opFunction_(opFunction) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::equationOperation::~equationOperation() +{} + +// * * * * * * * * * * * * * * Member functions * * * * * * * * * * * * * * // +Foam::equationOperation::operationType + Foam::equationOperation::findOp(const Foam::word& opName) +{ + if (opName == "retrieve") + { + return otretrieve; + } + else if (opName == "store") + { + return otstore; + } + else if (opName == "plus") + { + return otplus; + } + else if (opName == "minus") + { + return otminus; + } + else if (opName == "times") + { + return ottimes; + } + else if (opName == "divide") + { + return otdivide; + } + else if (opName == "pow") + { + return otpow; + } + else if (opName == "sign") + { + return otsign; + } + else if (opName == "pos") + { + return otpos; + } + else if (opName == "neg") + { + return otneg; + } + else if (opName == "mag") + { + return otmag; + } + else if (opName == "limit") + { + return otlimit; + } + else if (opName == "minMod") + { + return otminMod; + } + else if (opName == "sqrtSumSqr") + { + return otsqrtSumSqr; + } + else if (opName == "sqr") + { + return otsqr; + } + else if (opName == "pow3") + { + return otpow3; + } + else if (opName == "pow4") + { + return otpow4; + } + else if (opName == "pow5") + { + return otpow5; + } + else if (opName == "inv") + { + return otinv; + } + else if (opName == "sqrt") + { + return otsqrt; + } + else if (opName == "cbrt") + { + return otcbrt; + } + else if (opName == "hypot") + { + return othypot; + } + else if (opName == "exp") + { + return otexp; + } + else if (opName == "log") + { + return otlog; + } + else if (opName == "log10") + { + return otlog10; + } + else if (opName == "sin") + { + return otsin; + } + else if (opName == "cos") + { + return otcos; + } + else if (opName == "tan") + { + return ottan; + } + else if (opName == "asin") + { + return otasin; + } + else if (opName == "acos") + { + return otacos; + } + else if (opName == "atan") + { + return otatan; + } + else if (opName == "sinh") + { + return otsinh; + } + else if (opName == "cosh") + { + return otcosh; + } + else if (opName == "tanh") + { + return ottanh; + } + else if (opName == "asinh") + { + return otasinh; + } + else if (opName == "acosh") + { + return otacosh; + } + else if (opName == "atanh") + { + return otatanh; + } + else if (opName == "erf") + { + return oterf; + } + else if (opName == "erfc") + { + return oterfc; + } + else if (opName == "lgamma") + { + return otlgamma; + } + else if (opName == "j0") + { + return otj0; + } + else if (opName == "j1") + { + return otj1; + } + else if (opName == "jn") + { + return otjn; + } + else if (opName == "y0") + { + return oty0; + } + else if (opName == "y1") + { + return oty1; + } + else if (opName == "yn") + { + return otyn; + } + else if (opName == "max") + { + return otmax; + } + else if (opName == "min") + { + return otmin; + } + else if (opName == "stabilise") + { + return otstabilise; + } + else + { + return otnone; + } +} + + +Foam::word Foam::equationOperation::opName +( + const Foam::equationOperation::operationType& op +) +{ + switch (op) + { + case otnone: + return "none"; + case otretrieve: + return "retrieve"; + case otstore: + return "store"; + case otplus: + return "plus"; + case otminus: + return "minus"; + case ottimes: + return "times"; + case otdivide: + return "divide"; + case otpow: + return "pow"; + case otsign: + return "sign"; + case otpos: + return "pos"; + case otneg: + return "neg"; + case otmag: + return "mag"; + case otlimit: + return "limit"; + case otminMod: + return "minMod"; + case otsqrtSumSqr: + return "sqrtSumSqr"; + case otsqr: + return "sqr"; + case otpow3: + return "pow3"; + case otpow4: + return "pow4"; + case otpow5: + return "pow5"; + case otinv: + return "inv"; + case otsqrt: + return "sqrt"; + case otcbrt: + return "cbrt"; + case othypot: + return "hypot"; + case otexp: + return "exp"; + case otlog: + return "log"; + case otlog10: + return "log10"; + case otsin: + return "sin"; + case otcos: + return "cos"; + case ottan: + return "tan"; + case otasin: + return "asin"; + case otacos: + return "acos"; + case otatan: + return "atan"; + case otsinh: + return "sinh"; + case otcosh: + return "cosh"; + case ottanh: + return "tanh"; + case otasinh: + return "asinh"; + case otacosh: + return "acosh"; + case otatanh: + return "atanh"; + case oterf: + return "erf"; + case oterfc: + return "erfc"; + case otlgamma: + return "lgamma"; + case otj0: + return "j0"; + case otj1: + return "j1"; + case otjn: + return "jn"; + case oty0: + return "y0"; + case oty1: + return "y1"; + case otyn: + return "yn"; + case otmax: + return "max"; + case otmin: + return "min"; + case otstabilise: + return "stabilise"; + } +} + + +Foam::word Foam::equationOperation::sourceName +( + const Foam::equationOperation::sourceListType& sl +) +{ + switch (sl) + { + case slnone: + return "none"; + case sldictSource: + return "dictionary"; + case slexternalDScalar: + return "dimensionedScalar"; + case slexternalScalar: + return "scalar"; + case slexternalScalarList: + return "scalarList"; + case slinternalScalar: + return "constant"; + case slequation: + return "equation"; + case slstorage: + return "memory"; + } +} + + +void Foam::equationOperation::assignSourceFunction +( + dimensionedScalar (Foam::equationReader::*getSourceFunction) + ( + equationReader *, + const label, + const label, + const label, + const label + ) +) +{ + getSourceFunction_ = getSourceFunction; +} + + +void Foam::equationOperation::assignOpFunction +( + void (Foam::equationReader::*opFunction) + ( + equationReader *, + const label, + const label, + const label, + label&, + dimensionedScalar&, + dimensionedScalar + ) +) +{ + opFunction_ = opFunction; +} + + +Foam::dimensionedScalar Foam::equationOperation::getSourceFunction +( + equationReader * eqnReader, + const label equationIndex, + const label equationOperationIndex, + const label maxStoreIndex, + const label storageOffset +) +{ + return (eqnReader->*getSourceFunction_) + ( + eqnReader, + equationIndex, + equationOperationIndex, + maxStoreIndex, + storageOffset + ); +} + + +void Foam::equationOperation::opFunction +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storageIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + (eqnReader->*opFunction_) + ( + eqnReader, + index, + i, + storageOffset, + storageIndex, + ds, + source + ); +} + + +// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * // + +int Foam::operator==(const equationOperation& I1, const equationOperation& I2) +{ + return + ( + I1.sourceList() == I2.sourceList() + && I1.sourceIndex() == I2.sourceIndex() + && I1.dictLookupIndex() == I2.dictLookupIndex() + && I1.operation() == I2.operation() + ); +} + + +int Foam::operator!=(const equationOperation& I1, const equationOperation& I2) +{ + // Invert the '==' operator ('0'='false') + return I1 == I2 ? 0 : 1; +} + + +// * * * * * * * * * * * * * Friend IOstream Operators * * * * * * * * * * * // + +Foam::Istream& Foam::operator>>(Istream& is, equationOperation& I) +{ + label sl(I.sourceList_); + label op(I.operation_); + + is >> sl >> I.sourceIndex_ >> I.dictLookupIndex_ >> op; + return is; +} + + +Foam::Ostream& Foam::operator<<(Ostream& os, const equationOperation& I) +{ + label sl(I.sourceList_); + label op(I.operation_); + + return os << nl << "/* sourceList: */\t" << sl << nl + << "/* sourceIndex:*/\t" << I.sourceIndex_ << nl + << "/* dictIndex */\t" << I. dictLookupIndex_ << nl + << "/* operation: */\t" << op << nl; +} + + +// ************************************************************************* // diff --git a/src/OpenFOAM/db/dictionary/equation/equationOperation/equationOperation.H b/src/OpenFOAM/db/dictionary/equation/equationOperation/equationOperation.H new file mode 100644 index 000000000..71bdd2393 --- /dev/null +++ b/src/OpenFOAM/db/dictionary/equation/equationOperation/equationOperation.H @@ -0,0 +1,342 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::equationOperation + +Description + Defines a single operation to be performed in sequence while evaluating an + equation read from a dictionary. + +SourceFiles + equationOperationI.H + equationOperation.C + +Author + David L. F. Gaden + +\*---------------------------------------------------------------------------*/ + +#ifndef equationOperation_H +#define equationOperation_H + +#include "word.H" +#include "label.H" +#include "IOstreams.H" +#include "dimensionedScalar.H" +// #include "Istream.H" +// #include "Ostream.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of friend functions and operators + +class equationOperation; +class equationReader; + +// Friend Operators + +int operator==(const equationOperation&, const equationOperation&); +int operator!=(const equationOperation&, const equationOperation&); + +// Friend IOstream Operators + +Istream& operator>>(Istream&, equationOperation&); +Ostream& operator<<(Ostream&, const equationOperation&); + + + +/*---------------------------------------------------------------------------*\ + Class equationOperation Declaration +\*---------------------------------------------------------------------------*/ + +class equationOperation +{ + +public: + + enum sourceListType + { + slnone, + sldictSource, + slexternalDScalar, + slexternalScalar, + slexternalScalarList, + slinternalScalar, + slequation, + slstorage + }; + + enum operationType + { + otnone, + otretrieve, + otstore, + otplus, + otminus, + ottimes, + otdivide, + otpow, + otsign, + otpos, + otneg, + otmag, + otlimit, + otminMod, + otsqrtSumSqr, + otsqr, + otpow3, + otpow4, + otpow5, + otinv, + otsqrt, + otcbrt, + othypot, + otexp, + otlog, + otlog10, + otsin, + otcos, + ottan, + otasin, + otacos, + otatan, + otsinh, + otcosh, + ottanh, + otasinh, + otacosh, + otatanh, + oterf, + oterfc, + otlgamma, + otj0, + otj1, + otjn, + oty0, + oty1, + otyn, + otmax, + otmin, + otstabilise + }; + +private: + + // List to read the data from + sourceListType sourceList_; + + // Index in the list where the data is located. Note, the + // equationOperationLists created by equationReader make this variable a + // 1-indexed (i.e. starts from 1, not zero) in order to use its sign to + // store the sign of the variable. The sourceLists are zero-indexed, so + // equationReader will constantly be adding / subtracting 1 to get these + // to match + label sourceIndex_; + + // Rather than store the keywords that have to be searched in a dictionary, + // equationReader keeps its own list of keywords, and the dictLookupIndex + // is the index in this list. This is only applicable if the sourceList is + // of type sldictSource + label dictLookupIndex_; + + // The operation to be performed (+ - sin exp min, etc...) + operationType operation_; + + // A pointer to the source data retrieval function + dimensionedScalar (Foam::equationReader::*getSourceFunction_) + ( + equationReader * eqnReader, + const label equationIndex, + const label equationOperationIndex, + const label maxStoreIndex, + const label storageOffset + ); + + // A pointer to the operation to be performed + void (Foam::equationReader::*opFunction_) + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storageIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + +public: + + // Static data members + + static const char* const typeName; + + // Constructors + + //- Construct null + equationOperation(); + + //- Construct from components + equationOperation + ( + sourceListType sourceList, + label sourceIndex, + label dictLookupIndex, + operationType operation, + dimensionedScalar (Foam::equationReader::*getSourceFunction) + ( + equationReader *, + const label, + const label, + const label, + const label + ) = NULL, + void (Foam::equationReader::*opFunction) + ( + equationReader *, + const label, + const label, + const label, + label&, + dimensionedScalar&, + dimensionedScalar + ) = NULL + ); + + + // Destructor + ~equationOperation(); + + // Member functions + + // Access + + //- Const access to source list + inline const sourceListType& sourceList() const; + + //- Access to source list + inline sourceListType& sourceList(); + + //- Const access to source index + inline const label& sourceIndex() const; + + //- Access to source index + inline label& sourceIndex(); + + //- Const access to dictionary lookup name index + inline const label& dictLookupIndex() const; + + //- Access to dictionary lookup name index + inline label& dictLookupIndex(); + + //- Const access to operation + inline const operationType& operation() const; + + //- Access to operation + inline operationType& operation(); + + // Function pointers + + //- Assign the operation function + void assignSourceFunction + ( + dimensionedScalar (Foam::equationReader::*getSourceFunction) + ( + equationReader *, + const label, + const label, + const label, + const label + ) + ); + + void assignOpFunction + ( + void (Foam::equationReader::*opFunction) + ( + equationReader *, + const label, + const label, + const label, + label&, + dimensionedScalar&, + dimensionedScalar + ) + ); + + //- Call the getSource function + dimensionedScalar getSourceFunction + ( + equationReader * eqnReader, + const label equationIndex, + const label equationOperationIndex, + const label maxStoreIndex, + const label storageOffset + ); + + //- Call the operation function + void opFunction + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storageIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + // Convenience + + //- Look up operation number, given a word + static operationType findOp(const word& opName); + + //- Look up operation name + static word opName(const operationType& op); + + //- Look up sourceList name + static word sourceName(const sourceListType& sl); + + + // Friend IOstream Operators + + friend Istream& operator>>(Istream&, equationOperation&); + friend Ostream& operator<<(Ostream&, const equationOperation&); + +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "equationOperationI.H" + +#endif diff --git a/src/OpenFOAM/db/dictionary/equation/equationOperation/equationOperationI.H b/src/OpenFOAM/db/dictionary/equation/equationOperation/equationOperationI.H new file mode 100644 index 000000000..fc4e1a7b9 --- /dev/null +++ b/src/OpenFOAM/db/dictionary/equation/equationOperation/equationOperationI.H @@ -0,0 +1,84 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +inline const equationOperation::sourceListType& + equationOperation::sourceList() const +{ + return sourceList_; +} + + +inline equationOperation::sourceListType& + equationOperation::sourceList() +{ + return sourceList_; +} + + +inline const label& equationOperation::sourceIndex() const +{ + return sourceIndex_; +} + + +inline label& equationOperation::sourceIndex() +{ + return sourceIndex_; +} + +inline const label& equationOperation::dictLookupIndex() const +{ + return dictLookupIndex_; +} + + +inline label& equationOperation::dictLookupIndex() +{ + return dictLookupIndex_; +} + + +inline const equationOperation::operationType& + equationOperation::operation() const +{ + return operation_; +} + + +inline equationOperation::operationType& equationOperation::operation() +{ + return operation_; +} + + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/db/dictionary/equation/equationOperation/equationOperationList.H b/src/OpenFOAM/db/dictionary/equation/equationOperation/equationOperationList.H new file mode 100644 index 000000000..941d0fc96 --- /dev/null +++ b/src/OpenFOAM/db/dictionary/equation/equationOperation/equationOperationList.H @@ -0,0 +1,53 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Typedef + Foam::equationOperationList + +Description + List of equationOperations + +Author + David L. F. Gaden + +\*---------------------------------------------------------------------------*/ + +#ifndef equationOperationList_H +#define equationOperationList_H + +#include "equationOperation.H" +#include "List.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + typedef List equationOperationList; +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/OpenFOAM/db/dictionary/equation/equationReader/equationReader.C b/src/OpenFOAM/db/dictionary/equation/equationReader/equationReader.C new file mode 100644 index 000000000..30bf8cb05 --- /dev/null +++ b/src/OpenFOAM/db/dictionary/equation/equationReader/equationReader.C @@ -0,0 +1,1670 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "equationReader.H" +#include "mathematicalConstants.H" +#include "dimensionedScalar.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +//const char* const Foam::equationReader::typeName = "equationReader"; + defineTypeNameAndDebug(equationReader, 0); +} + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +void Foam::equationReader::fatalParseError +( + const label index, + const tokenList& tl, + const label fromToken, + const label toToken, + const string& errorIn, + const OStringStream& description +) +{ + OStringStream errorMessage; + forAll(tl, i) + { + if (i == fromToken) + { + errorMessage << "<"; + } + if (tl[i].isPunctuation() && tl[i].pToken() == token::COLON) + { + errorMessage << "^"; + } + else + { + errorMessage << tl[i]; + } + if (i == toToken) + { + errorMessage << ">"; + } + } + + FatalErrorIn(errorIn) << "Parsing error in the equation for " + << eqns_[index].equationName() << ", given by:" << endl + << endl << token::TAB << eqns_[index].rawText() << endl + << endl << "Error occurs withing the < angle brackets >:" << endl + << endl << token::TAB << errorMessage.str() << endl << endl + << description.str() + << abort(FatalError); +} + + +Foam::string Foam::equationReader::stringPreconditioner(const string& rawText) +{ + string rawWorking(rawText); + + // Negative exponent workaround + for (label i = 0; i < 10; i++) + { + string strTemp(name(i)); + string strTemp2(name(i)); + strTemp.append("e-"); + strTemp2.append("&"); + stringReplaceAll(rawWorking, strTemp, strTemp2); + } + + stringReplaceAll(rawWorking, "^", " : "); + stringReplaceAll(rawWorking, "(", " ( "); + stringReplaceAll(rawWorking, ")", " ) "); + stringReplaceAll(rawWorking, "+", " + "); + stringReplaceAll(rawWorking, "-", " - "); + stringReplaceAll(rawWorking, "&", "e-"); + stringReplaceAll(rawWorking, "*", " * "); + stringReplaceAll(rawWorking, "/", " / "); + stringReplaceAll(rawWorking, ",", " , "); + + // Leading negative workaround + // This solution leads to dimensional problems +/* IStringStream rawStream(rawWorking); + token firstToken(rawStream); + if (firstToken.isPunctuation() && firstToken.pToken() == token::SUBTRACT) + { + rawWorking.insert(0, "0"); + } +*/ + return rawWorking; +} + + +void Foam::equationReader::stringReplaceAll +( + string& working, + const string& findMe, + const string& replaceWith +) +{ + size_t position(0); + size_t offset(0); + string subWorking(working); + while (position != string::npos) + { + position = subWorking.string::find(findMe); + if (position != string::npos) + { + working.::std::string::replace + ( + position + offset, findMe.size(), replaceWith + ); + offset += position + replaceWith.size(); + subWorking = subWorking.substr(position + findMe.size()); + } + } +} + + +Foam::labelList Foam::equationReader::findMaxParenthesis +( + const labelList& parenthesisList, + const labelList& equationIndices +) const +{ + labelList returnMe(equationIndices.size()); + label currentMax(-1); + label atIndex(0); + bool groupDone(false); + + forAll(equationIndices, i) + { + if (mag(parenthesisList[equationIndices[i]]) > currentMax) + { + groupDone = false; + atIndex = 0; + currentMax = mag(parenthesisList[equationIndices[i]]); + returnMe[atIndex] = equationIndices[i]; + } + else if + ( + (mag(parenthesisList[equationIndices[i]]) == currentMax) + && (!groupDone) + ) + { + atIndex++; + returnMe[atIndex] = equationIndices[i]; + } + else if (mag(parenthesisList[equationIndices[i]]) < currentMax) + { + groupDone = true; + } + } + returnMe.setSize(atIndex + 1); + return returnMe; +} + + +Foam::labelList Foam::equationReader::findMaxOperation +( + const labelList& opLvl, + const labelList& indices +) +{ + label maxOpLvl(-1); + label atIndex(-1); + labelList returnMe(indices.size()); + bool groupDone(false); + + forAll(indices, i) + { + if (opLvl[indices[i]] > maxOpLvl) + { + atIndex = 0; + returnMe[0] = indices[i]; + if (i > 0) + { + atIndex++; + returnMe[0] = indices[i - 1]; + returnMe[1] = indices[i]; + } + groupDone = false; + maxOpLvl = opLvl[indices[i]]; + } + else if + ( + ( + (opLvl[indices[i]] == maxOpLvl) + || (opLvl[indices[i]] == 0) + ) + && !groupDone + ) + { + atIndex++; + returnMe[atIndex] = indices[i]; + } + else if ((opLvl[indices[i]] < maxOpLvl) && (opLvl[indices[i]] != 0)) + { + groupDone = true; + } + } + returnMe.setSize(atIndex + 1); + return returnMe; +} + + +void Foam::equationReader::absorbNegatives +( + const label equationIndex, + const tokenList& tl, + labelList& eqnIndices, + labelList& subEqnIndices, + equationOperationList& map, + labelList& opLvl +) +{ + // Negatives are identified by a map with a negative sourceIndex + // To accommodate this behaviour, source indices are 1-indexed in the map. + forAll(subEqnIndices, i) + { + if (map[subEqnIndices[i]].dictLookupIndex() == -1) + { + if + ( + (subEqnIndices.size() == i) + || (opLvl[subEqnIndices[i + 1]] != 0) + ) + { + OStringStream description; + description << "Misplaced negative / subtraction operator."; + fatalParseError + ( + equationIndex, + tl, + subEqnIndices[i], + subEqnIndices[i], + "equationReader::absorbNegatives", + description + ); + } + map[subEqnIndices[i + 1]].sourceIndex() = + -map[subEqnIndices[i + 1]].sourceIndex(); + + trimListWithParent(eqnIndices, subEqnIndices, i, i); + } + } +} + + +void Foam::equationReader::dsEqual +( + dimensionedScalar& dso, + const dimensionedScalar& dsi +) +{ + dso.value() = dsi.value(); + dso.name() = dsi.name(); + dso.dimensions().reset(dsi.dimensions()); +} + + +void Foam::equationReader::trimListWithParent +( + labelList& parent, + labelList& indices, + label from, + label to, + label exceptFor +) +{ + if + ( + (to > (indices.size() - 1)) + || (from < 0) + || (from > (indices.size() - 1)) + || (to < from) + ) + { + FatalErrorIn + ( + "equationReader::trimListWithParent(parent, indices, from, to, " + "exceptFor)" + ) + << "Bad indices. parent is " << parent << ", indices are " + << indices << ", from is " << from << ", to is " << to + << " exceptFor is " << exceptFor << "." + << abort(FatalError); + } + + for (label i(from); i <= to; i++) + { + label removeMe(indices[i]); + if (i == exceptFor) continue; + forAll(parent, j) + { + if (parent[j] == removeMe) + { + trimList(parent, j, j); + break; + } + } + } + trimList(indices, from, to, exceptFor); +} + + +void Foam::equationReader::trimList +( + labelList& indices, + label from, + label to, + label exceptFor +) +{ + if + ( + (to > (indices.size() - 1)) + || (from < 0) + || (from > (indices.size() - 1)) + || (to < from) + ) + { + FatalErrorIn + ( + "equationReader::trimList(indices, from, to, exceptFor" + "exceptFor)" + ) + << "Bad indices. indices are " << indices << ", from is " + << from << ", to is " << to << " exceptFor is " << exceptFor << "." + << abort(FatalError); + } + + if (!(exceptFor == from && from == to)) + { + + if (exceptFor == from) + { + from++; + } + else if (exceptFor == to) + { + to--; + } + else if ((exceptFor < to) && (exceptFor > from)) + { + indices[from] = indices[exceptFor]; + from++; + } + + for (label i(from); i < (indices.size() + from - to - 1); i++) + { + indices[i] = indices[i + to - from + 1]; + } + indices.setSize(indices.size() - to + from - 1); + } +} + + +Foam::label Foam::equationReader::findIndex +( + const label value, + const labelList& indexList +) const +{ + forAll (indexList, i) + { + if (indexList[i] == value) + { + return i; + } + } + return -1; +} + + +Foam::equationOperation Foam::equationReader::findSource +( + const word& varName +) +{ + // Search order: + // -other equations + // -externalDScalars + // -externalScalars + // -externalScalarLists + // -dictSources + + // Searching known equations + for (label eqs(0); eqs < eqns_.size(); eqs++) + { + if (eqns_[eqs].equationName() == varName) + { + return equationOperation + ( + equationOperation::slequation, + eqs + 1, + 0, + equationOperation::otnone + ); + } + } + + forAll(externalDScalars_, i) + { + if (externalDScalars_[i].name() == varName) + { + return equationOperation + ( + equationOperation::slexternalDScalar, + i + 1, + 0, + equationOperation::otnone + ); + } + } + + if (externalScalars_.size() != externalScalarNames_.size()) + { + FatalErrorIn("equationReader::findSource") + << "Size mismatch detected in externalScalars = " + << externalScalars_.size() << " and externalScalarNames = " + << externalScalarNames_.size() << "." + << abort(FatalError); + } + + forAll(externalScalars_, j) + { + if (externalScalarNames_[j] == varName) + { + return equationOperation + ( + equationOperation::slexternalScalar, + j + 1, + 0, + equationOperation::otnone + ); + } + } + + forAll(externalScalarListNames_, i) + { + if (externalScalarListNames_[i] == varName) + { + return equationOperation + ( + equationOperation::slexternalScalarList, + i + 1, + 0, + equationOperation::otnone + ); + } + } + + forAll(dictSources_, i) + { + if (dictSources_[i].found(varName) && !dictSources_[i].isDict(varName)) + { + label dictLookupIndex(-1); +// wordList& wl(eqns_[equationIndex].dictLookups()); + + ITstream srcStrm + ( + dictSources_[i].lookup(varName) + ); + if (isDimensionedScalar(srcStrm) || isScalar(srcStrm)) + { + // Look for varName in dictLoookup names, append if not found + forAll(dictLookups_, j) + { + if (varName == dictLookups_[j]) + { + dictLookupIndex = j; + break; + } + } + if (dictLookupIndex < 0) + { + dictLookups_.setSize(dictLookups_.size() + 1); + dictLookups_.set + ( + dictLookups_.size() - 1, + new word(varName) + ); + dictLookupIndex = dictLookups_.size() - 1; + } + + return equationOperation + ( + equationOperation::sldictSource, + i + 1, + dictLookupIndex, + equationOperation::otnone + ); + } + else if (isEquation(srcStrm)) + { + // Is it a known equation already? + for (label eqs(0); eqs < eqns_.size(); eqs++) + { + if (eqns_[eqs].equationName() == varName) + { + return equationOperation + ( + equationOperation::slequation, + eqs + 1, + 0, + equationOperation::otnone + ); + } + } + // The equation has not been read yet. Create an unparsed + // equation. It will be parsed during evaluate, or if it + // is later read. + equation eqn(srcStrm); + eqn.equationName() = varName; + createEquation(eqn); +/* + token it(srcStrm); + createEquation + ( + equation + ( + varName, + it.stringToken() + ) + ); +*/ + return equationOperation + ( + equationOperation::slequation, + eqns_.size(), + 0, + equationOperation::otnone + ); + } + } // end if varName is in dictionary + } // end dictionary search loop + return equationOperation + ( + equationOperation::slnone, + 0, + 0, + equationOperation::otnone + ); + +} + + +Foam::label Foam::equationReader::addInternalScalar(const scalar& value) +{ + forAll(internalScalars_, i) + { + if (mag(internalScalars_[i] - value) < VSMALL) + { + return i; + } + } + internalScalars_.setSize(internalScalars_.size() + 1); + internalScalars_.set(internalScalars_.size() - 1, new scalar(value)); + return internalScalars_.size() - 1; +} + + +bool Foam::equationReader::isDimensionedScalar(ITstream& is) +{ + tokenList tl(12); + label found(0); + while (!is.eof()) + { + tl[found] = token(is); + found++; + if (found > 12) + { + is.rewind(); + return false; + } + } + if + ( + ( + (found == 11) + && tl[0].isWord() + && tl[1].isPunctuation() + && tl[2].isNumber() + && tl[3].isNumber() + && tl[4].isNumber() + && tl[5].isNumber() + && tl[6].isNumber() + && tl[7].isNumber() + && tl[8].isNumber() + && tl[9].isPunctuation() + && tl[10].isNumber() + ) + || ( + (found == 9) + && tl[0].isWord() + && tl[1].isPunctuation() + && tl[2].isNumber() + && tl[3].isNumber() + && tl[4].isNumber() + && tl[5].isNumber() + && tl[6].isNumber() + && tl[7].isPunctuation() + && tl[8].isNumber() + ) + ) + { + is.rewind(); + return true; + } + else + { + is.rewind(); + return false; + } +} + + +bool Foam::equationReader::isScalar(ITstream& is) +{ + token firstToken(is); + if (firstToken.isNumber() && is.eof()) + { + is.putBack(firstToken); + return true; + } + else + { + is.putBack(firstToken); + return false; + } +} + + +bool Foam::equationReader::isEquation(ITstream& is) +{ + token firstToken(is); + if (firstToken.isString() && is.eof()) + { + is.putBack(firstToken); + return true; + } + else + { + is.putBack(firstToken); + tokenList tl(12); + label found(0); + while (!is.eof()) + { + tl[found] = token(is); + found++; + if (found == 12) + { + is.rewind(); + return false; + } + } + if + ( + ( + (found == 11) + && tl[0].isWord() + && tl[1].isPunctuation() + && tl[2].isNumber() + && tl[3].isNumber() + && tl[4].isNumber() + && tl[5].isNumber() + && tl[6].isNumber() + && tl[7].isNumber() + && tl[8].isNumber() + && tl[9].isPunctuation() + && (tl[10].isString() || tl[10].isNumber()) + ) + || ( + (found == 10) + && tl[0].isPunctuation() + && tl[1].isNumber() + && tl[2].isNumber() + && tl[3].isNumber() + && tl[4].isNumber() + && tl[5].isNumber() + && tl[6].isNumber() + && tl[7].isNumber() + && tl[8].isPunctuation() + && (tl[9].isString() || tl[9].isNumber()) + ) + || ( + (found == 9) + && tl[0].isWord() + && tl[1].isPunctuation() + && tl[2].isNumber() + && tl[3].isNumber() + && tl[4].isNumber() + && tl[5].isNumber() + && tl[6].isNumber() + && tl[7].isPunctuation() + && (tl[8].isString() || tl[8].isNumber()) + ) + || ( + (found == 8) + && tl[0].isPunctuation() + && tl[1].isNumber() + && tl[2].isNumber() + && tl[3].isNumber() + && tl[4].isNumber() + && tl[5].isNumber() + && tl[6].isPunctuation() + && (tl[7].isString() || tl[8].isNumber()) + ) + ) + { + is.rewind(); + return true; + } + else + { + is.rewind(); + return false; + } + } +} + + +void Foam::equationReader::reportOperationDisabled +( + const label& index, + const label& i, + const dimensionedScalar& ds +) const +{ + // do nothing +} + + +void Foam::equationReader::reportOperationEnabled +( + const label& index, + const label& i, + const dimensionedScalar& ds +) const +{ + Info << "Performing operation: [" + << equationOperation::opName + ( + eqns_[index].ops()[i].operation() + ) << "] using source ["; + if + ( + eqns_[index].ops()[i].sourceList() + == equationOperation::sldictSource + ) + { + Info << dictLookups_[eqns_[index].ops()[i].dictLookupIndex()]; + } + else if + ( + eqns_[index].ops()[i].sourceList() + == equationOperation::slequation + ) + { + Info << eqns_ + [ + mag(eqns_[index].ops()[i].sourceIndex() - 1) + ].equationName(); + } + else if + ( + eqns_[index].ops()[i].sourceList() + == equationOperation::slexternalScalar + ) + { + Info << externalScalarNames_ + [ + mag(eqns_[index].ops()[i].sourceIndex() - 1) + ]; + } + else + { + Info << ds.name(); + } + Info << "] read from [" + << equationOperation::sourceName + ( + eqns_[index].ops()[i].sourceList() + ) << "]..." << endl; +} + + +void Foam::equationReader::reportResultDisabled +( + const dimensionedScalar& ds +) const +{ + // do nothing +} + + +void Foam::equationReader::reportResultEnabled +( + const dimensionedScalar& ds +) const +{ + Info << "Operaion result is " << ds << endl; +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::equationReader::equationReader() +{ + if (debug > 1) + { + reportOperationFunction_ + = &Foam::equationReader::reportOperationEnabled; + reportResultFunction_ + = &Foam::equationReader::reportResultEnabled; + } + else + { + reportOperationFunction_ + = &Foam::equationReader::reportOperationDisabled; + reportResultFunction_ + = &Foam::equationReader::reportResultDisabled; + } +} + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::equationReader::~equationReader() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::equationReader::addDataSource(const dictionary& dict) +{ + dictSources_.setSize(dictSources_.size() + 1); + dictSources_.set(dictSources_.size() - 1, &dict); +} + + +void Foam::equationReader::addDataSource +( + const scalar& value, + const word& name, + const dimensionSet& dimensions +) +{ + equationOperation source(findSource(name)); + if + ( + source.sourceList() != equationOperation::slnone + && source.sourceList() != equationOperation::sldictSource + ) + { + FatalErrorIn("equationReader::addDataSource") + << "Attempting to add external scalar named " << name << " when " + << "this name already exists as a " + << equationOperation::sourceName(source.sourceList()) << " source." + << abort(FatalError); + } + + label newSize(externalScalars_.size() + 1); + + externalScalars_.setSize(newSize); + externalScalarNames_.setSize(newSize); + externalScalarDimensions_.setSize(newSize); + + externalScalars_.set(newSize - 1, &value); + externalScalarNames_[newSize - 1] = name; + externalScalarDimensions_.set(newSize - 1, new dimensionSet(dimensions)); +} + + +void Foam::equationReader::addDataSource(const dimensionedScalar& ds) +{ + addDataSource(ds.value(), ds.name(), ds.dimensions()); +} + + +void Foam::equationReader::addDataSource +( + const scalarList& slist, + const word& name, + const dimensionSet& dimensions +) +{ + equationOperation source(findSource(name)); + if + ( + source.sourceList() != equationOperation::slnone + && source.sourceList() != equationOperation::sldictSource + ) + { + FatalErrorIn("equationReader::addDataSource") + << "Attempting to add external scalarList named " << name + << " when this name already exists as a " + << equationOperation::sourceName(source.sourceList()) << " source." + << abort(FatalError); + } + + label newSize(externalScalarLists_.size() + 1); + + externalScalarLists_.setSize(newSize); + externalScalarListNames_.setSize(newSize); + externalScalarListDimensions_.setSize(newSize); + externalScalarListIndex_.setSize(newSize); + + externalScalarLists_.set(newSize - 1, &slist); + externalScalarListNames_[newSize - 1] = name; + externalScalarListDimensions_.set + ( + newSize - 1, + new dimensionSet(dimensions) + ); + externalScalarListIndex_[newSize - 1] = 0; +} + + +void Foam::equationReader::setListIndex(const word& name, label newIndex) +{ + equationOperation source(findSource(name)); + if (source.sourceList() != equationOperation::slexternalScalarList) + { + FatalErrorIn("equationReader::setListIndex") + << "setListIndex called for variable " << name << " which is not " + << "a scalarList source. Its source is: " + << equationOperation::sourceName(source.sourceList()) + << abort(FatalError); + } + label maxIndex(externalScalarLists_[source.sourceIndex() - 1].size()); + if (newIndex < 0 || newIndex > maxIndex) + { + FatalErrorIn("equationReader::setListIndex") + << "Index " << newIndex << " is out of bounds (0, " << maxIndex - 1 + << ") for scalarList " << name << "." + << abort(FatalError); + } + externalScalarListIndex_[source.sourceIndex() - 1] = newIndex; +} + + +void Foam::equationReader::setListIndex(label newIndex) +{ + forAll(externalScalarListNames_, i) + { + setListIndex(externalScalarListNames_[i], newIndex); + } +} + + +void Foam::equationReader::createEquation +( + equation eqn +) +{ + label index(lookup(eqn.equationName())); + if (index < 0) + { + if (debug) + { + Info << "Creating equation " << eqn.equationName() << " at index " + << eqns_.size() << endl; + } + label newSize(eqns_.size() + 1); + + eqns_.setSize(newSize); + outputScalars_.setSize(newSize); + outputScalarNames_.setSize(newSize); + outputScalarDimensions_.setSize(newSize); + outputScalarLists_.setSize(newSize); + outputScalarListDimensions_.setSize(newSize); + + eqns_.set(newSize - 1, new equation(eqn)); + outputScalars_.set(newSize - 1, NULL); + outputScalarNames_[newSize - 1] = word::null; + outputScalarDimensions_.set + ( + newSize - 1, + new dimensionSet(dimless) + ); + outputScalarLists_.set(newSize - 1, NULL); + outputScalarListDimensions_.set + ( + newSize - 1, + new dimensionSet(dimless) + ); + } + else + { + FatalErrorIn("equationReader::createEquation") + << "Equation " << eqn.equationName() << " already exists." + << abort(FatalError); + } +} + + +void Foam::equationReader::linkOutput +( + const word& eqnName, + dimensionedScalar& outputDVar +) +{ + label index(lookup(eqnName)); + if (index < 0) + { + FatalErrorIn("equationReader::linkOutput") + << "Equation name " << eqnName << "not found." + << abort(FatalError); + } + linkOutput + ( + index, + outputDVar.value(), + outputDVar.name(), + outputDVar.dimensions() + ); +} + + +void Foam::equationReader::linkOutput +( + const word& eqnName, + scalar& value, + const word& name, + const dimensionSet& dimensions +) +{ + label index(lookup(eqnName)); + if (index < 0) + { + FatalErrorIn("equationReader::linkOutput") + << "Equation name " << eqnName << "not found." + << abort(FatalError); + } + linkOutput + ( + index, + value, + name, + dimensions + ); +} + + +void Foam::equationReader::linkOutput +( + const word& eqnName, + scalarList& outputSList, + const dimensionSet& dimensions +) +{ + label index(lookup(eqnName)); + if (index < 0) + { + FatalErrorIn("equationReader::linkOutput") + << "Equation name " << eqnName << "not found." + << abort(FatalError); + } + linkOutput(index, outputSList, dimensions); +} + + +void Foam::equationReader::linkOutput +( + label index, + dimensionedScalar& outputDVar +) +{ + linkOutput + ( + index, + outputDVar.value(), + outputDVar.name(), + outputDVar.dimensions() + ); +} + + +void Foam::equationReader::linkOutput +( + label index, + scalar& value, + const word& name, + const dimensionSet& dimensions +) +{ + if (index < 0 || index >= eqns_.size()) + { + FatalErrorIn("equationReader::linkOutput") + << "Index " << index << " out of range (0, " << eqns_.size() - 1 + << ")." + << abort(FatalError); + } + outputScalars_.set(index, &value); + outputScalarNames_[index] = name; + outputScalarDimensions_[index].reset(dimensions); + outputScalarLists_.set(index, NULL); +} + + +void Foam::equationReader::linkOutput +( + label index, + scalarList& outputSList, + const dimensionSet& dimensions +) +{ + outputScalarLists_.set(index, & outputSList); + outputScalarListDimensions_.set(index, new dimensionSet(dimensions)); + outputScalars_.set(index, NULL); +} + + +void Foam::equationReader::readEquation +( + equation eqn +) +{ + label index(lookup(eqn.equationName())); + if (index < 0) + { + createEquation(eqn); + } + else if(eqn.rawText() != eqns_[index].rawText()) + { + eqns_[index].clear(); + } +} + + +void Foam::equationReader::readEquation +( + equation eqn, + dimensionedScalar& outputDVar +) +{ + readEquation + ( + eqn, + outputDVar.value(), + outputDVar.name(), + outputDVar.dimensions() + ); +} + + +void Foam::equationReader::readEquation +( + equation eqn, + scalar& value, + const word& name, + const dimensionSet& dimensions +) +{ + label index(lookup(eqn.equationName())); + if (index < 0) + { + index = eqns_.size(); + createEquation(eqn); + } + else if(eqn.rawText() != eqns_[index].rawText()) + { + eqns_[index].clear(); + } + linkOutput(index, value, name, dimensions); +} + + +void Foam::equationReader::readEquation +( + equation eqn, + scalarList& outputSList, + const dimensionSet& dimensions +) +{ + label index(lookup(eqn.equationName())); + if (index < 0) + { + index = eqns_.size(); + createEquation(eqn); + } + else if(eqn.rawText() != eqns_[index].rawText()) + { + eqns_[index].clear(); + } + linkOutput(index, outputSList, dimensions); +} + + +void Foam::equationReader::readEquation +( + const dictionary& sourceDict, + const word& eqnName +) +{ + equation eqn(sourceDict.lookup(eqnName)); + eqn.equationName() = eqnName; + readEquation(eqn); +} + + +void Foam::equationReader::readEquation +( + const dictionary& sourceDict, + const word& eqnName, + dimensionedScalar& outputDVar +) +{ + equation eqn(sourceDict.lookup(eqnName)); + eqn.equationName() = eqnName; + readEquation + ( + eqn, + outputDVar.value(), + outputDVar.name(), + outputDVar.dimensions() + ); +} + + +void Foam::equationReader::readEquation +( + const dictionary& sourceDict, + const word& eqnName, + scalar& value, + const word& name, + const dimensionSet& dimensions +) +{ + equation eqn(sourceDict.lookup(eqnName)); + eqn.equationName() = eqnName; + readEquation + ( + eqn, + value, + name, + dimensions + ); +} + +/* +void Foam::equationReader::createEquation +( + equation eqn, + dimensionedScalar * outputDVar +) +{ + label index(lookup(eqn.equationName())); + if (index < 0) + { + if (debug) + { + Info << "Creating equation " << eqn.equationName() << " at index " + << eqns_.size() << endl; + } + eqns_.setSize(eqns_.size() + 1); + eqns_.set(eqns_.size() - 1, new equation(eqn)); + + outputScalars_.setSize(eqns_.size()); + outputScalarNames_.setSize(eqns_.size()); + outputScalarDimensions_.setSize(eqns_.size()); + if (outputDVar != NULL) + { + outputScalars_.set(eqns_.size() - 1, & outputDVar->value()); + outputScalarNames_[eqns_.size() - 1] = outputDVar->name(); + outputScalarDimensions_.set + ( + eqns_.size() - 1, + new dimensionSet(outputDVar->dimensions()) + ); + } + else + { + outputScalars_.set(eqns_.size() - 1, NULL); + outputScalarNames_[eqns_.size() - 1] = word::null; + outputScalarDimensions_.set + ( + eqns_.size() - 1, + new dimensionSet(dimless) + ); + } + } + else + { + FatalErrorIn("equationReader::createEquation") + << "Equation " << eqn.equationName() << " already exists. Use " + << "readEquation to suppress error." + << abort(FatalError); + } +} + +void Foam::equationReader::createEquation +( + equation eqn, + scalar * outputVar, + const word& outputName, + const dimensionSet& outputDimensions +) +{ + label index(lookup(eqn.equationName())); + if (index < 0) + { + if (debug) + { + Info << "Creating equation " << eqn.equationName() << " at index " + << eqns_.size() << endl; + } + eqns_.setSize(eqns_.size() + 1); + eqns_.set(eqns_.size() - 1, new equation(eqn)); + + outputScalars_.setSize(eqns_.size()); + outputScalarNames_.setSize(eqns_.size()); + outputScalarDimensions_.setSize(eqns_.size()); + + outputScalars_.set(eqns_.size() - 1, outputVar); + outputScalarNames_[eqns_.size() - 1] = outputName; + outputScalarDimensions_.set + ( + eqns_.size() - 1, + new dimensionSet(outputDimensions) + ); + } + else + { + FatalErrorIn("equationReader::createEquation") + << "Equation already exists. Use readEquation to suppress error." + << abort(FatalError); + } +} + + +void Foam::equationReader::readEquation +( + const dictionary& sourceDict, + const word& eqnName, + dimensionedScalar * outputDVar +) +{ + equation eqn(sourceDict.lookup(eqnName)); + eqn.equationName() = eqnName; + + readEquation + ( + eqn, + outputDVar + ); +} + + +void Foam::equationReader::readEquation +( + const dictionary& sourceDict, + const word& eqnName, + scalar * outputVar, + const word& outputName, + const dimensionSet& outputDimensions +) +{ + equation eqn(sourceDict.lookup(eqnName)); + eqn.equationName() = eqnName; + + readEquation + ( + eqn, + outputVar, + outputName, + outputDimensions + ); +} + + +void Foam::equationReader::readEquation +( + equation eqn, + dimensionedScalar * outputDVar +) +{ + label index(lookup(eqn.equationName())); + if (index < 0) + { + createEquation(eqn, outputDVar); + parse(eqns_.size() - 1); + } + else if + ( + (eqn.rawText() != eqns_[index].rawText()) + || (!eqns_[index].size()) + ) + { + eqns_[index].rawText() = eqn.rawText(); + parse(index); + if (outputDVar != NULL) + { + outputScalars_.set(index, & outputDVar->value()); + outputScalarNames_[index] = outputDVar->name(); + outputScalarDimensions_.set + ( + index, + new dimensionSet(outputDVar->dimensions()) + ); + } + } +} + + +void Foam::equationReader::readEquation +( + equation eqn, + scalar * outputVar, + const word& outputName, + const dimensionSet& outputDimensions +) +{ + label index(lookup(eqn.equationName())); + if (index < 0) + { + createEquation(eqn, outputVar, outputName, outputDimensions); + parse(eqns_.size() - 1); + } + else if + ( + (eqn.rawText() != eqns_[index].rawText()) + || (!eqns_[index].size()) + ) + { + parse(index); + outputScalars_.set(index, outputVar); + outputScalarNames_[index] = outputName; + outputScalarDimensions_.set + ( + index, + new dimensionSet(outputDimensions) + ); + } +} +*/ + + +void Foam::equationReader::update(const word& equationName) +{ + label index(lookup(equationName)); + if (index < 0) + { + FatalErrorIn("equationReader::update(const word)") + << "Equation name " << equationName << " not found." + << abort(FatalError); + } + update(index); +} + + +void Foam::equationReader::update(const label& index) +{ + if (outputScalars_.set(index)) + { + dimensionedScalar eval = evaluate(index); + outputScalars_[index] = eval.value(); + + if + ( + !eqns_[index].changeDimensions() + && dimensionSet::debug + && outputScalarDimensions_[index] != eval.dimensions() + ) + { + WarningIn("equationReader::update") + << "Dimension error thrown for equation " + << eqns_[index].equationName() << ", given by:" + << token::NL << token::TAB + << eqns_[index].rawText(); + + outputScalarDimensions_[index] = eval.dimensions(); + } + } + else if (outputScalarLists_.set(index)) + { + evaluateField + ( + index, + outputScalarLists_[index], + outputScalarDimensions_[index] + ); + } +} + + +void Foam::equationReader::update() +{ + for (label i = 0; i < eqns_.size(); i++) + { + update(i); + } +} + + +bool Foam::equationReader::found(const word& equationName) +{ + for (label i = 0; i < eqns_.size(); i++) + { + if (eqns_[i].equationName() == equationName) + { + return true; + } + } + return false; +} + + +Foam::label Foam::equationReader::lookup(const word& equationName) +{ + for (label i = 0; i < eqns_.size(); i++) + { + if (eqns_[i].equationName() == equationName) + { + return i; + } + } + + return -1; +} + + +void Foam::equationReader::deleteEquation(const word& equationName) +{ + label index(lookup(equationName)); + if (index < 0) + { + WarningIn("equationReader::deleteEquation(equationName)") + << "Equation name " << equationName << " not found." << endl; + } + deleteEquation(index); +} + + +void Foam::equationReader::deleteEquation(const label& index) +{ + if ((index < 0) || (index >= eqns_.size())) + { + FatalErrorIn("equationReader::deleteEquation(index)") + << "Index " << index << " out of bounds (0, " << eqns_.size() - 1 + << ")" + << abort(FatalError); + } + for (label i = index; i < (eqns_.size() - 1); i++) + { + eqns_[i] = eqns_[i + 1]; + } + + eqns_.setSize(eqns_.size() - 1); +} + + +/* +void Foam::equationReader::status() +{ + Info << "*** equationReader object status report ***" << endl; + Info << "Data sources:" << endl; + Info << token::TAB << dictSources_.size() << " dictionaries, with recorded " + << "keywords:" << endl; + forAll(dictLookups_, i) + { + Info << token::TAB << token::TAB << dictLookups_[i] << endl; + } + Info << token::TAB << externalDScalars_.size() << " external " + << "dimensionedScalars with names:" << endl; + forAll(externalDScalars_, i) + { + Info << token::TAB << token::TAB << externalDScalars_[i].name() + << endl; + } + Info << token::TAB << externalScalars_.size() << " external " + << "scalars with names:" << endl; + forAll(externalScalarNames_, i) + { + Info << token::TAB << token::TAB << externalScalarNames_[i] << endl; + } + Info << token::TAB << internalScalars_.size() << " internal scalars." + << endl; + Info << eqns_.size() << " equations in memory:" << endl; + forAll(eqns_, i) + { + Info << i << ":" << token::TAB << eqns_[i].size() << " operations," + << token::TAB << eqns_[i].equationName() << token::TAB; + if ((outputScalars_.size() > i) && outputScalars_.set(i)) + { + Info << "active output to " << outputScalarNames_[i] << "." + << endl; + } + else + { + Info << "passive output." << endl; + } + if (eqns_[i].changeDimensions()) + { + Info << token::TAB << "Dimension override to: " + << eqns_[i].overrideDimensions() << endl; + } + Info << token::TAB << eqns_[i].rawText() << endl; + } +} +*/ + +/* +template <> +dimensioned::dimensioned +( + Istream& is +) +: + name_(is), + dimensions_(dimless), + value_(0) +{ + is.rewind(); + token t(is); + + if (t.isString()) + { + equationReader eqn; + eqn.readEquation + ( + equation + ( + name_, + t.stringToken() + ) + ); + *this = eqn.evaluate(0); + } + else + { + dimensions_ = dimensionSet(is); + value_ = scalar(pTraits(is)); + } +} +*/ + +#include "equationReaderAssignPointerFunctions.C" +#include "equationReaderCreateMap.C" +#include "equationReaderEvaluate.C" +#include "equationReaderGetSource.C" +#include "equationReaderParse.C" + +// ************************************************************************* // diff --git a/src/OpenFOAM/db/dictionary/equation/equationReader/equationReader.H b/src/OpenFOAM/db/dictionary/equation/equationReader/equationReader.H new file mode 100644 index 000000000..8ac05a657 --- /dev/null +++ b/src/OpenFOAM/db/dictionary/equation/equationReader/equationReader.H @@ -0,0 +1,768 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::equationReader + +Description + The master class for reading equations from a dictionary file. This class + holds all the equations, all the data sources, and gives access to all the + equation parsing / evaluating functions. + +SourceFiles + equationReaderI.H + equationReaderPointerFunctions.H + equationReader.C + equationReaderAssignPointerFunctions.C + equationReaderCreateMap.C + equationReaderEvaluate.C + equationReaderGetSource.C + equationReaderIO.C + equationReaderParse.C + equationReaderTemplates.C + +Author + David L. F. Gaden + +\*---------------------------------------------------------------------------*/ + +#ifndef equationReader_H +#define equationReader_H + +#include "dictionary.H" +//#include "dimensionedScalar.H" +#include "UPtrList.H" +#include "equationList.H" +#include "tokenList.H" +#include "labelList.H" +#include "DimensionedField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of friend functions and operators + +class equationReader; +// *** Located in equationReaderIO.C *** +Istream& operator>>(Istream&, equationReader&); +Ostream& operator<<(Ostream&, const equationReader&); + +/*---------------------------------------------------------------------------*\ + Class equationReader Declaration +\*---------------------------------------------------------------------------*/ + +class equationReader +{ + // Private data + + //- Dependency backtrace, used for circular-reference detection + labelList dependents_; + + //- Equations + equationList eqns_; + + //- Function pointer (used to avoid a conditional at every operation + // for debug level 2) + void (Foam::equationReader::*reportOperationFunction_) + ( + const label&, + const label&, + const dimensionedScalar& + ) const; + + //- Function pointer (used to avoid a conditional at every operation + // for debug level 2) + void (Foam::equationReader::*reportResultFunction_) + ( + const dimensionedScalar& + ) const; + + // Sources - these are locations where variables appearing in the + // equations can be retrieved + + //- Variables that can be looked up in a dictionary + UPtrList dictSources_; + + //- Words to be looked up in a dictionary (equation operation only + // gives indices; this is necessary if the source is a dictionary) + PtrList dictLookups_; + + //- Pointers to source scalarLists, used for lists, fields, etc.. + UPtrList externalScalarLists_; + + //- Dimensions associated with the externalScalarLists + PtrList externalScalarListDimensions_; + + //- Names associated with the externalScalarLists + wordList externalScalarListNames_; + + //- Current index associated with the externalScalarLists + labelList externalScalarListIndex_; + + //- Pointers to external dimensionedScalars + UPtrList externalDScalars_; + + //- Pointers to external scalars + UPtrList externalScalars_; + + //- Names associated with the external scalars + wordList externalScalarNames_; + + //- Dimensions associated with the external scalars + PtrList externalScalarDimensions_; + + //- The output of each equation in the equationList is sent here, + // indexed according to the equationList + UPtrList outputScalars_; + + //- Names associated with the output scalars + wordList outputScalarNames_; + + //- Dimensions associated with the output scalars + PtrList outputScalarDimensions_; + + //- Pointers to output scalarLists, used for lists, fields, etc.. + UPtrList outputScalarLists_; + + //- Dimensions associated with the outputScalarLists + PtrList outputScalarListDimensions_; + + //- Temporary storage during evaluation declared a member + // variable as a bug fix for dropped references and pointers + PtrList storage_; + + //- Internal scalars for storing constants read from equations. + // Moved from equation members to equationReader as a bug fix + PtrList internalScalars_; + + // Private Member Functions + + //- Disallow default bitwise copy construct + equationReader(const equationReader&); + + //- Disallow default bitwise assignment + void operator=(const equationReader&); + + + // Main parser functions + + //- Parse an equation + // *** Located in equationReaderParse.C *** + void parse(label index); + + // Parses a segment of an equation, used after parenthesis + // precedence is determined. Returns the map index that holds the + // source info for the result + // *** Located in equationReaderParse.C *** + label parseExpression + ( + label index, + const tokenList& tl, + const labelList& opLvl, + equationOperationList& map, + const labelList& indices, + label& storeIndex + ); + + + // General parser support functions + + //- Post an error related to equation parsing. Reports the exact + // position of the error in the equation string. + void fatalParseError + ( + const label index, + const tokenList& tl, + const label fromToken, + const label toToken, + const string& errorIn, + const OStringStream& description + ); + + //- Modify the equation string going in to the parser: + // - change ^ into : to allow detection of powers + // - add spaces around ( ) + - * / , ^ to prevent expressions from + // combining as words + string stringPreconditioner(const string& rawString); + + // Search through a string and replace all instances of findMe with + // replaceWith + void stringReplaceAll + ( + string& working, + const string& findMe, + const string& replaceWith + ); + + //- Create a map of: parenthesis levels, operation levels, + // functions, and variable sources + // *** Located in equationReaderCreateMap.C *** + void createMap + ( + const label index, + const tokenList& tl, + equationOperationList& map, + labelList& opLvl, + labelList& pl + ); + + // Returns a labelList with the indices of the maximum operation + // level. If more than one grouping exists, returns the first one. + labelList findMaxOperation + ( + const labelList& opLvl, + const labelList& indices + ); + + // Returns a labelList with the indices of the maximum parenthesis + // level. If more than one grouping exists, returns the first one. + labelList findMaxParenthesis + ( + const labelList& parenthesisList, + const labelList& equationIndices + ) const; + + // Find all negatives, give the upstream token a negative source + // index, and trim them from the list + void absorbNegatives + ( + const label equationIndex, + const tokenList& tl, + labelList& eqnIndices, + labelList& subEqnIndices, + equationOperationList& map, + labelList& opLvl + ); + + // Sets the first dimensionedScalar equal to the second one without + // tripping dimension checking errors + void dsEqual(dimensionedScalar& dso, const dimensionedScalar& dsi); + + + // Indexing-related support functions + + //- Given a labelList 'indices', remove all entries from position + // 'from' to position 'to', but not including 'exceptFor', if + // specified. Search through labelList 'parent', find the same + // entries by value (not position), and remove these also. + void trimListWithParent + ( + labelList& parent, + labelList& indices, + label from, + label to, + label exceptFor = -1 + ); + + //- Removes indices from a labelList, including from and to + // indices, but not including exceptFor index, if specified. + void trimList + ( + labelList& indices, + label from, + label to, + label exceptFor = -1 + ); + + //- Search through a labelList and return the index with the value + // 'value'. Return -1 if failed. + label findIndex + ( + const label value, + const labelList& indexList + ) const; + + + // Data-handling support functions + + //- Return the source list and source index associated with a variable + // name. Searches in this order: + // 1. externalDScalars; + // 2. externalScalars; and + // 3. dictSources. + // Returns the source info upon finding it; does not check for + // duplicates. + equationOperation findSource(const word& varName); + + //- Return the dimensionedScalar associated with a source list and + // source index + // *** Located in equationReaderGetSource.C *** + dimensionedScalar getSource + ( + const label equationIndex, + const label equationOperationIndex, + const label maxStoreIndex, + const label storageOffset + ); + + //- Add a constant to the internal scalar source list + label addInternalScalar(const scalar& value); + + //- Returns true if the stream is a dimensionedScalar dictionary + // entry. + bool isDimensionedScalar(ITstream& is); + + //- Returns true if the stream is a scalar dictionary entry + bool isScalar(ITstream& is); + + //- Returns true if the stream is an equation entry + bool isEquation(ITstream& is); + + + // Function-pointer functions, used for efficient evaluation + // equationReader uses dynamically linked function pointers for + // efficient evaluation and data sourcing. The prototypes for most of + // these functions are located in: + // *** equationReaderPointerFunctions.H *** +# include "equationReaderPointerFunctions.H" + + //- Link the functions to the pointers + // *** Located in equationReaderAssignFunctionPointers.C *** + void assignFunctionPointers(const label index); + + //- Pointed to by reportOperationFunction_ when debug level is not + // high enough - this function does nothing + void reportOperationDisabled + ( + const label& index, + const label& i, + const dimensionedScalar& ds + ) const; + + //- Pointed to by reportOperationFunction_ when debug level is + // greater than 1. This function sends operation-by-operation + // information to the console + void reportOperationEnabled + ( + const label& index, + const label& i, + const dimensionedScalar& ds + ) const; + + //- Pointed to by reportResultFunction_ when debug level is not + // high enough - this function does nothing + void reportResultDisabled + ( + const dimensionedScalar& ds + ) const; + + //- Pointed to by reportResultFunction_ when debug level is not + // high enough - this function reports the result operation-by- + // operation to the console + void reportResultEnabled + ( + const dimensionedScalar& ds + ) const; + + + +public: + + // Static data members + +// static const char* const typeName; + TypeName("equationReader"); + + + // Constructor (construct null) + equationReader(); + + // Destructor + virtual ~equationReader(); + + // Member functions + + // Adding data sources + + //- Add a dictionary + void addDataSource(const dictionary& dict); + + //- Add an external scalar + void addDataSource + ( + const scalar& value, + const word& name, + const dimensionSet& dimensions = dimless + ); + + //- Add an external dimensionedScalar + void addDataSource(const dimensionedScalar& ds); + + //- Add an external scalarList + void addDataSource + ( + const scalarList& slist, + const word& name, + const dimensionSet& dimensions = dimless + ); + + //- Add an external dimensionedScalarList + // *** Located in equationReaderTemplates.C *** + template + void addDataSource + ( + const DimensionedField& dfield + ); + + //- Change the index for a scalarList source + void setListIndex(const word& name, label newIndex); + + //- Change the index for all scalarList sources + void setListIndex(label newIndex); + + // Data source access + + //- Equations (const only) + inline const equationList& eqns() const; + + //- Dictionary source pointers + inline const UPtrList& dictSources() const; + + //- Access to dictionary source pointers + inline UPtrList& dictSources(); + + //- Dictionary look-up words (const only) + inline const PtrList& dictLookups() const; + + //- External scalarList pointers + inline const + UPtrList& externalScalarLists() const; + + //- Access to external scalarList pointers + inline UPtrList& externalScalarLists(); + + //- Dimensions associated with external scalarLists + inline const + PtrList& externalScalarListDimensions() const; + + //- Access to dimensions associated with external scalarLists + inline PtrList& externalScalarListDimensions(); + + //- Names associated with the external scalarLists + inline const wordList& externalScalarListNames() const; + + //- Access to names associated with the external scalarLists + inline wordList& externalScalarListNames(); + + //- Current index associated with the externalScalarLists + inline const labelList& externalScalarListIndex() const; + + //- Access to current index associated with the externalScalarLists + inline labelList& externalScalarListIndex(); + + //- External dimensioned scalar data source pointers + inline const + UPtrList& externalDScalars() const; + + //- Access external dimensioned scalar data source pointers + inline UPtrList& externalDScalars(); + + //- External scalar data source pointers + inline const UPtrList& externalScalars() const; + + //- Access external scalar data source pointers + inline UPtrList& externalScalars(); + + //- Const access to external scalar names + inline const wordList& externalScalarNames() const; + + //- Access external scalar names + inline wordList& externalScalarNames(); + + //- Dimensions associated with external scalars + inline const + PtrList& externalScalarDimensions() const; + + //- Access to dimensions associated with external scalars + inline PtrList& externalScalarDimensions(); + + //- Const access to output scalar data pointers + inline const + UPtrList& outputScalars() const; + + //- Access output scalar data pointers + inline UPtrList& outputScalars(); + + //- Const access to output scalar names + inline const + wordList& outputScalarNames() const; + + //- Access output scalar names + inline wordList& outputScalarNames(); + + //- Const access to output scalar dimensions + inline const + PtrList& outputScalarDimensions() const; + + //- Access output scalar dimensions + inline PtrList& outputScalarDimensions(); + + //- Const access to pointers to output scalarLists + inline const UPtrList& outputScalarLists() const; + + //- Access to pointers to output scalarLists + inline UPtrList& outputScalarLists(); + + //- Const access to dimensions associated with outputScalarLists + inline const + PtrList& outputScalarListDimensions() const; + + //- Access to dimensions associated with outputScalarLists + inline PtrList& outputScalarListDimensions(); + + + // Equations + + //- Creates a new equation but does not parse it. If equation + // exists, throws an error. + void createEquation + ( + equation eqn + ); + + //- linkOutput functions + // These functions assign or reassign an output variable to an + // equation - enables the use of update() + + //- Given equation name, and a dimensionedScalar + void linkOutput + ( + const word& eqnName, + dimensionedScalar& outputDVar + ); + + //- Given equation name, and dimensionedScalar components + void linkOutput + ( + const word& eqnName, + scalar& value, + const word& name, + const dimensionSet& dimensions = dimless + ); + + //- Given an equation name, and a dimensionedField + // *** Located in equationReaderTemplates *** + template + void linkOutput + ( + const word& eqnName, + DimensionedField& dfield + ); + + //- Given an equation name, and scalarList components + void linkOutput + ( + const word& eqnName, + scalarList& outputSList, + const dimensionSet& dimensions + ); + + //- Given the equation index, and dimensionedScalar + void linkOutput + ( + label index, + dimensionedScalar& outputDVar + ); + + //- Given the equation index, and dimensionedScalar components + void linkOutput + ( + label index, + scalar& value, + const word& name, + const dimensionSet& dimensions = dimless + ); + + //- Given the equation index, and DimensionedField + // *** Located in equationReaderTemplates.C *** + template + void linkOutput + ( + label index, + DimensionedField& dfield + ); + + //- Given the equation index, and scalarList components + void linkOutput + ( + label index, + scalarList& outputSList, + const dimensionSet& dimensions + ); + + //- readEquation functions - if equation exists, it assumes this is + // a reread. If parameters include output variables, this + // function will also perform a linkOutput + + //- Given an equation + void readEquation + ( + equation eqn + ); + + //- Given an equation and linkOutput to a dimensionedScalar + void readEquation + ( + equation eqn, + dimensionedScalar& outputDVar + ); + + //- Given an equation and linkOutput to a dimensionedScalar's + // components + void readEquation + ( + equation eqn, + scalar& value, + const word& name, + const dimensionSet& dimensions = dimless + ); + + //- Given an equation and linkOutput to a DimensionedField + // *** Located in equationReaderTemplates.C *** + template + void readEquation + ( + equation eqn, + DimensionedField& dfield + ); + + //- Given an equation and linkOutput to a DimensionedField + void readEquation + ( + equation eqn, + scalarList& outputSList, + const dimensionSet& dimensions + ); + + //- Read equation from a dictionary + void readEquation + ( + const dictionary& sourceDict, + const word& eqnName + ); + + //- Read equation from a dictionary and linkOutput to a + // dimensionedScalar + void readEquation + ( + const dictionary& sourceDict, + const word& eqnName, + dimensionedScalar& outputDVar + ); + + //- Read equation from a dictionary and linkOutput to a + // dimensionedScalar's components + void readEquation + ( + const dictionary& sourceDict, + const word& eqnName, + scalar& value, + const word& name, + const dimensionSet& dimensions = dimless + ); + + //- Evaluate a single equation, given a variable name, and return + // new value. Do not set the associated output variable + // *** Located in equationReaderEvaluate.C *** + dimensionedScalar evaluate(const word& equationName); + + //- Evaluate a single equation, given an index number, and return + // new value. Does not set the associated output variable. + // storageOffset is for internal use only, do not use this. + // *** Located in equationReaderEvaluate.C *** + dimensionedScalar evaluate + ( + const label& index, + label storageOffset = 0 + ); + + //- Evaluate the equation and output the result as a Field, cycling + // through all the source field indices (setFieldIndex) + // Given an index and DimensionedField + // *** Located in equationReaderTemplates.C *** + template + void evaluateField + ( + const label& index, + DimensionedField& dfield + ); + + //- Evaluate the equation and output the result as a scalarList, + // cycling through all the source field indices (setFieldIndex) + // Given an index and scalarList components + // *** Located in equationReaderEvaluate.C *** + void evaluateField + ( + const label& index, + scalarList& outputSList, + dimensionSet& dimensions + ); + + //- Evaluate a single equation, given a variable name, and set the + // associated output variable to the new value + void update(const word& equationName); + + //- Evaluate a single equation, given an index number, and set the + // associated output variable to the new value + void update(const label& index); + + //- Evaluate all equations, setting the associated output variables + // as they are calculated + void update(); + + //- Returns true if equationName exists in equationList + bool found(const word& equationName); + + //- Returns the index of a given equationName, -1 if not found + label lookup(const word& equationName); + + //- Delete an equation, given a name + void deleteEquation(const word& equationName); + + //- Delete an equation, given an index number + void deleteEquation(const label& index); + + // Input / output related functions + // *** Located in equationReaderIO.C *** + + //- Output data source information to the Ostream + Ostream& dataSourceStatus(Ostream& os) const; + + friend Istream& operator>>(Istream&, equationReader&); + friend Ostream& operator<<(Ostream&, const equationReader&); + +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "equationReaderI.H" +#include "equationReaderTemplates.C" +#endif diff --git a/src/OpenFOAM/db/dictionary/equation/equationReader/equationReaderAssignPointerFunctions.C b/src/OpenFOAM/db/dictionary/equation/equationReader/equationReaderAssignPointerFunctions.C new file mode 100644 index 000000000..8c847400a --- /dev/null +++ b/src/OpenFOAM/db/dictionary/equation/equationReader/equationReaderAssignPointerFunctions.C @@ -0,0 +1,1380 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +void Foam::equationReader::assignFunctionPointers(const label index) +{ + forAll(eqns_[index], i) + { + //Assign getSource functions first + equation& eqn(eqns_[index]); + equationOperation& eqOp(eqn[i]); + label zeroSourceIndex = mag(eqOp.sourceIndex()) - 1; + switch (eqns_[index].ops()[i].sourceList()) + { + case equationOperation::slnone: + eqOp.assignSourceFunction + ( + &Foam::equationReader::getSourceNone + ); + break; + case equationOperation::sldictSource: + { + if (zeroSourceIndex >= dictSources_.size()) + { + FatalErrorIn("equationReader::assignFunctionPointers") + << "Index " << zeroSourceIndex << " out of bounds (0, " + << dictSources_.size() - 1 << ")" + << abort(FatalError); + } + + word varName(dictLookups_[eqOp.dictLookupIndex()]); + + ITstream srcStrm + ( + dictSources_[zeroSourceIndex].lookup(varName) + ); + if (isDimensionedScalar(srcStrm)) + { + eqOp.assignSourceFunction + ( + &Foam::equationReader::getSourceDictSourceDScalar + ); + } + else if (isScalar(srcStrm)) + { + eqOp.assignSourceFunction + ( + &Foam::equationReader::getSourceDictSourceScalar + ); + } + else + { + // Neither scalar nor dimensionedScalar + FatalIOErrorIn + ( + "equationReader::assignFunctionPointers", + dictSources_[zeroSourceIndex] + ) + << "Expecting a scalar or a dimensionedScalar. Keyword " + << varName << " is referenced by an equation, and therfore" + << " can only be one of these two types." + << exit(FatalIOError); + } + break; + } + case equationOperation::slexternalDScalar: + if (zeroSourceIndex >= externalDScalars_.size()) + { + FatalErrorIn("equationReader::assignFunctionPointers") + << "Index " << zeroSourceIndex << " out of bounds (0, " + << externalDScalars_.size() - 1 << ")" + << abort(FatalError); + } + eqOp.assignSourceFunction + ( + &Foam::equationReader::getSourceExternalDScalar + ); + break; + case equationOperation::slexternalScalar: + if (zeroSourceIndex >= externalScalars_.size()) + { + FatalErrorIn("equationReader::assignPointerFunctions") + << "Index " << zeroSourceIndex << " out of bounds (0, " + << externalScalars_.size() - 1 << ")" + << abort(FatalError); + } + eqOp.assignSourceFunction + ( + &Foam::equationReader::getSourceExternalScalar + ); + break; + case equationOperation::slexternalScalarList: + if (zeroSourceIndex >= externalScalarLists_.size()) + { + FatalErrorIn("equationReader::assignPointerFunctions") + << "Index " << zeroSourceIndex << " out of bounds (0, " + << externalScalarLists_.size() - 1 << ")" + << abort(FatalError); + } + eqOp.assignSourceFunction + ( + &Foam::equationReader::getSourceExternalScalarList + ); + break; + case equationOperation::slinternalScalar: + if (zeroSourceIndex >= internalScalars_.size()) + { + FatalErrorIn("equationReader::getSouce") + << "Index " << zeroSourceIndex << " out of bounds (0, " + << internalScalars_.size() - 1 << ")" + << abort(FatalError); + } + eqOp.assignSourceFunction + ( + &Foam::equationReader::getSourceInternalScalar + ); + break; + case equationOperation::slequation: + if (zeroSourceIndex >= eqns_.size()) + { + FatalErrorIn("equationReader::getSouce") + << "Index " << zeroSourceIndex << " out of bounds (0, " + << eqns_.size() - 1 << ")" + << abort(FatalError); + } + eqOp.assignSourceFunction + ( + &Foam::equationReader::getSourceEquationCircRefDetect + ); + break; + case equationOperation::slstorage: + if (eqOp.operation() == equationOperation::otstore) + { + eqOp.assignSourceFunction + ( + &Foam::equationReader::getSourceNone + ); + } + else + { + eqOp.assignSourceFunction + ( + &Foam::equationReader::getSourceStorage + ); + } + break; + } + + // Assign evaluate functions next + switch (eqOp.operation()) + { + case equationOperation::otnone: + eqOp.assignOpFunction + ( + &Foam::equationReader::evalNone + ); + break; + case equationOperation::otretrieve: + if (eqn.changeDimensions()) + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalRetrieveChangeDimensions + ); + } + else + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalRetrieve + ); + } + break; + case equationOperation::otstore: + eqOp.assignOpFunction + ( + &Foam::equationReader::evalStore + ); + break; + case equationOperation::otplus: + if (eqn.changeDimensions()) + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalPlusChangeDimensions + ); + } + else + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalPlusDimCheck + ); + } + break; + case equationOperation::otminus: + if (eqn.changeDimensions()) + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalMinusChangeDimensions + ); + } + else + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalMinusDimCheck + ); + } + break; + case equationOperation::ottimes: + eqOp.assignOpFunction + ( + &Foam::equationReader::evalTimes + ); + break; + case equationOperation::otdivide: + eqOp.assignOpFunction + ( + &Foam::equationReader::evalDivide + ); + break; + case equationOperation::otpow: + if (eqn.changeDimensions()) + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalPowChangeDimensions + ); + } + else + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalPowDimCheck + ); + } + break; + case equationOperation::otsign: + if + ( + eqOp.sourceList() + != equationOperation::slnone + ) + { + FatalErrorIn("equationReader::assignFunctionPointers") + << "In the equation for " + << eqn.equationName() << ", given by " + << token::NL << token::TAB << eqn.rawText() + << token::NL << "Function 'sign' takes only one " + << "parameter." + << abort(FatalError); + } + eqOp.assignOpFunction + ( + &Foam::equationReader::evalSign + ); + break; + case equationOperation::otpos: + if + ( + eqOp.sourceList() + != equationOperation::slnone + ) + { + FatalErrorIn("equationReader::assignFunctionPointers") + << "In the equation for " + << eqn.equationName() << ", given by " + << token::NL << token::TAB << eqn.rawText() + << token::NL << "Function 'pos' takes only one " + << "parameter." + << abort(FatalError); + } + eqOp.assignOpFunction + ( + &Foam::equationReader::evalPos + ); + break; + case equationOperation::otneg: + if + ( + eqOp.sourceList() + != equationOperation::slnone + ) + { + FatalErrorIn("equationReader::assignFunctionPointers") + << "In the equation for " + << eqn.equationName() << ", given by " + << token::NL << token::TAB << eqn.rawText() + << token::NL << "Function 'neg' takes only one " + << "parameter." + << abort(FatalError); + } + eqOp.assignOpFunction + ( + &Foam::equationReader::evalNeg + ); + break; + case equationOperation::otmag: + if + ( + eqOp.sourceList() + != equationOperation::slnone + ) + { + FatalErrorIn("equationReader::assignFunctionPointers") + << "In the equation for " + << eqn.equationName() << ", given by " + << token::NL << token::TAB << eqn.rawText() + << token::NL << "Function 'mag' takes only one " + << "parameter." + << abort(FatalError); + } + eqOp.assignOpFunction + ( + &Foam::equationReader::evalMag + ); + break; + case equationOperation::otlimit: + if + ( + eqOp.sourceList() + == equationOperation::slnone + ) + { + FatalErrorIn("equationReader::evaluate") + << "In the equation for " + << eqn.equationName() << ", given by " + << token::NL << token::TAB << eqn.rawText() + << token::NL << "Function 'limit' requires two " + << "parameters." + << abort(FatalError); + } + eqOp.assignOpFunction + ( + &Foam::equationReader::evalLimit + ); + break; + case equationOperation::otminMod: + if + ( + eqOp.sourceList() + == equationOperation::slnone + ) + { + FatalErrorIn("equationReader::evaluate") + << "In the equation for " + << eqn.equationName() << ", given by " + << token::NL << token::TAB << eqn.rawText() + << token::NL << "Function 'minMod' requires two " + << "parameters." + << abort(FatalError); + } + eqOp.assignOpFunction + ( + &Foam::equationReader::evalMinMod + ); + break; + case equationOperation::otsqrtSumSqr: + if + ( + eqOp.sourceList() + == equationOperation::slnone + ) + { + FatalErrorIn("equationReader::evaluate") + << "In the equation for " + << eqn.equationName() << ", given by " + << token::NL << token::TAB << eqn.rawText() + << token::NL << "Function 'sqrtSumSqr' requires two " + << "parameters." + << abort(FatalError); + } + eqOp.assignOpFunction + ( + &Foam::equationReader::evalSqrtSumSqr + ); + break; + case equationOperation::otsqr: + if + ( + eqOp.sourceList() + != equationOperation::slnone + ) + { + FatalErrorIn("equationReader::evaluate") + << "In the equation for " + << eqn.equationName() << ", given by " + << token::NL << token::TAB << eqn.rawText() + << token::NL << "Function 'sqr' takes only one " + << "parameter." + << abort(FatalError); + } + eqOp.assignOpFunction + ( + &Foam::equationReader::evalSqr + ); + break; + case equationOperation::otpow3: + if + ( + eqOp.sourceList() + != equationOperation::slnone + ) + { + FatalErrorIn("equationReader::evaluate") + << "In the equation for " + << eqn.equationName() << ", given by " + << token::NL << token::TAB << eqn.rawText() + << token::NL << "Function 'pow3' takes only one " + << "parameter." + << abort(FatalError); + } + eqOp.assignOpFunction + ( + &Foam::equationReader::evalPow3 + ); + break; + case equationOperation::otpow4: + if + ( + eqOp.sourceList() + != equationOperation::slnone + ) + { + FatalErrorIn("equationReader::evaluate") + << "In the equation for " + << eqn.equationName() << ", given by " + << token::NL << token::TAB << eqn.rawText() + << token::NL << "Function 'pow4' takes only one " + << "parameter." + << abort(FatalError); + } + eqOp.assignOpFunction + ( + &Foam::equationReader::evalPow4 + ); + break; + case equationOperation::otpow5: + if + ( + eqOp.sourceList() + != equationOperation::slnone + ) + { + FatalErrorIn("equationReader::evaluate") + << "In the equation for " + << eqn.equationName() << ", given by " + << token::NL << token::TAB << eqn.rawText() + << token::NL << "Function 'pow5' takes only one " + << "parameter." + << abort(FatalError); + } + eqOp.assignOpFunction + ( + &Foam::equationReader::evalPow5 + ); + break; + case equationOperation::otinv: + if + ( + eqOp.sourceList() + != equationOperation::slnone + ) + { + FatalErrorIn("equationReader::evaluate") + << "In the equation for " + << eqn.equationName() << ", given by " + << token::NL << token::TAB << eqn.rawText() + << token::NL << "Function 'inv' takes only one " + << "parameter." + << abort(FatalError); + } + eqOp.assignOpFunction + ( + &Foam::equationReader::evalInv + ); + break; + case equationOperation::otsqrt: + if + ( + eqOp.sourceList() + != equationOperation::slnone + ) + { + FatalErrorIn("equationReader::evaluate") + << "In the equation for " + << eqn.equationName() << ", given by " + << token::NL << token::TAB << eqn.rawText() + << token::NL << "Function 'sqrt' takes only one " + << "parameter." + << abort(FatalError); + } + eqOp.assignOpFunction + ( + &Foam::equationReader::evalSqrt + ); + break; + case equationOperation::otcbrt: + if + ( + eqOp.sourceList() + != equationOperation::slnone + ) + { + FatalErrorIn("equationReader::evaluate") + << "In the equation for " + << eqn.equationName() << ", given by " + << token::NL << token::TAB << eqn.rawText() + << token::NL << "Function 'cbrt' takes only one " + << "parameter." + << abort(FatalError); + } + eqOp.assignOpFunction + ( + &Foam::equationReader::evalCbrt + ); + break; + case equationOperation::othypot: + if + ( + eqOp.sourceList() + == equationOperation::slnone + ) + { + FatalErrorIn("equationReader::evaluate") + << "In the equation for " + << eqn.equationName() << ", given by " + << token::NL << token::TAB << eqn.rawText() + << token::NL << "Function 'hypot' requires two " + << "parameters." + << abort(FatalError); + } + if (eqn.changeDimensions()) + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalHypotChangeDimensions + ); + } + else + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalHypotDimCheck + ); + } + break; + case equationOperation::otexp: + if + ( + eqOp.sourceList() + != equationOperation::slnone + ) + { + FatalErrorIn("equationReader::evaluate") + << "In the equation for " + << eqn.equationName() << ", given by " + << token::NL << token::TAB << eqn.rawText() + << token::NL << "Function 'exp' takes only one " + << "parameter." + << abort(FatalError); + } + if (eqn.changeDimensions()) + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalExpChangeDimensions + ); + } + else + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalExpDimCheck + ); + } + break; + case equationOperation::otlog: + if + ( + eqOp.sourceList() + != equationOperation::slnone + ) + { + FatalErrorIn("equationReader::evaluate") + << "In the equation for " + << eqn.equationName() << ", given by " + << token::NL << token::TAB << eqn.rawText() + << token::NL << "Function 'log' takes only one " + << "parameter." + << abort(FatalError); + } + if (eqn.changeDimensions()) + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalLogChangeDimensions + ); + } + else + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalLogDimCheck + ); + } + break; + case equationOperation::otlog10: + if + ( + eqOp.sourceList() + != equationOperation::slnone + ) + { + FatalErrorIn("equationReader::evaluate") + << "In the equation for " + << eqn.equationName() << ", given by " + << token::NL << token::TAB << eqn.rawText() + << token::NL << "Function 'log10' takes only one " + << "parameter." + << abort(FatalError); + } + if (eqn.changeDimensions()) + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalLog10ChangeDimensions + ); + } + else + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalLog10DimCheck + ); + } + break; + case equationOperation::otsin: + if + ( + eqOp.sourceList() + != equationOperation::slnone + ) + { + FatalErrorIn("equationReader::evaluate") + << "In the equation for " + << eqn.equationName() << ", given by " + << token::NL << token::TAB << eqn.rawText() + << token::NL << "Function 'sin' takes only one " + << "parameter." + << abort(FatalError); + } + if (eqn.changeDimensions()) + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalSinChangeDimensions + ); + } + else + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalSinDimCheck + ); + } + break; + case equationOperation::otcos: + if + ( + eqOp.sourceList() + != equationOperation::slnone + ) + { + FatalErrorIn("equationReader::evaluate") + << "In the equation for " + << eqn.equationName() << ", given by " + << token::NL << token::TAB << eqn.rawText() + << token::NL << "Function 'cos' takes only one " + << "parameter." + << abort(FatalError); + } + if (eqn.changeDimensions()) + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalCosChangeDimensions + ); + } + else + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalCosDimCheck + ); + } + break; + case equationOperation::ottan: + if + ( + eqOp.sourceList() + != equationOperation::slnone + ) + { + FatalErrorIn("equationReader::evaluate") + << "In the equation for " + << eqn.equationName() << ", given by " + << token::NL << token::TAB << eqn.rawText() + << token::NL << "Function 'tan' takes only one " + << "parameter." + << abort(FatalError); + } + if (eqn.changeDimensions()) + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalTanChangeDimensions + ); + } + else + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalTanDimCheck + ); + } + break; + case equationOperation::otasin: + if + ( + eqOp.sourceList() + != equationOperation::slnone + ) + { + FatalErrorIn("equationReader::evaluate") + << "In the equation for " + << eqn.equationName() << ", given by " + << token::NL << token::TAB << eqn.rawText() + << token::NL << "Function 'asin' takes only one " + << "parameter." + << abort(FatalError); + } + if (eqn.changeDimensions()) + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalAsinChangeDimensions + ); + } + else + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalAsinDimCheck + ); + } + break; + case equationOperation::otacos: + if + ( + eqOp.sourceList() + != equationOperation::slnone + ) + { + FatalErrorIn("equationReader::evaluate") + << "In the equation for " + << eqn.equationName() << ", given by " + << token::NL << token::TAB << eqn.rawText() + << token::NL << "Function 'acos' takes only one " + << "parameter." + << abort(FatalError); + } + if (eqn.changeDimensions()) + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalAcosChangeDimensions + ); + } + else + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalAcosDimCheck + ); + } + break; + case equationOperation::otatan: + if + ( + eqOp.sourceList() + != equationOperation::slnone + ) + { + FatalErrorIn("equationReader::evaluate") + << "In the equation for " + << eqn.equationName() << ", given by " + << token::NL << token::TAB << eqn.rawText() + << token::NL << "Function 'atan' takes only one " + << "parameter." + << abort(FatalError); + } + if (eqn.changeDimensions()) + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalAtanChangeDimensions + ); + } + else + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalAtanDimCheck + ); + } + break; + case equationOperation::otsinh: + if + ( + eqOp.sourceList() + != equationOperation::slnone + ) + { + FatalErrorIn("equationReader::evaluate") + << "In the equation for " + << eqn.equationName() << ", given by " + << token::NL << token::TAB << eqn.rawText() + << token::NL << "Function 'sinh' takes only one " + << "parameter." + << abort(FatalError); + } + if (eqn.changeDimensions()) + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalSinhChangeDimensions + ); + } + else + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalSinhDimCheck + ); + } + break; + case equationOperation::otcosh: + if + ( + eqOp.sourceList() + != equationOperation::slnone + ) + { + FatalErrorIn("equationReader::evaluate") + << "In the equation for " + << eqn.equationName() << ", given by " + << token::NL << token::TAB << eqn.rawText() + << token::NL << "Function 'cosh' takes only one " + << "parameter." + << abort(FatalError); + } + if (eqn.changeDimensions()) + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalCoshChangeDimensions + ); + } + else + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalCoshDimCheck + ); + } + break; + case equationOperation::ottanh: + if + ( + eqOp.sourceList() + != equationOperation::slnone + ) + { + FatalErrorIn("equationReader::evaluate") + << "In the equation for " + << eqn.equationName() << ", given by " + << token::NL << token::TAB << eqn.rawText() + << token::NL << "Function 'tanh' takes only one " + << "parameter." + << abort(FatalError); + } + if (eqn.changeDimensions()) + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalTanhChangeDimensions + ); + } + else + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalTanhDimCheck + ); + } + break; + case equationOperation::otasinh: + if + ( + eqOp.sourceList() + != equationOperation::slnone + ) + { + FatalErrorIn("equationReader::evaluate") + << "In the equation for " + << eqn.equationName() << ", given by " + << token::NL << token::TAB << eqn.rawText() + << token::NL << "Function 'sinh' takes only one " + << "parameter." + << abort(FatalError); + } + if (eqn.changeDimensions()) + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalAsinhChangeDimensions + ); + } + else + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalAsinhDimCheck + ); + } + break; + case equationOperation::otacosh: + if + ( + eqOp.sourceList() + != equationOperation::slnone + ) + { + FatalErrorIn("equationReader::evaluate") + << "In the equation for " + << eqn.equationName() << ", given by " + << token::NL << token::TAB << eqn.rawText() + << token::NL << "Function 'acosh' takes only one " + << "parameter." + << abort(FatalError); + } + if (eqn.changeDimensions()) + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalAcoshChangeDimensions + ); + } + else + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalAcoshDimCheck + ); + } + break; + case equationOperation::otatanh: + if + ( + eqOp.sourceList() + != equationOperation::slnone + ) + { + FatalErrorIn("equationReader::evaluate") + << "In the equation for " + << eqn.equationName() << ", given by " + << token::NL << token::TAB << eqn.rawText() + << token::NL << "Function 'atanh' takes only one " + << "parameter." + << abort(FatalError); + } + if (eqn.changeDimensions()) + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalAtanhChangeDimensions + ); + } + else + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalAtanhDimCheck + ); + } + break; + case equationOperation::oterf: + if + ( + eqOp.sourceList() + != equationOperation::slnone + ) + { + FatalErrorIn("equationReader::evaluate") + << "In the equation for " + << eqn.equationName() << ", given by " + << token::NL << token::TAB << eqn.rawText() + << token::NL << "Function 'erf' takes only one " + << "parameter." + << abort(FatalError); + } + if (eqn.changeDimensions()) + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalErfChangeDimensions + ); + } + else + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalErfDimCheck + ); + } + break; + case equationOperation::oterfc: + if + ( + eqOp.sourceList() + != equationOperation::slnone + ) + { + FatalErrorIn("equationReader::evaluate") + << "In the equation for " + << eqn.equationName() << ", given by " + << token::NL << token::TAB << eqn.rawText() + << token::NL << "Function 'erfc' takes only one " + << "parameter." + << abort(FatalError); + } + if (eqn.changeDimensions()) + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalErfcChangeDimensions + ); + } + else + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalErfcDimCheck + ); + } + break; + case equationOperation::otlgamma: + if + ( + eqOp.sourceList() + != equationOperation::slnone + ) + { + FatalErrorIn("equationReader::evaluate") + << "In the equation for " + << eqn.equationName() << ", given by " + << token::NL << token::TAB << eqn.rawText() + << token::NL << "Function 'lgamma' takes only one " + << "parameter." + << abort(FatalError); + } + if (eqn.changeDimensions()) + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalLgammaChangeDimensions + ); + } + else + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalLgammaDimCheck + ); + } + break; + case equationOperation::otj0: + if + ( + eqOp.sourceList() + != equationOperation::slnone + ) + { + FatalErrorIn("equationReader::evaluate") + << "In the equation for " + << eqn.equationName() << ", given by " + << token::NL << token::TAB << eqn.rawText() + << token::NL << "Function 'j0' takes only one " + << "parameter." + << abort(FatalError); + } + if (eqn.changeDimensions()) + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalJ0ChangeDimensions + ); + } + else + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalJ0DimCheck + ); + } + break; + case equationOperation::otj1: + if + ( + eqOp.sourceList() + != equationOperation::slnone + ) + { + FatalErrorIn("equationReader::evaluate") + << "In the equation for " + << eqn.equationName() << ", given by " + << token::NL << token::TAB << eqn.rawText() + << token::NL << "Function 'j1' takes only one " + << "parameter." + << abort(FatalError); + } + if (eqn.changeDimensions()) + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalJ1ChangeDimensions + ); + } + else + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalJ1DimCheck + ); + } + break; + case equationOperation::otjn: + if + ( + eqOp.sourceList() + == equationOperation::slnone + ) + { + FatalErrorIn("equationReader::evaluate") + << "In the equation for " + << eqn.equationName() << ", given by " + << token::NL << token::TAB << eqn.rawText() + << token::NL << "Function 'cbrt' requires two " + << "parameters." + << abort(FatalError); + } + if (eqn.changeDimensions()) + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalJnChangeDimensions + ); + } + else + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalJnDimCheck + ); + } + break; + case equationOperation::oty0: + if + ( + eqOp.sourceList() + != equationOperation::slnone + ) + { + FatalErrorIn("equationReader::evaluate") + << "In the equation for " + << eqn.equationName() << ", given by " + << token::NL << token::TAB << eqn.rawText() + << token::NL << "Function 'y0' takes only one " + << "parameter." + << abort(FatalError); + } + if (eqn.changeDimensions()) + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalY0ChangeDimensions + ); + } + else + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalY0DimCheck + ); + } + break; + case equationOperation::oty1: + if + ( + eqOp.sourceList() + != equationOperation::slnone + ) + { + FatalErrorIn("equationReader::evaluate") + << "In the equation for " + << eqn.equationName() << ", given by " + << token::NL << token::TAB << eqn.rawText() + << token::NL << "Function 'y1' takes only one " + << "parameter." + << abort(FatalError); + } + if (eqn.changeDimensions()) + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalY1ChangeDimensions + ); + } + else + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalY1DimCheck + ); + } + break; + case equationOperation::otyn: + if + ( + eqOp.sourceList() + == equationOperation::slnone + ) + { + FatalErrorIn("equationReader::evaluate") + << "In the equation for " + << eqn.equationName() << ", given by " + << token::NL << token::TAB << eqn.rawText() + << token::NL << "Function 'yn' requires two " + << "parameters." + << abort(FatalError); + } + if (eqn.changeDimensions()) + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalY1ChangeDimensions + ); + } + else + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalY1DimCheck + ); + } + break; + case equationOperation::otmax: + if + ( + eqOp.sourceList() + == equationOperation::slnone + ) + { + FatalErrorIn("equationReader::evaluate") + << "In the equation for " + << eqn.equationName() << ", given by " + << token::NL << token::TAB << eqn.rawText() + << token::NL << "Function 'max' requires two " + << "parameters." + << abort(FatalError); + } + if (eqn.changeDimensions()) + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalMaxChangeDimensions + ); + } + else + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalMaxDimCheck + ); + } + break; + case equationOperation::otmin: + if + ( + eqOp.sourceList() + == equationOperation::slnone + ) + { + FatalErrorIn("equationReader::evaluate") + << "In the equation for " + << eqn.equationName() << ", given by " + << token::NL << token::TAB << eqn.rawText() + << token::NL << "Function 'min' requires two " + << "parameters." + << abort(FatalError); + } + if (eqn.changeDimensions()) + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalMinChangeDimensions + ); + } + else + { + eqOp.assignOpFunction + ( + &Foam::equationReader::evalMinDimCheck + ); + } + break; + case equationOperation::otstabilise: + if + ( + eqOp.sourceList() + == equationOperation::slnone + ) + { + FatalErrorIn("equationReader::evaluate") + << "In the equation for " + << eqn.equationName() << ", given by " + << token::NL << token::TAB << eqn.rawText() + << token::NL << "Function 'stabilise' requires two " + << "parameters." + << abort(FatalError); + } + eqOp.assignOpFunction + ( + &Foam::equationReader::evalStabilise + ); + break; + } // end switch + } // end forAll equation operations +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/db/dictionary/equation/equationReader/equationReaderCreateMap.C b/src/OpenFOAM/db/dictionary/equation/equationReader/equationReaderCreateMap.C new file mode 100644 index 000000000..e2b9bec7e --- /dev/null +++ b/src/OpenFOAM/db/dictionary/equation/equationReader/equationReaderCreateMap.C @@ -0,0 +1,563 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::equationReader::createMap +( + const label index, + const tokenList& tl, + equationOperationList& map, + labelList& opLvl, + labelList& pl +) +{ +// equation * eqn(&this->operator[](index)); + + // current parenthesis level - note, a negative parenthesis value indicates + // that this is the root level of a function, and therefore ',' is allowed + label p(0); + + forAll(tl, i) + { + if (tl[i].isNumber()) + { + // Internal constant. Save to internalScalars and record source + opLvl[i] = 0; + pl[i] = p; + map[i] = equationOperation + ( + equationOperation::slinternalScalar, + addInternalScalar(tl[i].number()) + 1, + 0, + equationOperation::otnone + ); +/* + //Bug fix + eqn = &this->operator[](index); + + eqn->internalScalars()->setSize + ( + eqn->internalScalars()->size() + 1 + ); + eqn->internalScalars()->operator[] + ( + eqn->internalScalars()->size() - 1 + ) = tl[i].number(); + opLvl[i] = 0; + pl[i] = p; + map[i] = equationOperation + ( + equationOperation::slinternalScalar, + eqn->internalScalars()->size(), + 0, + equationOperation::otnone + ); +*/ + } + else if (tl[i].isWord()) + { + // could be a variable name, function or mathematical constant + // - check for function first - function is [word][punctuation '('] + if + ( + (i < (tl.size() - 1)) + && (tl[i + 1].isPunctuation()) + && (tl[i + 1].pToken() == token::BEGIN_LIST) + ) + { + // Function detected; function brackets are negative + opLvl[i] = 4; + p = -mag(p) - 1; + pl[i] = p; + map[i] = equationOperation + ( + equationOperation::slnone, + 0, + 0, + equationOperation::findOp(tl[i].wordToken()) + ); + + if (map[i].operation() == equationOperation::otnone) + { + OStringStream description; + description << tl[i].wordToken() << " is not a recognized " + << "function."; + fatalParseError + ( + index, + tl, + i, + i, + "equationReader::parse", + description + ); + } + + // Set next token as well (function opening parenthesis) + i++; + opLvl[i] = 4; + pl[i] = p; + map[i] = equationOperation + ( + equationOperation::slnone, + 0, + 0, + equationOperation::otnone + ); + } + else if + ( + (tl[i].wordToken() == "e_") + || (tl[i].wordToken() == "pi_") + || (tl[i].wordToken() == "twoPi_") + || (tl[i].wordToken() == "piByTwo_") + || (tl[i].wordToken() == "GREAT_") + || (tl[i].wordToken() == "VGREAT_") + || (tl[i].wordToken() == "ROOTVGREAT_") + || (tl[i].wordToken() == "SMALL_") + || (tl[i].wordToken() == "VSMALL_") + || (tl[i].wordToken() == "ROOTVSMALL_") + ) + { + // Mathematical constant + + //Bug fix +// eqn = &this->operator[](index); + + if + ( + findSource(tl[i].wordToken()).sourceList() + != equationOperation::slnone + ) + { + // Found a possible conflicting variable name - warn + WarningIn("equationReader::createMap") + << "Equation for " << eqns_[index].equationName() + << ", given by:" << token::NL << token::TAB + << eqns_[index].rawText() << token:: NL << "refers " + << "to '" << tl[i].wordToken() << "'. Although " + << "variable " << tl[i].wordToken() << "was found in " + << "the data sources, " << tl[i].wordToken() << " is a" + << " mathematical constant. The mathematical constant " + << "will be used." << endl; + } + +/* eqn->internalScalars()->setSize + ( + eqn->internalScalars()->size() + 1 + ); +*/ + opLvl[i] = 0; + pl[i] = p; + label internalIndex(0); + if (tl[i].wordToken() == "e_") + { + internalIndex = + addInternalScalar(mathematicalConstant::e) + 1; + } + else if (tl[i].wordToken() == "pi_") + { + internalIndex = + addInternalScalar(mathematicalConstant::pi) + 1; + } + else if (tl[i].wordToken() == "twoPi_") + { + internalIndex = + addInternalScalar(mathematicalConstant::twoPi) + 1; + } + else if (tl[i].wordToken() == "piByTwo_") + { + internalIndex = + addInternalScalar(mathematicalConstant::piByTwo) + 1; + } + else if (tl[i].wordToken() == "GREAT_") + { + internalIndex = + addInternalScalar(GREAT) + 1; + } + else if (tl[i].wordToken() == "VGREAT_") + { + internalIndex = + addInternalScalar(VGREAT) + 1; + } + else if (tl[i].wordToken() == "ROOTVGREAT_") + { + internalIndex = + addInternalScalar(ROOTVGREAT) + 1; + } + else if (tl[i].wordToken() == "SMALL_") + { + internalIndex = + addInternalScalar(SMALL) + 1; + } + else if (tl[i].wordToken() == "VSMALL_") + { + internalIndex = + addInternalScalar(VSMALL) + 1; + } + else // tl[i].wordToken() == "ROOTVSMALL_" + { + internalIndex = + addInternalScalar(ROOTVSMALL) + 1; + } + map[i] = equationOperation + ( + equationOperation::slinternalScalar, + internalIndex, + 0, + equationOperation::otnone + ); +/* + if (tl[i].wordToken() == "e_") + { + eqn->internalScalars()->operator[] + ( + eqn->internalScalars()->size() - 1 + ) = mathematicalConstant::e; + } + else if (tl[i].wordToken() == "pi_") + { + eqn->internalScalars()->operator[] + ( + eqn->internalScalars()->size() - 1 + ) = mathematicalConstant::pi; + } + else if (tl[i].wordToken() == "twoPi_") + { + eqn->internalScalars()->operator[] + ( + eqn->internalScalars()->size() - 1 + ) = mathematicalConstant::twoPi; + } + else if (tl[i].wordToken() == "piByTwo_") + { + eqn->internalScalars()->operator[] + ( + eqn->internalScalars()->size() - 1 + ) = mathematicalConstant::piByTwo; + } + else if (tl[i].wordToken() == "GREAT_") + { + eqn->internalScalars()->operator[] + ( + eqn->internalScalars()->size() - 1 + ) = GREAT; + } + else if (tl[i].wordToken() == "VGREAT_") + { + eqn->internalScalars()->operator[] + ( + eqn->internalScalars()->size() - 1 + ) = VGREAT; + } + else if (tl[i].wordToken() == "ROOTVGREAT_") + { + eqn->internalScalars()->operator[] + ( + eqn->internalScalars()->size() - 1 + ) = ROOTVGREAT; + } + else if (tl[i].wordToken() == "SMALL_") + { + eqn->internalScalars()->operator[] + ( + eqn->internalScalars()->size() - 1 + ) = SMALL; + } + else if (tl[i].wordToken() == "VSMALL_") + { + eqn->internalScalars()->operator[] + ( + eqn->internalScalars()->size() - 1 + ) = VSMALL; + } + else if (tl[i].wordToken() == "ROOTVSMALL_") + { + eqn->internalScalars()->operator[] + ( + eqn->internalScalars()->size() - 1 + ) = ROOTVSMALL; + } + opLvl[i] = 0; + pl[i] = p; + map[i] = equationOperation + ( + equationOperation::slinternalScalar, + eqn->internalScalars()->size(), + 0, + equationOperation::otnone + ); +*/ + } + else + { + // Variable name + opLvl[i] = 0; + pl[i] = p; + map[i] = findSource(tl[i].wordToken()); + if (map[i].sourceIndex() == 0) + { + OStringStream description; + description << "Variable name " << tl[i].wordToken() + << " not found in any available sources."; + fatalParseError + ( + index, + tl, + i, + i, + "equationReader::parse", + description + ); + } + } + } + else if (tl[i].isPunctuation()) + { + switch (tl[i].pToken()) + { + case token::BEGIN_LIST: // ( + opLvl[i] = 4; + p = mag(p) + 1; + pl[i] = p; + map[i] = equationOperation + ( + equationOperation::slnone, + 0, + 0, + equationOperation::otnone + ); + break; + case token::END_LIST: // ) + { + opLvl[i] = -4; + pl[i] = p; + p = mag(p) - 1; + if (p < 0) + { + OStringStream description; + description << "Too many ')'."; + fatalParseError + ( + index, + tl, + i, + i, + "equationReader::parse", + description + ); + + } + + // Look for preceding parenthesis change - was it negative? + for (label j(i - 1); j >= 0; j--) + { + if (mag(pl[j]) == p) + { + if (pl[j] < 0) + { + p = -p; + } + break; + } + } + + map[i] = equationOperation + ( + equationOperation::slnone, + 0, + 0, + equationOperation::otnone + ); + break; + } + case token::COMMA: // , + // , is only accepted in a function level parenthesis + if (p < 0) + { + opLvl[i] = 5; + pl[i] = p; + map[i] = equationOperation + ( + equationOperation::slnone, + 0, + 0, + equationOperation::otnone + ); + } + else + { + OStringStream description; + description << "The comma, ',' does not make sense " + << "here. Only permitted in the root parenthesis " + << "level of a function."; + fatalParseError + ( + index, + tl, + i, + i, + "equationReader::parse", + description + ); + } + break; + case token::ADD: // + + opLvl[i] = 1; + pl[i] = p; + map[i] = equationOperation + ( + equationOperation::slnone, + 0, + 0, + equationOperation::otplus + ); + break; + case token::SUBTRACT: // - + opLvl[i] = 1; + pl[i] = p; + map[i] = equationOperation + ( + equationOperation::slnone, + 0, + 0, + equationOperation::otminus + ); + break; + case token::MULTIPLY: // * + opLvl[i] = 2; + pl[i] = p; + map[i] = equationOperation + ( + equationOperation::slnone, + 0, + 0, + equationOperation::ottimes + ); + break; + case token::DIVIDE: // / + opLvl[i] = 2; + pl[i] = p; + map[i] = equationOperation + ( + equationOperation::slnone, + 0, + 0, + equationOperation::otdivide + ); + break; + case token::COLON: // :, means ^ + opLvl[i] = 3; + pl[i] = p; + map[i] = equationOperation + ( + equationOperation::slnone, + 0, + 0, + equationOperation::otpow + ); + break; + default: + { + OStringStream description; + description << "Punctuation character '" << tl[i].pToken() + << "' is prohibitted."; + fatalParseError + ( + index, + tl, + i, + i, + "equationReader::parse", + description + ); + break; + } + } // end punctuation switch + } // end if punctuation + else + { + OStringStream description; + description << "Unrecognized token: [" << tl[i] << "]."; + fatalParseError + ( + index, + tl, + i, + i, + "equationReader::parse", + description + ); + } + } // mapping loop + + if (p) + { + OStringStream description; + description << "Parentheses do not match. Expecting " << mag(p) + << " additional ')'s."; + fatalParseError + ( + index, + tl, + 0, + tl.size() - 1, + "equationReader::parse", + description + ); + } + + // Assign negatives (distinguish these from subtraction) + // The difference is characterized by the preceding character: + // -preceeded by an operator = negative '+' '-' '*' '/' '^' + // -preceeded by an open bracket = negative '(' + // -preceeded by a comma = negative ',' + // -preceeded by a variable = subtract 'word' or 'number' + // -preceeded by a close bracket = subtract ')' + // Negatives are identified by a negative dictLookupIndex + + if (map[0].operation() == equationOperation::otminus) + { + opLvl[0] = 2; + map[0].dictLookupIndex() = -1; + } + + for (label i(1); i < map.size(); i++) + { + if (map[i].operation() == equationOperation::otminus) + { + if (opLvl[i-1] > 0) + { + opLvl[i] = 2; + map[i].dictLookupIndex() = -1; + } + } + } +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/db/dictionary/equation/equationReader/equationReaderEvaluate.C b/src/OpenFOAM/db/dictionary/equation/equationReader/equationReaderEvaluate.C new file mode 100644 index 000000000..5b8b6a374 --- /dev/null +++ b/src/OpenFOAM/db/dictionary/equation/equationReader/equationReaderEvaluate.C @@ -0,0 +1,2512 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +void Foam::equationReader::evalNone +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + FatalErrorIn("equationReader::update(index)") + << "Empty operation called. Empty operations should only " + << "exist temporarily during parsing, and they should not " + << "remain in the operation list at this point. Either " + << "you have corrupt data, or this is a bug." + << abort(FatalError); +} + + +void Foam::equationReader::evalRetrieve +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + dsEqual(ds, source); +} + + +void Foam::equationReader::evalRetrieveChangeDimensions +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + // Since the last operation of every equation is an otretrieve, this is + // where we set the dimensions to the overrideDimensions + ds.name() = source.name(); + ds.value() = source.value(); + ds.dimensions().reset(eqns_[index].overrideDimensions()); +} + + +void Foam::equationReader::evalStore +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + storeIndex++; + storage_.setSize(storeIndex + storageOffset + 1); + storage_.set + ( + storeIndex + storageOffset, + new dimensionedScalar(ds) + ); + dsEqual(ds, dimensionedScalar("empty", dimless, 0)); +} + + +void Foam::equationReader::evalPlus +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + ds = ds + source; +} + + +void Foam::equationReader::evalPlusDimCheck +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + if + ( + (ds.dimensions() != source.dimensions()) + && dimensionSet::debug + ) + { + WarningIn("equationReader::evalPlusDimCheck") + << "Dimension error thrown for operation [" + << equationOperation::opName + ( + eqns_[index].ops()[i].operation() + ) + << "] in equation " << eqns_[index].equationName() + << ", given by:" << token::NL << token::TAB + << eqns_[index].rawText(); + } + ds = ds + source; + eqns_[index].ops()[i].assignOpFunction + ( + &Foam::equationReader::evalPlus + ); +} + + +void Foam::equationReader::evalPlusChangeDimensions +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + ds.dimensions().reset(dimless); + source.dimensions().reset(dimless); + dsEqual(ds, ds + source); +} + + +void Foam::equationReader::evalMinus +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + ds = ds - source; +} + + +void Foam::equationReader::evalMinusDimCheck +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + if + ( + (ds.dimensions() != source.dimensions()) + && dimensionSet::debug + ) + { + WarningIn("equationReader::evalMinusDimCheck") + << "Dimension error thrown for operation [" + << equationOperation::opName + ( + eqns_[index].ops()[i].operation() + ) + << "] in equation " << eqns_[index].equationName() + << ", given by:" << token::NL << token::TAB + << eqns_[index].rawText(); + } + ds = ds - source; + eqns_[index].ops()[i].assignOpFunction + ( + &Foam::equationReader::evalMinus + ); +} + + +void Foam::equationReader::evalMinusChangeDimensions +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + ds.dimensions().reset(dimless); + source.dimensions().reset(dimless); + dsEqual(ds, ds - source); +} + + +void Foam::equationReader::evalTimes +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + dsEqual(ds, ds * source); +} + + +void Foam::equationReader::evalDivide +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + dsEqual(ds, ds / source); +} + + +void Foam::equationReader::evalPow +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + dsEqual(ds, pow(ds, source)); +} + + +void Foam::equationReader::evalPowDimCheck +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + if + ( + (ds.dimensions() != dimless) + && dimensionSet::debug + ) + { + WarningIn("equationReader::evalPowDimCheck") + << "Dimension error thrown for operation [" + << equationOperation::opName + ( + eqns_[index].ops()[i].operation() + ) + << "] in equation " << eqns_[index].equationName() + << ", given by:" << token::NL << token::TAB + << eqns_[index].rawText(); + } + dsEqual(ds, pow(ds, source)); + eqns_[index].ops()[i].assignOpFunction + ( + &Foam::equationReader::evalPow + ); +} + + +void Foam::equationReader::evalPowChangeDimensions +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + source.dimensions().reset(dimless); + dsEqual(ds, pow(ds, source)); +} + + +void Foam::equationReader::evalSign +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + ds = sign(ds); +} + + +void Foam::equationReader::evalPos +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + ds = pos(ds); +} + + +void Foam::equationReader::evalNeg +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + ds = neg(ds); +} + + +void Foam::equationReader::evalMag +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + ds = mag(ds); +} + + +void Foam::equationReader::evalLimit +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + ds.value() = limit(ds.value(), source.value()); +} + + +void Foam::equationReader::evalMinMod +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + ds.value() = minMod(ds.value(), source.value()); +} + + +void Foam::equationReader::evalSqrtSumSqr +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + ds.value() = sqrtSumSqr(ds.value(), source.value()); +} + + +void Foam::equationReader::evalSqr +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + dsEqual(ds, sqr(ds)); +} + + +void Foam::equationReader::evalPow3 +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + dsEqual(ds, pow3(ds)); +} + + +void Foam::equationReader::evalPow4 +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + dsEqual(ds, pow4(ds)); +} + + +void Foam::equationReader::evalPow5 +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + dsEqual(ds, pow5(ds)); +} + + +void Foam::equationReader::evalInv +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + dsEqual(ds, pTraits::one / ds); +} + + +void Foam::equationReader::evalSqrt +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + dsEqual(ds, sqrt(ds)); +} + + +void Foam::equationReader::evalCbrt +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + dsEqual(ds, cbrt(ds)); +} + + +void Foam::equationReader::evalHypot +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + dsEqual(ds, hypot(ds, source)); +} + + +void Foam::equationReader::evalHypotDimCheck +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + if + ( + (ds.dimensions() != source.dimensions()) + && dimensionSet::debug + ) + { + WarningIn("equationReader::evalHypotDimCheck") + << "Dimension error thrown for operation [" + << equationOperation::opName + ( + eqns_[index].ops()[i].operation() + ) + << "] in equation " << eqns_[index].equationName() + << ", given by:" << token::NL << token::TAB + << eqns_[index].rawText(); + } + dsEqual(ds, hypot(ds, source)); + eqns_[index].ops()[i].assignOpFunction + ( + &Foam::equationReader::evalHypot + ); +} + + +void Foam::equationReader::evalHypotChangeDimensions +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + ds.dimensions().reset(dimless); + source.dimensions().reset(dimless); + dsEqual(ds, hypot(ds, source)); +} + + +void Foam::equationReader::evalExp +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + dsEqual(ds, exp(ds)); +} + + +void Foam::equationReader::evalExpDimCheck +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + if + ( + (ds.dimensions() != dimless) + && dimensionSet::debug + ) + { + WarningIn("equationReader::evalExpDimCheck") + << "Dimension error thrown for operation [" + << equationOperation::opName + ( + eqns_[index].ops()[i].operation() + ) + << "] in equation " << eqns_[index].equationName() + << ", given by:" << token::NL << token::TAB + << eqns_[index].rawText(); + } + dsEqual(ds, exp(ds)); + eqns_[index].ops()[i].assignOpFunction + ( + &Foam::equationReader::evalExp + ); +} + + +void Foam::equationReader::evalExpChangeDimensions +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + ds.dimensions().reset(dimless); + dsEqual(ds, exp(ds)); +} + + +void Foam::equationReader::evalLog +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + dsEqual(ds, log(ds)); +} + + +void Foam::equationReader::evalLogDimCheck +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + if + ( + (ds.dimensions() != dimless) + && dimensionSet::debug + ) + { + WarningIn("equationReader::evalLogDimCheck") + << "Dimension error thrown for operation [" + << equationOperation::opName + ( + eqns_[index].ops()[i].operation() + ) + << "] in equation " << eqns_[index].equationName() + << ", given by:" << token::NL << token::TAB + << eqns_[index].rawText(); + } + dsEqual(ds, log(ds)); + eqns_[index].ops()[i].assignOpFunction + ( + &Foam::equationReader::evalLog + ); +} + + +void Foam::equationReader::evalLogChangeDimensions +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + ds.dimensions().reset(dimless); + dsEqual(ds, log(ds)); +} + + +void Foam::equationReader::evalLog10 +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + dsEqual(ds, log10(ds)); +} + + +void Foam::equationReader::evalLog10DimCheck +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + if + ( + (ds.dimensions() != dimless) + && dimensionSet::debug + ) + { + WarningIn("equationReader::evalLog10DimCheck") + << "Dimension error thrown for operation [" + << equationOperation::opName + ( + eqns_[index].ops()[i].operation() + ) + << "] in equation " << eqns_[index].equationName() + << ", given by:" << token::NL << token::TAB + << eqns_[index].rawText(); + } + dsEqual(ds, log10(ds)); + eqns_[index].ops()[i].assignOpFunction + ( + &Foam::equationReader::evalLog10 + ); +} + + +void Foam::equationReader::evalLog10ChangeDimensions +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + ds.dimensions().reset(dimless); + dsEqual(ds, log10(ds)); +} + + +void Foam::equationReader::evalSin +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + dsEqual(ds, sin(ds)); +} + + +void Foam::equationReader::evalSinDimCheck +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + if + ( + (ds.dimensions() != dimless) + && dimensionSet::debug + ) + { + WarningIn("equationReader::evalSinDimCheck") + << "Dimension error thrown for operation [" + << equationOperation::opName + ( + eqns_[index].ops()[i].operation() + ) + << "] in equation " << eqns_[index].equationName() + << ", given by:" << token::NL << token::TAB + << eqns_[index].rawText(); + } + dsEqual(ds, sin(ds)); + eqns_[index].ops()[i].assignOpFunction + ( + &Foam::equationReader::evalSin + ); +} + + +void Foam::equationReader::evalSinChangeDimensions +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + ds.dimensions().reset(dimless); + dsEqual(ds, sin(ds)); +} + + +void Foam::equationReader::evalCos +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + dsEqual(ds, cos(ds)); +} + + +void Foam::equationReader::evalCosDimCheck +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + if + ( + (ds.dimensions() != dimless) + && dimensionSet::debug + ) + { + WarningIn("equationReader::evalCosDimCheck") + << "Dimension error thrown for operation [" + << equationOperation::opName + ( + eqns_[index].ops()[i].operation() + ) + << "] in equation " << eqns_[index].equationName() + << ", given by:" << token::NL << token::TAB + << eqns_[index].rawText(); + } + dsEqual(ds, cos(ds)); + eqns_[index].ops()[i].assignOpFunction + ( + &Foam::equationReader::evalCos + ); +} + + +void Foam::equationReader::evalCosChangeDimensions +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + ds.dimensions().reset(dimless); + dsEqual(ds, cos(ds)); +} + + +void Foam::equationReader::evalTan +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + dsEqual(ds, tan(ds)); +} + + +void Foam::equationReader::evalTanDimCheck +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + if + ( + (ds.dimensions() != dimless) + && dimensionSet::debug + ) + { + WarningIn("equationReader::evalTanDimCheck") + << "Dimension error thrown for operation [" + << equationOperation::opName + ( + eqns_[index].ops()[i].operation() + ) + << "] in equation " << eqns_[index].equationName() + << ", given by:" << token::NL << token::TAB + << eqns_[index].rawText(); + } + dsEqual(ds, tan(ds)); + eqns_[index].ops()[i].assignOpFunction + ( + &Foam::equationReader::evalTan + ); +} + + +void Foam::equationReader::evalTanChangeDimensions +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + ds.dimensions().reset(dimless); + dsEqual(ds, tan(ds)); +} + + +void Foam::equationReader::evalAsin +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + dsEqual(ds, asin(ds)); +} + + +void Foam::equationReader::evalAsinDimCheck +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + if + ( + (ds.dimensions() != dimless) + && dimensionSet::debug + ) + { + WarningIn("equationReader::evalAsinDimCheck") + << "Dimension error thrown for operation [" + << equationOperation::opName + ( + eqns_[index].ops()[i].operation() + ) + << "] in equation " << eqns_[index].equationName() + << ", given by:" << token::NL << token::TAB + << eqns_[index].rawText(); + } + dsEqual(ds, asin(ds)); + eqns_[index].ops()[i].assignOpFunction + ( + &Foam::equationReader::evalAsin + ); +} + + +void Foam::equationReader::evalAsinChangeDimensions +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + ds.dimensions().reset(dimless); + dsEqual(ds, asin(ds)); +} + + +void Foam::equationReader::evalAcos +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + dsEqual(ds, acos(ds)); +} + + +void Foam::equationReader::evalAcosDimCheck +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + if + ( + (ds.dimensions() != dimless) + && dimensionSet::debug + ) + { + WarningIn("equationReader::evalAcosDimCheck") + << "Dimension error thrown for operation [" + << equationOperation::opName + ( + eqns_[index].ops()[i].operation() + ) + << "] in equation " << eqns_[index].equationName() + << ", given by:" << token::NL << token::TAB + << eqns_[index].rawText(); + } + dsEqual(ds, acos(ds)); + eqns_[index].ops()[i].assignOpFunction + ( + &Foam::equationReader::evalAcos + ); +} + + +void Foam::equationReader::evalAcosChangeDimensions +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + ds.dimensions().reset(dimless); + dsEqual(ds, acos(ds)); +} + + +void Foam::equationReader::evalAtan +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + dsEqual(ds, atan(ds)); +} + + +void Foam::equationReader::evalAtanDimCheck +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + if + ( + (ds.dimensions() != dimless) + && dimensionSet::debug + ) + { + WarningIn("equationReader::evalAtanDimCheck") + << "Dimension error thrown for operation [" + << equationOperation::opName + ( + eqns_[index].ops()[i].operation() + ) + << "] in equation " << eqns_[index].equationName() + << ", given by:" << token::NL << token::TAB + << eqns_[index].rawText(); + } + dsEqual(ds, atan(ds)); + eqns_[index].ops()[i].assignOpFunction + ( + &Foam::equationReader::evalAtan + ); +} + + +void Foam::equationReader::evalAtanChangeDimensions +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + ds.dimensions().reset(dimless); + dsEqual(ds, atan(ds)); +} + + +void Foam::equationReader::evalSinh +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + dsEqual(ds, sinh(ds)); +} + + +void Foam::equationReader::evalSinhDimCheck +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + if + ( + (ds.dimensions() != dimless) + && dimensionSet::debug + ) + { + WarningIn("equationReader::evalSinhDimCheck") + << "Dimension error thrown for operation [" + << equationOperation::opName + ( + eqns_[index].ops()[i].operation() + ) + << "] in equation " << eqns_[index].equationName() + << ", given by:" << token::NL << token::TAB + << eqns_[index].rawText(); + } + dsEqual(ds, sinh(ds)); + eqns_[index].ops()[i].assignOpFunction + ( + &Foam::equationReader::evalSinh + ); +} + + +void Foam::equationReader::evalSinhChangeDimensions +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + ds.dimensions().reset(dimless); + dsEqual(ds, sinh(ds)); +} + + +void Foam::equationReader::evalCosh +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + dsEqual(ds, cosh(ds)); +} + + +void Foam::equationReader::evalCoshDimCheck +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + if + ( + (ds.dimensions() != dimless) + && dimensionSet::debug + ) + { + WarningIn("equationReader::evalCoshDimCheck") + << "Dimension error thrown for operation [" + << equationOperation::opName + ( + eqns_[index].ops()[i].operation() + ) + << "] in equation " << eqns_[index].equationName() + << ", given by:" << token::NL << token::TAB + << eqns_[index].rawText(); + } + dsEqual(ds, cosh(ds)); + eqns_[index].ops()[i].assignOpFunction + ( + &Foam::equationReader::evalCosh + ); +} + + +void Foam::equationReader::evalCoshChangeDimensions +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + ds.dimensions().reset(dimless); + dsEqual(ds, cosh(ds)); +} + + +void Foam::equationReader::evalTanh +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + dsEqual(ds, tanh(ds)); +} + + +void Foam::equationReader::evalTanhDimCheck +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + if + ( + (ds.dimensions() != dimless) + && dimensionSet::debug + ) + { + WarningIn("equationReader::evalTanhDimCheck") + << "Dimension error thrown for operation [" + << equationOperation::opName + ( + eqns_[index].ops()[i].operation() + ) + << "] in equation " << eqns_[index].equationName() + << ", given by:" << token::NL << token::TAB + << eqns_[index].rawText(); + } + dsEqual(ds, tanh(ds)); + eqns_[index].ops()[i].assignOpFunction + ( + &Foam::equationReader::evalTanh + ); +} + + +void Foam::equationReader::evalTanhChangeDimensions +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + ds.dimensions().reset(dimless); + dsEqual(ds, tanh(ds)); +} + + +void Foam::equationReader::evalAsinh +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + dsEqual(ds, asinh(ds)); +} + + +void Foam::equationReader::evalAsinhDimCheck +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + if + ( + (ds.dimensions() != dimless) + && dimensionSet::debug + ) + { + WarningIn("equationReader::evalAsinhDimCheck") + << "Dimension error thrown for operation [" + << equationOperation::opName + ( + eqns_[index].ops()[i].operation() + ) + << "] in equation " << eqns_[index].equationName() + << ", given by:" << token::NL << token::TAB + << eqns_[index].rawText(); + } + dsEqual(ds, asinh(ds)); + eqns_[index].ops()[i].assignOpFunction + ( + &Foam::equationReader::evalAsinh + ); +} + + +void Foam::equationReader::evalAsinhChangeDimensions +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + ds.dimensions().reset(dimless); + dsEqual(ds, asinh(ds)); +} + + +void Foam::equationReader::evalAcosh +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + dsEqual(ds, acosh(ds)); +} + + +void Foam::equationReader::evalAcoshDimCheck +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + if + ( + (ds.dimensions() != dimless) + && dimensionSet::debug + ) + { + WarningIn("equationReader::evalAcoshDimCheck") + << "Dimension error thrown for operation [" + << equationOperation::opName + ( + eqns_[index].ops()[i].operation() + ) + << "] in equation " << eqns_[index].equationName() + << ", given by:" << token::NL << token::TAB + << eqns_[index].rawText(); + } + dsEqual(ds, acosh(ds)); + eqns_[index].ops()[i].assignOpFunction + ( + &Foam::equationReader::evalAcosh + ); +} + + +void Foam::equationReader::evalAcoshChangeDimensions +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + ds.dimensions().reset(dimless); + dsEqual(ds, acosh(ds)); +} + + +void Foam::equationReader::evalAtanh +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + dsEqual(ds, atanh(ds)); +} + + +void Foam::equationReader::evalAtanhDimCheck +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + if + ( + (ds.dimensions() != dimless) + && dimensionSet::debug + ) + { + WarningIn("equationReader::evalAtanhDimCheck") + << "Dimension error thrown for operation [" + << equationOperation::opName + ( + eqns_[index].ops()[i].operation() + ) + << "] in equation " << eqns_[index].equationName() + << ", given by:" << token::NL << token::TAB + << eqns_[index].rawText(); + } + dsEqual(ds, atanh(ds)); + eqns_[index].ops()[i].assignOpFunction + ( + &Foam::equationReader::evalAtanh + ); +} + + +void Foam::equationReader::evalAtanhChangeDimensions +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + ds.dimensions().reset(dimless); + dsEqual(ds, atanh(ds)); +} + + +void Foam::equationReader::evalErf +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + dsEqual(ds, erf(ds)); +} + + +void Foam::equationReader::evalErfDimCheck +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + if + ( + (ds.dimensions() != dimless) + && dimensionSet::debug + ) + { + WarningIn("equationReader::evalErfDimCheck") + << "Dimension error thrown for operation [" + << equationOperation::opName + ( + eqns_[index].ops()[i].operation() + ) + << "] in equation " << eqns_[index].equationName() + << ", given by:" << token::NL << token::TAB + << eqns_[index].rawText(); + } + dsEqual(ds, erf(ds)); + eqns_[index].ops()[i].assignOpFunction + ( + &Foam::equationReader::evalErf + ); +} + + +void Foam::equationReader::evalErfChangeDimensions +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + ds.dimensions().reset(dimless); + dsEqual(ds, erf(ds)); +} + + +void Foam::equationReader::evalErfc +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + dsEqual(ds, erfc(ds)); +} + + +void Foam::equationReader::evalErfcDimCheck +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + if + ( + (ds.dimensions() != dimless) + && dimensionSet::debug + ) + { + WarningIn("equationReader::evalErfcDimCheck") + << "Dimension error thrown for operation [" + << equationOperation::opName + ( + eqns_[index].ops()[i].operation() + ) + << "] in equation " << eqns_[index].equationName() + << ", given by:" << token::NL << token::TAB + << eqns_[index].rawText(); + } + dsEqual(ds, erfc(ds)); + eqns_[index].ops()[i].assignOpFunction + ( + &Foam::equationReader::evalErfc + ); +} + + +void Foam::equationReader::evalErfcChangeDimensions +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + ds.dimensions().reset(dimless); + dsEqual(ds, erfc(ds)); +} + + +void Foam::equationReader::evalLgamma +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + dsEqual(ds, lgamma(ds)); +} + + +void Foam::equationReader::evalLgammaDimCheck +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + if + ( + (ds.dimensions() != dimless) + && dimensionSet::debug + ) + { + WarningIn("equationReader::evalLgammaDimCheck") + << "Dimension error thrown for operation [" + << equationOperation::opName + ( + eqns_[index].ops()[i].operation() + ) + << "] in equation " << eqns_[index].equationName() + << ", given by:" << token::NL << token::TAB + << eqns_[index].rawText(); + } + dsEqual(ds, lgamma(ds)); + eqns_[index].ops()[i].assignOpFunction + ( + &Foam::equationReader::evalLgamma + ); +} + + +void Foam::equationReader::evalLgammaChangeDimensions +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + ds.dimensions().reset(dimless); + dsEqual(ds, lgamma(ds)); +} + + +void Foam::equationReader::evalJ0 +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + dsEqual(ds, j0(ds)); +} + + +void Foam::equationReader::evalJ0DimCheck +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + if + ( + (ds.dimensions() != dimless) + && dimensionSet::debug + ) + { + WarningIn("equationReader::evalJ0DimCheck") + << "Dimension error thrown for operation [" + << equationOperation::opName + ( + eqns_[index].ops()[i].operation() + ) + << "] in equation " << eqns_[index].equationName() + << ", given by:" << token::NL << token::TAB + << eqns_[index].rawText(); + } + dsEqual(ds, j0(ds)); + eqns_[index].ops()[i].assignOpFunction + ( + &Foam::equationReader::evalJ0 + ); +} + + +void Foam::equationReader::evalJ0ChangeDimensions +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + ds.dimensions().reset(dimless); + dsEqual(ds, j0(ds)); +} + + +void Foam::equationReader::evalJ1 +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + dsEqual(ds, j1(ds)); +} + + +void Foam::equationReader::evalJ1DimCheck +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + if + ( + (ds.dimensions() != dimless) + && dimensionSet::debug + ) + { + WarningIn("equationReader::evalJ1DimCheck") + << "Dimension error thrown for operation [" + << equationOperation::opName + ( + eqns_[index].ops()[i].operation() + ) + << "] in equation " << eqns_[index].equationName() + << ", given by:" << token::NL << token::TAB + << eqns_[index].rawText(); + } + dsEqual(ds, j1(ds)); + eqns_[index].ops()[i].assignOpFunction + ( + &Foam::equationReader::evalJ1 + ); +} + + +void Foam::equationReader::evalJ1ChangeDimensions +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + ds.dimensions().reset(dimless); + dsEqual(ds, j1(ds)); +} + + +void Foam::equationReader::evalJn +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + int di(ds.value()); + dsEqual(ds, jn(di, source)); +} + + +void Foam::equationReader::evalJnDimCheck +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + if + ( + (source.dimensions() != dimless) + && dimensionSet::debug + ) + { + WarningIn("equationReader::evalJnDimCheck") + << "Dimension error thrown for operation [" + << equationOperation::opName + ( + eqns_[index].ops()[i].operation() + ) + << "] in equation " << eqns_[index].equationName() + << ", given by:" << token::NL << token::TAB + << eqns_[index].rawText(); + } + int di(ds.value()); + dsEqual(ds, jn(di, source)); + eqns_[index].ops()[i].assignOpFunction + ( + &Foam::equationReader::evalJn + ); +} + + +void Foam::equationReader::evalJnChangeDimensions +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + int di(ds.value()); + source.dimensions().reset(dimless); + dsEqual(ds, jn(di, source)); +} + + +void Foam::equationReader::evalY0 +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + dsEqual(ds, y0(ds)); +} + + +void Foam::equationReader::evalY0DimCheck +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + if + ( + (ds.dimensions() != dimless) + && dimensionSet::debug + ) + { + WarningIn("equationReader::evalY0DimCheck") + << "Dimension error thrown for operation [" + << equationOperation::opName + ( + eqns_[index].ops()[i].operation() + ) + << "] in equation " << eqns_[index].equationName() + << ", given by:" << token::NL << token::TAB + << eqns_[index].rawText(); + } + dsEqual(ds, y0(ds)); + eqns_[index].ops()[i].assignOpFunction + ( + &Foam::equationReader::evalY0 + ); +} + + +void Foam::equationReader::evalY0ChangeDimensions +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + ds.dimensions().reset(dimless); + dsEqual(ds, y0(ds)); +} + + +void Foam::equationReader::evalY1 +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + dsEqual(ds, y1(ds)); +} + + +void Foam::equationReader::evalY1DimCheck +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + if + ( + (ds.dimensions() != dimless) + && dimensionSet::debug + ) + { + WarningIn("equationReader::evalY1DimCheck") + << "Dimension error thrown for operation [" + << equationOperation::opName + ( + eqns_[index].ops()[i].operation() + ) + << "] in equation " << eqns_[index].equationName() + << ", given by:" << token::NL << token::TAB + << eqns_[index].rawText(); + } + dsEqual(ds, y1(ds)); + eqns_[index].ops()[i].assignOpFunction + ( + &Foam::equationReader::evalY1 + ); +} + + +void Foam::equationReader::evalY1ChangeDimensions +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + ds.dimensions().reset(dimless); + dsEqual(ds, y1(ds)); +} + + +void Foam::equationReader::evalYn +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + int di(ds.value()); + dsEqual(ds, yn(di, source)); +} + + +void Foam::equationReader::evalYnDimCheck +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + if + ( + (source.dimensions() != dimless) + && dimensionSet::debug + ) + { + WarningIn("equationReader::evalYnDimCheck") + << "Dimension error thrown for operation [" + << equationOperation::opName + ( + eqns_[index].ops()[i].operation() + ) + << "] in equation " << eqns_[index].equationName() + << ", given by:" << token::NL << token::TAB + << eqns_[index].rawText(); + } + int di(ds.value()); + dsEqual(ds, yn(di, source)); + eqns_[index].ops()[i].assignOpFunction + ( + &Foam::equationReader::evalYn + ); +} + + +void Foam::equationReader::evalYnChangeDimensions +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + source.dimensions().reset(dimless); + int di(ds.value()); + dsEqual(ds, yn(di, source)); +} + + +void Foam::equationReader::evalMax +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + dsEqual(ds, max(ds, source)); +} + + +void Foam::equationReader::evalMaxDimCheck +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + if + ( + dimensionSet::debug + && (ds.dimensions() != source.dimensions()) + ) + { + WarningIn("equationReader::evalMaxDimCheck") + << "Dimension error thrown for operation [" + << equationOperation::opName + ( + eqns_[index].ops()[i].operation() + ) + << "] in equation " << eqns_[index].equationName() + << ", given by:" << token::NL << token::TAB + << eqns_[index].rawText(); + } + dsEqual(ds, max(ds, source)); + eqns_[index].ops()[i].assignOpFunction + ( + &Foam::equationReader::evalMax + ); +} + + +void Foam::equationReader::evalMaxChangeDimensions +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + ds.dimensions().reset(dimless); + source.dimensions().reset(dimless); + dsEqual(ds, max(ds, source)); +} + + +void Foam::equationReader::evalMin +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + dsEqual(ds, min(ds, source)); +} + + +void Foam::equationReader::evalMinDimCheck +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + if + ( + dimensionSet::debug + && (ds.dimensions() != source.dimensions()) + ) + { + WarningIn("equationReader::evalMinDimCheck") + << "Dimension error thrown for operation [" + << equationOperation::opName + ( + eqns_[index].ops()[i].operation() + ) + << "] in equation " << eqns_[index].equationName() + << ", given by:" << token::NL << token::TAB + << eqns_[index].rawText(); + } + dsEqual(ds, min(ds, source)); + eqns_[index].ops()[i].assignOpFunction + ( + &Foam::equationReader::evalMin + ); +} + + +void Foam::equationReader::evalMinChangeDimensions +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + source.dimensions().reset(dimless); + ds.dimensions().reset(dimless); + dsEqual(ds, min(ds, source)); +} + + +void Foam::equationReader::evalStabilise +( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source +) +{ + ds.value() = stabilise(ds.value(), source.value()); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::equationReader::evaluateField +( + const label& index, + scalarList& outputSList, + dimensionSet& dimensions +) +{ + setListIndex(0); + dimensionedScalar eval = evaluate(index); + outputSList[0] = eval.value(); + for(label i(1); i < outputSList.size(); i++) + { + setListIndex(i); + outputSList[i] = evaluate(index).value(); + } + if + ( + !eqns_[index].changeDimensions() + && dimensionSet::debug + && dimensions != eval.dimensions() + ) + { + WarningIn("equationReader::update") + << "Dimension error thrown for equation " + << eqns_[index].equationName() << ", given by:" + << token::NL << token::TAB + << eqns_[index].rawText(); + + dimensions = eval.dimensions(); + } +} + + +Foam::dimensionedScalar Foam::equationReader::evaluate +( + const word& equationName +) +{ + label index(lookup(equationName)); + if (index < 0) + { + FatalErrorIn("equationReader::evaluate(const word)") + << "Equation name " << equationName << " not found." + << abort(FatalError); + } + return evaluate(index); +} + + +Foam::dimensionedScalar Foam::equationReader::evaluate +( + const label& index, + label storageOffset +) +{ + if (debug) + { + Info << "Evaluating equation " << eqns_[index].equationName() + << " at index " << index << ", given by:" << token::NL + << token::TAB << eqns_[index].rawText() << endl; + } +# ifdef FULLDEBUG + if ((index < 0) || (index >= eqns_.size())) + { + FatalErrorIn("equationReader::update(const index)") + << "Index " << index << " out of bounds (0, " << eqns_.size() - 1 + << ")" + << abort(FatalError); + } +# endif + + if (eqns_[index].size() == 0) + { + parse(index); + } + + label storeIndex(-1); + dimensionedScalar ds("empty", dimless, 0); + + for (label i(0); i < eqns_[index].size(); i++) + { + +# ifdef FULLDEBUG + if + ( + (ds.name() == "empty") + && ( + eqns_[index].ops()[i].operation() + != equationOperation::otretrieve + ) + ) + { + FatalErrorIn("equationReader::update(index)") + << "Bad operation list. Operation at " << i << " either " + << "follows a 'store', or is the first operation. Therefore " + << "it should be retrieve, but it is " + << eqns_[index].ops()[i].operation() << "." + << abort(FatalError); + } +# endif + + dimensionedScalar source("noSource", dimless, 0); + + // Execute getSource function + dsEqual + ( + source, + eqns_[index].ops()[i].getSourceFunction + ( + this, + index, + i, + storeIndex + storageOffset, + storageOffset + ) + ); + + // Launch the reportOperationFunction - if debug is greater than one, + // reportOperationEnabled is called, which posts operation-by-operation + // information to the console. Otherwise, reportOperationDiabled is + // called, which does nothing. + (*this.*reportOperationFunction_)(index, i, ds); + + // Execute the eval function to which this operation points + eqns_[index].ops()[i].opFunction + ( + this, + index, + i, + storageOffset, + storeIndex, + ds, + source + ); + + // If debug level > 1 this will print the result to the console; + // otherwise, does nothing. + (*this.*reportResultFunction_)(ds); + } + + + ds.name() = eqns_[index].equationName(); + + //Move one level back up on the dependents_ list + if (dependents_.size()) + { + dependents_.setSize(dependents_.size() - 1); + } + + storage_.setSize(storageOffset); + if (debug) + { + Info << "Equation evaluated. Result is: " << ds << endl; + } + dsEqual(eqns_[index].lastResult(), ds); + return ds; +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/db/dictionary/equation/equationReader/equationReaderGetSource.C b/src/OpenFOAM/db/dictionary/equation/equationReader/equationReaderGetSource.C new file mode 100644 index 000000000..7e5b31bc9 --- /dev/null +++ b/src/OpenFOAM/db/dictionary/equation/equationReader/equationReaderGetSource.C @@ -0,0 +1,312 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +Foam::dimensionedScalar Foam::equationReader::getSourceNone +( + equationReader * eqnReader, + const label equationIndex, + const label equationOperationIndex, + const label maxStoreIndex, + const label storageOffset +) +{ + return dimensionedScalar("noSource", dimless, 0); +} + + +Foam::dimensionedScalar Foam::equationReader::getSourceDictSourceDScalar +( + equationReader * eqnReader, + const label equationIndex, + const label equationOperationIndex, + const label maxStoreIndex, + const label storageOffset +) +{ + dimensionedScalar returnMe("noSource", dimless, 0); + const equation& eqn(eqns_[equationIndex]); + const equationOperation& eqOp(eqn[equationOperationIndex]); + label zeroSourceIndex = mag(eqOp.sourceIndex()) - 1; + + word varName(dictLookups_[eqOp.dictLookupIndex()]); + + ITstream srcStrm + ( + dictSources_[zeroSourceIndex].lookup(varName) + ); + srcStrm >> returnMe; + returnMe.value() = sign(eqOp.sourceIndex()) * returnMe.value(); + return returnMe; +} + + +Foam::dimensionedScalar Foam::equationReader::getSourceDictSourceScalar +( + equationReader * eqnReader, + const label equationIndex, + const label equationOperationIndex, + const label maxStoreIndex, + const label storageOffset +) +{ + dimensionedScalar returnMe("noSource", dimless, 0); + const equation& eqn(eqns_[equationIndex]); + const equationOperation& eqOp(eqn[equationOperationIndex]); + label zeroSourceIndex = mag(eqOp.sourceIndex()) - 1; + + word varName(dictLookups_[eqOp.dictLookupIndex()]); + + returnMe.name() = varName; + returnMe.value() = readScalar + ( + dictSources_[zeroSourceIndex].lookup(varName) + ); + returnMe.value() = sign(eqOp.sourceIndex()) * returnMe.value(); + return returnMe; +} + + +Foam::dimensionedScalar Foam::equationReader::getSourceExternalDScalar +( + equationReader * eqnReader, + const label equationIndex, + const label equationOperationIndex, + const label maxStoreIndex, + const label storageOffset +) +{ + dimensionedScalar returnMe("noSource", dimless, 0); + const equation& eqn(eqns_[equationIndex]); + const equationOperation& eqOp(eqn[equationOperationIndex]); + label zeroSourceIndex = mag(eqOp.sourceIndex()) - 1; + + dsEqual(returnMe, externalDScalars_[zeroSourceIndex]); + returnMe.value() = sign(eqOp.sourceIndex()) * returnMe.value(); + return returnMe; +} + + +Foam::dimensionedScalar Foam::equationReader::getSourceExternalScalar +( + equationReader * eqnReader, + const label equationIndex, + const label equationOperationIndex, + const label maxStoreIndex, + const label storageOffset +) +{ + dimensionedScalar returnMe("noSource", dimless, 0); + const equation& eqn(eqns_[equationIndex]); + const equationOperation& eqOp(eqn[equationOperationIndex]); + label zeroSourceIndex = mag(eqOp.sourceIndex()) - 1; + + returnMe.name() = externalScalarNames_[zeroSourceIndex]; + returnMe.value() = externalScalars_[zeroSourceIndex]; + returnMe.dimensions().reset + ( + externalScalarDimensions_[zeroSourceIndex] + ); + returnMe.value() = sign(eqOp.sourceIndex()) * returnMe.value(); + return returnMe; +} + + +Foam::dimensionedScalar Foam::equationReader::getSourceExternalScalarList +( + equationReader * eqnReader, + const label equationIndex, + const label equationOperationIndex, + const label maxStoreIndex, + const label storageOffset +) +{ + dimensionedScalar returnMe("noSource", dimless, 0); + const equation& eqn(eqns_[equationIndex]); + const equationOperation& eqOp(eqn[equationOperationIndex]); + label zeroSourceIndex = mag(eqOp.sourceIndex()) - 1; + + dsEqual + ( + returnMe, + dimensionedScalar + ( + externalScalarListNames_[zeroSourceIndex], + externalScalarListDimensions_[zeroSourceIndex], + externalScalarLists_ + [zeroSourceIndex] + [externalScalarListIndex_[zeroSourceIndex]] + ) + ); + returnMe.value() = sign(eqOp.sourceIndex()) * returnMe.value(); + return returnMe; +} + + +Foam::dimensionedScalar Foam::equationReader::getSourceInternalScalar +( + equationReader * eqnReader, + const label equationIndex, + const label equationOperationIndex, + const label maxStoreIndex, + const label storageOffset +) +{ + dimensionedScalar returnMe("noSource", dimless, 0); + const equation& eqn(eqns_[equationIndex]); + const equationOperation& eqOp(eqn[equationOperationIndex]); + label zeroSourceIndex = mag(eqOp.sourceIndex()) - 1; + + returnMe.name() = "internalConstant"; + returnMe.value() = internalScalars_[zeroSourceIndex]; + returnMe.value() = sign(eqOp.sourceIndex()) * returnMe.value(); + return returnMe; +} + + +Foam::dimensionedScalar Foam::equationReader::getSourceEquation +( + equationReader * eqnReader, + const label equationIndex, + const label equationOperationIndex, + const label maxStoreIndex, + const label storageOffset +) +{ + dimensionedScalar returnMe("noSource", dimless, 0); + const equation& eqn(eqns_[equationIndex]); + const equationOperation& eqOp(eqn[equationOperationIndex]); + label zeroSourceIndex = mag(eqOp.sourceIndex()) - 1; + + dependents_.setSize(dependents_.size() + 1); + dependents_[dependents_.size() - 1] = equationIndex; + if (debug) + { + Info << "Embedded equation dispatch." << endl; + } + dsEqual(returnMe, evaluate(zeroSourceIndex, maxStoreIndex + 1)); + if (debug) + { + Info << "Returned from embedded equation." << endl; + } + returnMe.value() = sign(eqOp.sourceIndex()) * returnMe.value(); + return returnMe; +} + + +Foam::dimensionedScalar Foam::equationReader::getSourceEquationCircRefDetect +( + equationReader * eqnReader, + const label equationIndex, + const label equationOperationIndex, + const label maxStoreIndex, + const label storageOffset +) +{ + dimensionedScalar returnMe("noSource", dimless, 0); + equation& eqn(eqns_[equationIndex]); + equationOperation& eqOp(eqn[equationOperationIndex]); + label zeroSourceIndex = mag(eqOp.sourceIndex()) - 1; + + // Check for circular references + dependents_.setSize(dependents_.size() + 1); + dependents_[dependents_.size() - 1] = equationIndex; + forAll(dependents_, i) + { + if (dependents_[i] == zeroSourceIndex) + { + // Circular reference detected + + string dependencies; + for (label j(i); j < dependents_.size(); j++) + { + dependencies.append + ( + eqns_[j].equationName() + ); + dependencies.append("-->"); + } + dependencies.append(eqns_[i].equationName()); + FatalErrorIn("equationReader::getSource") + << "Circular reference detected when evaluating " + << "the equation for " << eqn.equationName() + << ", given by:" << token::NL << token::TAB + << eqn.rawText() << token::NL << "The circular " + << "dependency is:" << token::NL << token::TAB + << dependencies + << abort(FatalError); + } + } + if (debug) + { + Info << "Embedded equation dispatch." << endl; + } + dsEqual(returnMe, evaluate(zeroSourceIndex, maxStoreIndex + 1)); + eqOp.assignSourceFunction + ( + &Foam::equationReader::getSourceEquation + ); + if (debug) + { + Info << "Returned from embedded equation." << endl; + } + returnMe.value() = sign(eqOp.sourceIndex()) * returnMe.value(); + return returnMe; +} + + +Foam::dimensionedScalar Foam::equationReader::getSourceStorage +( + equationReader * eqnReader, + const label equationIndex, + const label equationOperationIndex, + const label maxStoreIndex, + const label storageOffset +) +{ + dimensionedScalar returnMe("noSource", dimless, 0); + const equation& eqn(eqns_[equationIndex]); + const equationOperation& eqOp(eqn[equationOperationIndex]); + label zeroSourceIndex = mag(eqOp.sourceIndex()) - 1; + +# ifdef FULLDEBUG + if ((zeroSourceIndex + storageOffset) > maxStoreIndex) + { + FatalErrorIn("equationReader::getSouce") + << "Index " << zeroSourceIndex << " out of bounds (0, " + << maxStoreIndex - storageOffset << ")" + << abort(FatalError); + } +# endif + dsEqual(returnMe, storage_[zeroSourceIndex + storageOffset]); + returnMe.value() = sign(eqOp.sourceIndex()) * returnMe.value(); + return returnMe; +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/db/dictionary/equation/equationReader/equationReaderI.H b/src/OpenFOAM/db/dictionary/equation/equationReader/equationReaderI.H new file mode 100644 index 000000000..ecfb2d8f0 --- /dev/null +++ b/src/OpenFOAM/db/dictionary/equation/equationReader/equationReaderI.H @@ -0,0 +1,226 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +inline const equationList& equationReader::eqns() const +{ + return eqns_; +} + +inline const UPtrList& equationReader::dictSources() const +{ + return dictSources_; +} + + +inline UPtrList& equationReader::dictSources() +{ + return dictSources_; +} + + +inline const PtrList& equationReader::dictLookups() const +{ + return dictLookups_; +} + + +inline const + UPtrList& equationReader::externalScalarLists() const +{ + return externalScalarLists_; +} + + +inline UPtrList& equationReader::externalScalarLists() +{ + return externalScalarLists_; +} + + +inline const + PtrList& equationReader::externalScalarListDimensions() const +{ + return externalScalarListDimensions_; +} + + +inline PtrList& equationReader::externalScalarListDimensions() +{ + return externalScalarListDimensions_; +} + + +inline const wordList& equationReader::externalScalarListNames() const +{ + return externalScalarListNames_; +} + + +inline wordList& equationReader::externalScalarListNames() +{ + return externalScalarListNames_; +} + + +inline const labelList& equationReader::externalScalarListIndex() const +{ + return externalScalarListIndex_; +} + + +inline labelList& equationReader::externalScalarListIndex() +{ + return externalScalarListIndex_; +} + + +inline const + UPtrList& equationReader::externalDScalars() const +{ + return externalDScalars_; +} + + +inline UPtrList& equationReader::externalDScalars() +{ + return externalDScalars_; +} + + +inline const UPtrList& equationReader::externalScalars() const +{ + return externalScalars_; +} + + +inline UPtrList& equationReader::externalScalars() +{ + return externalScalars_; +} + + +inline const wordList& equationReader::externalScalarNames() const +{ + return externalScalarNames_; +} + + +inline wordList& equationReader::externalScalarNames() +{ + return externalScalarNames_; +} + + + +inline const + PtrList& equationReader::externalScalarDimensions() const +{ + return externalScalarDimensions_; +} + + +inline PtrList& equationReader::externalScalarDimensions() +{ + return externalScalarDimensions_; +} + + +inline const + UPtrList& equationReader::outputScalars() const +{ + return outputScalars_; +} + + +inline UPtrList& equationReader::outputScalars() +{ + return outputScalars_; +} + + +inline const + wordList& equationReader::outputScalarNames() const +{ + return outputScalarNames_; +} + + +inline + wordList& equationReader::outputScalarNames() +{ + return outputScalarNames_; +} + + +inline const + PtrList& equationReader::outputScalarDimensions() const +{ + return outputScalarDimensions_; +} + + +inline + PtrList& equationReader::outputScalarDimensions() +{ + return outputScalarDimensions_; +} + + +inline const + UPtrList< scalarList>& equationReader::outputScalarLists() const +{ + return outputScalarLists_; +} + +//- Access to pointers to output scalarLists +inline UPtrList& equationReader::outputScalarLists() +{ + return outputScalarLists_; +} + +//- Const access to dimensions associated with outputScalarLists +inline const + PtrList& equationReader::outputScalarListDimensions() const +{ + return outputScalarListDimensions_; +} + +//- Access to dimensions associated with outputScalarLists +inline PtrList& equationReader::outputScalarListDimensions() +{ + return outputScalarListDimensions_; +} + + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/db/dictionary/equation/equationReader/equationReaderIO.C b/src/OpenFOAM/db/dictionary/equation/equationReader/equationReaderIO.C new file mode 100644 index 000000000..8e9d74cb1 --- /dev/null +++ b/src/OpenFOAM/db/dictionary/equation/equationReader/equationReaderIO.C @@ -0,0 +1,122 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "equationReader.H" +#include "fileNameList.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +Foam::Ostream& Foam::equationReader::dataSourceStatus(Ostream& os) const +{ + dictionary dict; + fileNameList dictPaths(dictSources_.size()); + forAll(dictSources_, i) + { + dictPaths[i] = dictSources_[i].name(); + } + dict.set("dictSources", dictPaths); + dict.set("dictLookups", dictLookups_); + dict.set("externalDScalars", externalDScalars_); + dict.set("externalScalars", externalScalars_); + dict.set("externalScalarNames", externalScalarNames_); + dict.set("externalScalarListName", externalScalarListNames_); + dict.set("externalScalarListDimensions", externalScalarListDimensions_); + dict.set("externalScalarListIndices", externalScalarListIndex_); + PtrList outputScalarList; + forAll(eqns_, i) + { + if (outputScalars_.set(i)) + { + outputScalarList.setSize(outputScalarList.size() + 1); + outputScalarList.set + ( + outputScalarList.size() - 1, + new dimensionedScalar + ( + outputScalarNames_[i], + outputScalarDimensions_[i], + outputScalars_[i] + ) + ); + } + } + dict.set("outputScalars", outputScalarList); + dict.set("internalScalars", internalScalars_); + dictionary superDict; + superDict.set("dataSources", dict); + os << superDict; + return os; +} + + +// * * * * * * * * * * * * * Friend IOstream Operators * * * * * * * * * * * // + +Foam::Istream& Foam::operator>>(Istream& is, equationReader& I) +{ + dictionary dict(is); + dictionary eqnsDict(dict.subDict("equations")); + wordList eqnNames(eqnsDict.toc()); + forAll(eqnNames, i) + { + equation eq + ( + eqnsDict.subDict(eqnNames[i]).lookup(eqnNames[i]), + eqnNames[i] + ); + I.createEquation(eq); + } + return is; +} + + +Foam::Ostream& Foam::operator<<(Ostream& os, const equationReader& I) +{ + dictionary eqnsDict; + forAll(I.eqns_, i) + { + dictionary eqnEntry; + eqnEntry.set(I.eqns_[i].equationName(), I.eqns_[i]); + eqnEntry.set("lastResult", I.eqns_[i].lastResult()); + if (I.outputScalars_.set(i)) + { + dimensionedScalar ds + ( + I.outputScalarNames_[i], + I.outputScalarDimensions_[i], + I.outputScalars_[i] + ); + eqnEntry.set("outputVar", ds); + } + eqnsDict.set(I.eqns_[i].equationName(), eqnEntry); + } + dictionary dict; + dict.set("equations", eqnsDict); + os << dict; + return os; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + diff --git a/src/OpenFOAM/db/dictionary/equation/equationReader/equationReaderParse.C b/src/OpenFOAM/db/dictionary/equation/equationReader/equationReaderParse.C new file mode 100644 index 000000000..af4b23f53 --- /dev/null +++ b/src/OpenFOAM/db/dictionary/equation/equationReader/equationReaderParse.C @@ -0,0 +1,672 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::equationReader::parse(label index) +{ + if (debug) + { + Info << "Parsing equation " << eqns_[index].equationName() + << " at index " << index << "." << endl; + } + if ((index > eqns_.size()) || (index < 0)) + { + FatalErrorIn("equationReader::parse(index)") + << "Index " << index << " out of bounds (0, " + << eqns_.size() - 1 << ")" + << abort(FatalError); + } + + eqns_[index].clear(); + + // First, ensure there are no ':' or '&' characters. This is to + // accommodate the stringPreconditioner, which uses these special + // characters as work-arounds to limitations imposed by the token class. + if + ( + eqns_[index].rawText().string::find(":") != string::npos + && eqns_[index].rawText().string::find("&") != string::npos + ) + { + FatalErrorIn("equationReader::parse") + << "Parsing error in the equation for " + << eqns_[index].equationName() << ", given by:" << token::NL + << token::NL << token::TAB << eqns_[index].rawText() << token::NL + << token::NL << "Colons, ':', and ampersands '&' are prohibitted." + << abort(FatalError); + } + + // Precondition the string, and load it into a stream + IStringStream rawStream(stringPreconditioner(eqns_[index].rawText())); + tokenList tl; + + // Read tokens from raw equation string stream + while (!rawStream.eof()) + { + tl.setSize(tl.size() + 1); + tl[tl.size() - 1] = token(rawStream); + + // Bug fix - equations ending in brackets read an extra token of type + // ERROR at the end, caused by string replace ')' with ' ) ' above + if (tl[tl.size() - 1].type() == token::ERROR) + { + tl.setSize(tl.size() - 1); + } + } + + // map: + // - variable / constant: conatins source data only (first three fields) + // - operation: conatains operation number only (last field) + // - brackets, comma: all are zero + equationOperationList map(tl.size()); + + // opLvl: level of operation precedence + // 0. variable + // 1. + - + // 2. * / and negatives + // 3. ^ + // 4. ( ) and functions; special case -4 indicates close bracket ')' + // 5. , used only in functions + labelList opLvl(tl.size()); + + // parenthesis level, negative means function root + labelList pl(tl.size()); + + createMap(index, tl, map, opLvl, pl); + +/* Useful for debugging, left in +Info << "tokenList: " << endl; +forAll(tl, i) +{ +Info << tl[i]; +if (tl[i].isNumber()) +{ +Info << " isNumber "; +} +if (tl[i].isPunctuation()) +{ +Info << " isPunctuation "; +} +if (tl[i].isWord()) +{ +Info << " isWord "; +} +Info << endl; +} +Info << "opLvl is: " << opLvl << endl; +Info << "pl is: " << pl << endl; +Info << "Map is: " << map << endl; +*/ + + // In the main parsing loop, we create labelLists of indices that specify + // what part of the equation we are working with. As the equation is + // parsed, the indices lists will shrink, but tl, pl, opLvl, and map will + // not. Indices lists: + // + // - eqnIndices - the full working list + // - subEqnIndices - the current group with the highest parenthesis level + // - subEqnIndices2 - used when evaluating multiparameter functions + // + // Anytime we are 'trimming', we are removing elements from these lists. + // + // The main parsing loop: + // - find the max parenthesis level magnitude + // - if pl < 0, it is a function, look for a comma + // -- no comma: + // send the expression to parseExpression + // if it is a function, evaluate the function + // store the result, trim the indices + // -- comma + // same as above, except parseExpression both sides of the comma + // - once the eqnIndices are down to a single size, parsing is done + + label storeIndex(-1); + + // Create an index list of all the tokens we're working with - initially + // it is all of them + labelList eqnIndices(tl.size()); + forAll(eqnIndices, i) + { + eqnIndices[i] = i; + } + + // Main parsing loop + while (eqnIndices.size() > 1) + { + labelList subEqnIndices(findMaxParenthesis(pl, eqnIndices)); + if (opLvl[subEqnIndices[0]] == 4) + { + // Expression is enclosed in brackets - trim them + if (pl[subEqnIndices[0]] < 0) + { + // This is a function: + // - trim function name, but leave it in parent indexList + // - first bracket is second index + pl[subEqnIndices[0]] = 0; + trimList(subEqnIndices, 0, 0); + trimListWithParent(eqnIndices, subEqnIndices, 0, 0); + } + else + { + // Not a function, first bracket is first index + trimListWithParent(eqnIndices, subEqnIndices, 0, 0); + } + + // Trimming trailing bracket + trimListWithParent + ( + eqnIndices, + subEqnIndices, + subEqnIndices.size() - 1, + subEqnIndices.size() - 1 + ); + } + + // Move negatives into the source index + absorbNegatives(index, tl, eqnIndices, subEqnIndices, map, opLvl); + + label commaIndex(-1); + label commaPos(-1); + + // Look for a comma + forAll(subEqnIndices, i) + { + if (opLvl[subEqnIndices[i]] == 5) + { + commaIndex = i; + commaPos = subEqnIndices[i]; + break; + } + } + if (subEqnIndices.size() == 2) + { + OStringStream description; + description << "Empty expression '()' found."; + fatalParseError + ( + index, + tl, + subEqnIndices[0], + subEqnIndices[subEqnIndices.size() - 1], + "equationReader::parse", + description + ); + } + + if (commaIndex == -1) + { + // standard parenthesis or single parameter function + label resultIndex + ( + parseExpression + ( + index, + tl, + opLvl, + map, + subEqnIndices, + storeIndex + ) + ); + + trimListWithParent + ( + eqnIndices, + subEqnIndices, + 0, + subEqnIndices.size() - 1, + findIndex(resultIndex, subEqnIndices) + ); + + label currentIndex(-1); + + if (pl[resultIndex] < 0) + { + // This is a single parameter function call - evaluate it + eqns_[index].setSize(eqns_[index].size() + 3); + + // retrieve parameter value + eqns_[index].ops()[eqns_[index].size() - 3] = equationOperation + ( + map[resultIndex].sourceList(), + map[resultIndex].sourceIndex(), + map[resultIndex].dictLookupIndex(), + equationOperation::otretrieve + ); + // perform function operation + currentIndex = findIndex(resultIndex, eqnIndices); + eqns_[index].ops()[eqns_[index].size() - 2] = equationOperation + ( + equationOperation::slnone, + 0, + 0, + map[eqnIndices[currentIndex - 1]].operation() + ); + + // store result + storeIndex++; + eqns_[index].ops()[eqns_[index].size() - 1] = equationOperation + ( + equationOperation::slstorage, + storeIndex + 1, + 0, + equationOperation::otstore + ); + + // Set term in map to store location + map[resultIndex] = + eqns_[index].ops()[eqns_[index].ops().size() - 1]; + map[resultIndex].operation() = equationOperation::otnone; + + // Trim function call from indices list + currentIndex = findIndex(resultIndex, eqnIndices); + trimList(eqnIndices, currentIndex - 1, currentIndex - 1); + } + // reduce the parenthesis level of result + pl[resultIndex] = mag(pl[resultIndex]) - 1; + + if (pl[resultIndex] > 0) + { + // Look for preceding parenthesis change - was it negative? + currentIndex = findIndex(resultIndex, eqnIndices); + for (label i(currentIndex - 1); i >= 0; i--) + { + if (mag(pl[eqnIndices[i]]) == pl[eqnIndices[currentIndex]]) + { + if (pl[eqnIndices[i]] < 0) + { + pl[eqnIndices[currentIndex]] = + -pl[eqnIndices[currentIndex]]; + } + break; + } + } + } + } // end standard parenthesis / single parameter function + else if + ( + (commaIndex < 1) || (commaIndex >= (subEqnIndices.size() - 1)) + ) + { + OStringStream description; + description << "Misplaced comma. '(,[expression)' or " + << "'([expression],)' found."; + fatalParseError + ( + index, + tl, + commaPos, + commaPos, + "equationReader::parse", + description + ); + } + else + { + // multi-parameter function + // Split the expression into two - before & after the comma + labelList subEqnIndices2 + ( + subEqnIndices.size() - commaIndex - 1 + ); + forAll(subEqnIndices2, i) + { + subEqnIndices2[i] = subEqnIndices[i + commaIndex + 1]; + } + subEqnIndices.setSize(commaIndex + 1); + trimListWithParent + ( + eqnIndices, + subEqnIndices, + commaIndex, + commaIndex + ); + + // Parse the first parameter + label resultIndex + ( + parseExpression + ( + index, + tl, + opLvl, + map, + subEqnIndices, + storeIndex + ) + ); + + trimListWithParent + ( + eqnIndices, + subEqnIndices, + 0, + subEqnIndices.size() - 1, + findIndex(resultIndex, subEqnIndices) + ); + + // Parse the second parameter + label resultIndex2 + ( + parseExpression + ( + index, + tl, + opLvl, + map, + subEqnIndices2, + storeIndex + ) + ); + + trimListWithParent + ( + eqnIndices, + subEqnIndices2, + 0, + subEqnIndices2.size() - 1, + findIndex(resultIndex2, subEqnIndices2) + ); + + // Perform multiparameter function operations + // first retrieve the first parameter + eqns_[index].setSize(eqns_[index].size() + 3); + eqns_[index].ops()[eqns_[index].size() - 3] = equationOperation + ( + map[resultIndex].sourceList(), + map[resultIndex].sourceIndex(), + map[resultIndex].dictLookupIndex(), + equationOperation::otretrieve + ); + + // perform the function operation (2nd parameter is source) + label currentIndex(findIndex(resultIndex, eqnIndices)); + eqns_[index].ops()[eqns_[index].size() - 2] = equationOperation + ( + map[resultIndex2].sourceList(), + map[resultIndex2].sourceIndex(), + map[resultIndex2].dictLookupIndex(), + map[eqnIndices[currentIndex - 1]].operation() + ); + + // store result + storeIndex++; + eqns_[index].ops()[eqns_[index].size() - 1] = equationOperation + ( + equationOperation::slstorage, + storeIndex + 1, + 0, + equationOperation::otstore + ); + + // Set term in map to store location + map[resultIndex] = eqns_[index].ops()[eqns_[index].size() - 1]; + map[resultIndex].operation() = equationOperation::otnone; + + // trim function call from indices list + trimList(eqnIndices, currentIndex - 1, currentIndex - 1); + + // trim second parameter from indices list + label currentIndex2(findIndex(resultIndex2, eqnIndices)); + trimList(eqnIndices, currentIndex2, currentIndex2); + + // reduce the parenthesis level of result + pl[resultIndex] = mag(pl[resultIndex]) - 1; + + if (pl[resultIndex] > 0) + { + currentIndex = findIndex(resultIndex, eqnIndices); + // Look for preceding parenthesis change - was it negative? + for (label i(currentIndex - 1); i >= 0; i--) + { + if (mag(pl[eqnIndices[i]]) == pl[eqnIndices[currentIndex]]) + { + if (pl[eqnIndices[i]] < 0) + { + pl[eqnIndices[currentIndex]] = + -pl[eqnIndices[currentIndex]]; + } + break; + } + } + } + // break; + } // end default case + } // end main parsing loop + + // Special case - equations with only one effective term: + // e.g. "2", "-2", "-(2)", "-(((((2)))))", etc.. + // will complete their parse with an empty operation list + if (eqns_[index].size() == 0) + { + + labelList subEqnIndices(findMaxParenthesis(pl, eqnIndices)); + absorbNegatives(index, tl, eqnIndices, subEqnIndices, map, opLvl); + + if (opLvl[subEqnIndices[0]] != 0) + { + OStringStream description; + description << "Expecting a variable or literal constant."; + fatalParseError + ( + index, + tl, + 0, + 0, + "equationReader::parse", + description + ); + } + + // Add two operations - the first retrieves the variable, the second + // is a dummy because the last operation is trimmed before exitting + // equationReader::parse + eqns_[index].setSize(eqns_[index].size() + 2); + + // retrieve parameter value + eqns_[index].ops()[eqns_[index].size() - 2] = equationOperation + ( + map[subEqnIndices[0]].sourceList(), + map[subEqnIndices[0]].sourceIndex(), + map[subEqnIndices[0]].dictLookupIndex(), + equationOperation::otretrieve + ); + + // Store this result + eqns_[index].ops()[eqns_[index].size() - 1] = equationOperation + ( + equationOperation::slstorage, + storeIndex + 1, + 0, + equationOperation::otstore + ); + + } + + // The last operation is an otstore. Add an otretrieve to finalize. + // We could eliminate the last otstore, but this will miss the final + // absorbNegatives, if one existed. + eqns_[index].setSize(eqns_[index].size() + 1); + eqns_[index].ops()[eqns_[index].size() - 1] = equationOperation + ( + map[eqnIndices[0]].sourceList(), + map[eqnIndices[0]].sourceIndex(), + map[eqnIndices[0]].dictLookupIndex(), + equationOperation::otretrieve + ); + + // Link the eval function pointers (for efficiency) + assignFunctionPointers(index); +} + + +Foam::label Foam::equationReader::parseExpression +( + label index, + const tokenList& tl, + const labelList& opLvl, + equationOperationList& map, + const labelList& indices, + label& storeIndex +) +{ +// equation * eqn(&this->operator[](index)); + label returnMe(-1); + labelList subIndices(indices); + labelList opIndices; + + bool done(false); + while (!done) + { + opIndices = findMaxOperation(opLvl, subIndices); + if (!(opIndices.size() % 2)) + { + OStringStream description; + description << "Expected pattern: [number] [operation] [number] " + << "[operation] ... violated."; + fatalParseError + ( + index, + tl, + opIndices[0], + opIndices[opIndices.size() - 1], + "equationReader::parseExpression", + description + ); + } + if (!opIndices.size()) + { + OStringStream description; + description << "Empty expression found, e.g. '()'."; + fatalParseError + ( + index, + tl, + subIndices[0], + subIndices[subIndices.size() - 1], + "equationReader::parseExpression", + description + ); + } + if (opIndices.size() == 1) + { + // This means only one term existed between the brackets, nothing + // needs to be done. + if (opLvl[opIndices[0]] != 0) + { + OStringStream description; + description << "Detected an isolated operator, e.g. (+)."; + fatalParseError + ( + index, + tl, + opIndices[0], + opIndices[0], + "equationReader::parse", + description + ); + } + done = true; + returnMe = opIndices[0]; + } + else if (opIndices.size() > 1) + { + // More than one term. Do a retrieve, then enter the operations + // loop. + if (opLvl[opIndices[0]] != 0) + { + OStringStream description; + description << "Expected pattern: [number] [operation] " + << "[number] [operation] ... violated. First token is " + << "not a [number]."; + fatalParseError + ( + index, + tl, + opIndices[0], + opIndices[opIndices.size() - 1], + "equationReader::parseExpression", + description + ); + } + eqns_[index].setSize(eqns_[index].size() + 1); + + eqns_[index].ops()[eqns_[index].size() - 1] = equationOperation + ( + map[opIndices[0]].sourceList(), + map[opIndices[0]].sourceIndex(), + map[opIndices[0]].dictLookupIndex(), + equationOperation::otretrieve + ); + + trimListWithParent(subIndices, opIndices, 0, 0); + + // Begin operations loop + while (opIndices.size() > 1) + { + eqns_[index].setSize(eqns_[index].size() + 1); + eqns_[index].ops()[eqns_[index].size() - 1] = equationOperation + ( + map[opIndices[1]].sourceList(), + map[opIndices[1]].sourceIndex(), + map[opIndices[1]].dictLookupIndex(), + map[opIndices[0]].operation() + ); + + if (opIndices.size() > 2) + { + // Remove the two operation indices from the working list + trimListWithParent(subIndices, opIndices, 0, 1); + } + else + { + // Last operation, perform a store + eqns_[index].setSize(eqns_[index].size() + 1); + storeIndex++; + eqns_[index].ops()[eqns_[index].size() - 1] = + equationOperation + ( + equationOperation::slstorage, + storeIndex + 1, + 0, + equationOperation::otstore + ); + + returnMe = opIndices[1]; + map[opIndices[1]] = + eqns_[index].ops()[eqns_[index].size() - 1]; + map[opIndices[1]].operation() = equationOperation::otnone; + trimListWithParent(subIndices, opIndices, 0, 0); + } + } // end operations loop + } // end if (opIndices.size() > 1) + } // main parsing loop + return returnMe; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/db/dictionary/equation/equationReader/equationReaderPointerFunctions.H b/src/OpenFOAM/db/dictionary/equation/equationReader/equationReaderPointerFunctions.H new file mode 100644 index 000000000..f93f0677d --- /dev/null +++ b/src/OpenFOAM/db/dictionary/equation/equationReader/equationReaderPointerFunctions.H @@ -0,0 +1,1344 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + // Get source pointer functions + dimensionedScalar getSourceNone + ( + equationReader * eqnReader, + const label equationIndex, + const label equationOperationIndex, + const label maxStoreIndex, + const label storageOffset + ); + + dimensionedScalar getSourceDictSourceDScalar + ( + equationReader * eqnReader, + const label equationIndex, + const label equationOperationIndex, + const label maxStoreIndex, + const label storageOffset + ); + + dimensionedScalar getSourceDictSourceScalar + ( + equationReader * eqnReader, + const label equationIndex, + const label equationOperationIndex, + const label maxStoreIndex, + const label storageOffset + ); + + dimensionedScalar getSourceExternalDScalar + ( + equationReader * eqnReader, + const label equationIndex, + const label equationOperationIndex, + const label maxStoreIndex, + const label storageOffset + ); + + dimensionedScalar getSourceExternalScalar + ( + equationReader * eqnReader, + const label equationIndex, + const label equationOperationIndex, + const label maxStoreIndex, + const label storageOffset + ); + + dimensionedScalar getSourceExternalScalarList + ( + equationReader * eqnReader, + const label equationIndex, + const label equationOperationIndex, + const label maxStoreIndex, + const label storageOffset + ); + + dimensionedScalar getSourceInternalScalar + ( + equationReader * eqnReader, + const label equationIndex, + const label equationOperationIndex, + const label maxStoreIndex, + const label storageOffset + ); + + dimensionedScalar getSourceEquation + ( + equationReader * eqnReader, + const label equationIndex, + const label equationOperationIndex, + const label maxStoreIndex, + const label storageOffset + ); + + dimensionedScalar getSourceEquationCircRefDetect + ( + equationReader * eqnReader, + const label equationIndex, + const label equationOperationIndex, + const label maxStoreIndex, + const label storageOffset + ); + + dimensionedScalar getSourceStorage + ( + equationReader * eqnReader, + const label equationIndex, + const label equationOperationIndex, + const label maxStoreIndex, + const label storageOffset + ); + + + // Evaluation pointer functions + void evalNone + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalRetrieve + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalRetrieveChangeDimensions + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalStore + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalPlus + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalPlusDimCheck + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalPlusChangeDimensions + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalMinus + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalMinusDimCheck + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalMinusChangeDimensions + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalTimes + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalDivide + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalPow + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalPowDimCheck + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalPowChangeDimensions + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalSign + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalPos + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalNeg + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalMag + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalLimit + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalMinMod + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalSqrtSumSqr + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalSqr + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalPow3 + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalPow4 + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalPow5 + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalInv + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalSqrt + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalCbrt + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalHypot + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalHypotDimCheck + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalHypotChangeDimensions + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalExp + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalExpDimCheck + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalExpChangeDimensions + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalLog + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalLogDimCheck + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalLogChangeDimensions + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalLog10 + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalLog10DimCheck + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalLog10ChangeDimensions + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalSin + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalSinDimCheck + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalSinChangeDimensions + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalCos + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalCosDimCheck + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalCosChangeDimensions + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalTan + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalTanDimCheck + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalTanChangeDimensions + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalAsin + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalAsinDimCheck + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalAsinChangeDimensions + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalAcos + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalAcosDimCheck + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalAcosChangeDimensions + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalAtan + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalAtanDimCheck + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalAtanChangeDimensions + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalSinh + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalSinhDimCheck + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalSinhChangeDimensions + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalCosh + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalCoshDimCheck + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalCoshChangeDimensions + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalTanh + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalTanhDimCheck + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalTanhChangeDimensions + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalAsinh + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalAsinhDimCheck + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalAsinhChangeDimensions + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalAcosh + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalAcoshDimCheck + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalAcoshChangeDimensions + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalAtanh + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalAtanhDimCheck + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalAtanhChangeDimensions + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalErf + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalErfDimCheck + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalErfChangeDimensions + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalErfc + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalErfcDimCheck + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalErfcChangeDimensions + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalLgamma + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalLgammaDimCheck + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalLgammaChangeDimensions + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalJ0 + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalJ0DimCheck + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalJ0ChangeDimensions + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalJ1 + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalJ1DimCheck + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalJ1ChangeDimensions + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalJn + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalJnDimCheck + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalJnChangeDimensions + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalY0 + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalY0DimCheck + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalY0ChangeDimensions + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalY1 + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalY1DimCheck + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalY1ChangeDimensions + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalYn + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalYnDimCheck + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalYnChangeDimensions + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalMax + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalMaxDimCheck + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalMaxChangeDimensions + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalMin + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalMinDimCheck + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalMinChangeDimensions + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + + void evalStabilise + ( + equationReader * eqnReader, + const label index, + const label i, + const label storageOffset, + label& storeIndex, + dimensionedScalar& ds, + dimensionedScalar source + ); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/db/dictionary/equation/equationReader/equationReaderTemplates.C b/src/OpenFOAM/db/dictionary/equation/equationReader/equationReaderTemplates.C new file mode 100644 index 000000000..05e963970 --- /dev/null +++ b/src/OpenFOAM/db/dictionary/equation/equationReader/equationReaderTemplates.C @@ -0,0 +1,108 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright held by original author + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template +void Foam::equationReader::addDataSource +( + const DimensionedField& dfield +) +{ +// const scalarList * slist(&dfield); + word name(dfield.name()); + dimensionSet dims(dfield.dimensions()); + addDataSource(dfield, name, dims); +} + + +template +void Foam::equationReader::evaluateField +( + const label& index, + DimensionedField& dfield +) +{ + evaluateField(index, dfield, dfield.dimensions()); +} + + +template +void Foam::equationReader::linkOutput +( + const word& eqnName, + DimensionedField& dfield +) +{ + label index(lookup(eqnName)); + if (index < 0) + { + FatalErrorIn("equationReader::linkOutput") + << "Equation name " << eqnName << "not found." + << abort(FatalError); + } + linkOutput + ( + index, + dfield, + dfield.dimensions() + ); +} + + +template +void Foam::equationReader::linkOutput +( + label index, + DimensionedField& dfield +) +{ + linkOutput + ( + index, + dfield, + dfield.dimensions() + ); +} + + +template +void Foam::equationReader::readEquation +( + equation eqn, + DimensionedField& dfield +) +{ + readEquation + ( + eqn, + dfield, + dfield.dimensions() + ); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/primitives/Scalar/Scalar.C b/src/OpenFOAM/primitives/Scalar/Scalar.C index 6672990a2..8e51eb83d 100644 --- a/src/OpenFOAM/primitives/Scalar/Scalar.C +++ b/src/OpenFOAM/primitives/Scalar/Scalar.C @@ -26,6 +26,8 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "equationReader.H" + namespace Foam { @@ -80,6 +82,20 @@ Istream& operator>>(Istream& is, Scalar& s) { s = t.number(); } + else if (t.isString()) + { + // DLFG 2011-07-04 Modifications for equationReader + equationReader eqn; + eqn.readEquation + ( + equation + ( + "fromScalar", + t.stringToken() + ) + ); + s = eqn.evaluate(0).value(); + } else { is.setBad(); diff --git a/tutorials/equationReader/equationReaderDemo/expectedOutput b/tutorials/equationReader/equationReaderDemo/expectedOutput new file mode 100644 index 000000000..cc33b1625 --- /dev/null +++ b/tutorials/equationReader/equationReaderDemo/expectedOutput @@ -0,0 +1,55 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM Extend Project: Open source CFD | +| \\ / O peration | Version: 1.6-ext | +| \\ / A nd | Web: www.extend-project.de | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +Build : 1.6-ext-1f09367282cf +Exec : equationReaderDemo +Date : Apr 07 2011 +Time : 09:03:55 +Host : Bruce +PID : 4063 +Case : /home/dave/OpenFOAM/dave-1.6-ext/run/tutorials/equationReaderDemo +nProcs : 1 +SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE). + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +Reading testDict dictionary + +Begin stand-alone operation... +Reading a scalar... done. Result = 1.94281 +Reading a dimensionedScalar ... done. Result = standAloneDScalar [0 0 0 0 0 0 0] 0.080125 + +Creating the equationReader object + +Creating data sources: dictionary ptrs... scalars... dimensionedScalar ptrs... output dimensionedScalar ptrs... done. +Linking in the data sources: dictionary ptrs... dimensionedScalar ptrs... scalar ptrs... done. + +Reading equation a from testDict with no output variable +Evaluating equation a ... done. Result = a [0 0 0 0 0 0 0] 0.625 + +Reading equation b from testDict, linking an output variable +Output variable before update() = activeOutB [0 0 0 0 0 0 0] 0 +Begining .update() - this evaluates all equations with active output... +Done. Output variable after update() = activeOutB [0 0 0 0 0 0 0] 0.3235 + +Equation c depends on equation a. Reading it will link them. +Reading equation c from testDict... done. +Evaluating c will force an evaluate of a. +Evaluating ... done. Result = c [0 0 0 0 0 0 0] 0.805821 + +Equation d depends on equation e, but equation e is never explicitly +read by equationReaderDemo. Reading equation d will automatically +create equation e on-the-fly. +Reading equation d from testDict ... done. +Again, evaluating d will force an evaluate of e. +Evaluating d ... done. The result is = d [0 0 0 0 0 0 0] 2.04124 + +Equations can draw from any sources added to equationReader. +Equation f is very complex, drawing from numerous sources. +Reading equation f ... done. Evaluating equation f ... done. +The result is: f [0 0 0 0 0 0 0] -86.1698 + +Creating output... diff --git a/tutorials/equationReader/equationReaderDemo/system/controlDict b/tutorials/equationReader/equationReaderDemo/system/controlDict new file mode 100644 index 000000000..89d60a63c --- /dev/null +++ b/tutorials/equationReader/equationReaderDemo/system/controlDict @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application equationReaderDemo; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 1; + +deltaT 1; + +writeControl timeStep; + +writeInterval 1; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 6; + +writeCompression uncompressed; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + +// ************************************************************************* // diff --git a/tutorials/equationReader/equationReaderDemo/testDict b/tutorials/equationReader/equationReaderDemo/testDict new file mode 100644 index 000000000..b211daaec --- /dev/null +++ b/tutorials/equationReader/equationReaderDemo/testDict @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object testDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +// For demonstrating stand-alone operation +// readSa and readDSa equations can only use constants +standAloneScalar "1 + 1/3 * max(2 * sqrt(2), e_)"; + +standAloneDScalar standAloneDScalar [0 0 0 0 0 0 0] "sin(pi_ / 6) * 1 / 3^(1+2/3)"; + +// This equation is handled 'passively' +a "5 / 2^3"; + +// This one is handled 'actively' +b "cos(5 * theta + 8)"; + +// This one demonstrates variable dependence - a is another equation; DSa is a +// dimensionedScalar explicitly added to the equationReader; and Sb is a scalar +// added to the equationReader +c "a^2 + DSa - cbrt(Sb)"; + +// This one demonstrates on-the-fly equation parsing - it depends on equation +// e, but equation e is never explicitly read in equationTester.C. +d "2 * exp(inv(e)^2)"; + +// equationReader will automatically find and parse equation e when evaluating +// equation d. +//e "1 / (a + SMALL_)"; +e 7; + +// There shouldn't be any limits to the parenthesis depth, variable dependence, +// or number of sources from which the equation draws. +//f "beta"; + +f "DSa*(Sa+(DSb^Sc-(min(dictTwoA * dictThreeB, dictTwoB * dictThreeA)^DSb*cos(pi_/6)^arbitrary+7)))"; diff --git a/tutorials/equationReader/equationReaderDemo/testDict2 b/tutorials/equationReader/equationReaderDemo/testDict2 new file mode 100644 index 000000000..b997b7601 --- /dev/null +++ b/tutorials/equationReader/equationReaderDemo/testDict2 @@ -0,0 +1,25 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object testDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dictTwoA dictTwoA [0 0 0 0 0 0 0] 0.9; + +dictTwoB 0.58; + +arbitrary -1; + +beta "gamma * kappa"; + +kappa 0.87; diff --git a/tutorials/equationReader/equationReaderDemo/testDict3 b/tutorials/equationReader/equationReaderDemo/testDict3 new file mode 100644 index 000000000..a9908448c --- /dev/null +++ b/tutorials/equationReader/equationReaderDemo/testDict3 @@ -0,0 +1,34 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object testDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dictThreeA "alpha + beta"; + +dictThreeB "dictThreeA + alpha"; + +// Uh oh - a duplicate variable. equationReader doesn't check for these. +// It's anyone's guess which one will be used... +arbitrary 1; + +// This one will still be parsed, even though it is a single constant +alpha "7.0"; + +gamma "epsilon + whatever"; + +epsilon 0.001; + +theta 0.665; + +whatever 8.5;//elseYouWant [0 0 0 0 0 0 0] 8.5; diff --git a/tutorials/equationReader/equationReaderTester/0/U b/tutorials/equationReader/equationReaderTester/0/U new file mode 100644 index 000000000..fab2c48c0 --- /dev/null +++ b/tutorials/equationReader/equationReaderTester/0/U @@ -0,0 +1,41 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + movingWall + { + type fixedValue; + value uniform (1 0 0); + } + + fixedWalls + { + type fixedValue; + value uniform (0 0 0); + } + + frontAndBack + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/equationReader/equationReaderTester/0/eqns b/tutorials/equationReader/equationReaderTester/0/eqns new file mode 100644 index 000000000..a4cc74d58 --- /dev/null +++ b/tutorials/equationReader/equationReaderTester/0/eqns @@ -0,0 +1,201 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5-dev | +| \\ / A nd | Revision: exported | +| \\/ M anipulation | Web: http://www.OpenFOAM.org | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class equationReader; + location "0.1"; + object eqns; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + +{ + equations + { + Pa + { + Pa "twoa"; + lastResult Pa [ 0 0 0 0 0 0 0 ] 1; + } + twoa + { + twoa "1"; + lastResult twoa [ 0 0 0 0 0 0 0 ] 1; + } + Pb + { + Pb "sign(Sa)*cosh(twoa)"; + lastResult Pb [ 0 0 0 0 0 0 0 ] 1.54308; + } + Pc + { + Pc "DStime * 1e2 / sinh(foura + fivea / sixa^(sevena-eighta/ninea^inv(tena)))"; + lastResult Pc [ 0 0 0 0 0 0 0 ] 2.75721; + } + foura + { + foura "1"; + lastResult foura [ 0 0 0 0 0 0 0 ] 1; + } + ninea + { + ninea "nineb"; + lastResult ninea [ 0 0 0 0 0 0 0 ] 1; + } + Pd + { + Pd "Pa+Pb+Pc+Pe+Pf+Aa+Ab+Ac+Ad+Ae+Af"; + lastResult Pd [ 0 0 0 0 0 0 0 ] 586.516; + } + Pe + { + Pe "Sa+(Sb*Sc^(Sd-Se/Sf^(Sg+Sh^Si)))"; + lastResult Pe [ 0 0 0 0 0 0 0 ] 0.411732; + } + Pf + { + Pf "DSa+(DSb*DSc^(DSd-DSe/DSf^inv(DSg+DSh^DSi)))"; + lastResult Pf [ 0 0 0 0 0 0 0 ] 1.66667; + } + Aa + { + Aa "twob/log10(twoc*10)+cosh(threef) * DStime/Sa+fiveg^max(sixf,sevenj)"; + lastResult Aa [ 0 0 0 0 0 0 0 ] 3.54308; + outputVar Aa [ 0 0 0 0 0 0 0 ] 3.54308; + } + Ab + { + Ab "fourf*log(pos(sevend))*inv(stabilise(Af, SMALL_))"; + lastResult Ab [ 0 0 0 0 0 0 0 ] 0; + outputVar Ab [ 0 0 0 0 0 0 0 ] 0; + } + Ac + { + Ac "DSo + DSm * erf(e_^0) + Ad*Ae+Ad"; + lastResult Ac [ 0 0 0 0 0 0 0 ] 523.335; + outputVar Ac [ 0 0 0 0 0 0 0 ] 523.335; + } + Ad + { + Ad "Ae+Ae*Af+Pb*inv(stabilise(Af, SMALL_))^Pe+DStime^DSa*twog+sevenh"; + lastResult Ad [ 0 0 0 0 0 0 0 ] 38.26; + outputVar Ad [ 0 0 0 0 0 0 0 ] 38.26; + } + Ae + { + Ae "threej + eightg / nineb*DSk - lgamma(ninej)"; + lastResult Ae [ 0 0 0 0 0 0 0 ] 12; + outputVar Ae [ 0 0 0 0 0 0 0 ] 12; + } + Af + { + Af "fiveg^fivec+eighti"; + lastResult Af [ 0 0 0 0 0 0 0 ] 2; + outputVar Af [ 0 0 0 0 0 0 0 ] 2; + } + twob + { + twob "1"; + lastResult twob [ 0 0 0 0 0 0 0 ] 1; + } + twoc + { + twoc "1"; + lastResult twoc [ 0 0 0 0 0 0 0 ] 1; + } + threef + { + threef "1"; + lastResult threef [ 0 0 0 0 0 0 0 ] 1; + } + fourf + { + fourf "1"; + lastResult fourf [ 0 0 0 0 0 0 0 ] 1; + } + twog + { + twog "1"; + lastResult twog [ 0 0 0 0 0 0 0 ] 1; + } + threej + { + threej "1"; + lastResult threej [ 0 0 0 0 0 0 0 ] 1; + } + nineb + { + nineb "ninec"; + lastResult nineb [ 0 0 0 0 0 0 0 ] 1; + } + nu + { + nu [ 0 2 -1 0 0 0 0 ] "0.01 + nuAdd"; + lastResult nu [ 0 2 -1 0 0 0 0 ] 0.01001; + outputVar nu [ 0 2 -1 0 0 0 0 ] 0.01001; + } + nuAdd + { + nuAdd [ 0 2 -1 0 0 0 0 ] "DStime / 10000"; + lastResult nuAdd [ 0 2 -1 0 0 0 0 ] 1e-05; + } + ninec + { + ninec "nined"; + lastResult ninec [ 0 0 0 0 0 0 0 ] 1; + } + nined + { + nined "ninee"; + lastResult nined [ 0 0 0 0 0 0 0 ] 1; + } + ninee + { + ninee "ninef"; + lastResult ninee [ 0 0 0 0 0 0 0 ] 1; + } + ninef + { + ninef "nineg"; + lastResult ninef [ 0 0 0 0 0 0 0 ] 1; + } + nineg + { + nineg "nineh"; + lastResult nineg [ 0 0 0 0 0 0 0 ] 1; + } + nineh + { + nineh "ninei"; + lastResult nineh [ 0 0 0 0 0 0 0 ] 1; + } + ninei + { + ninei "ninej"; + lastResult ninei [ 0 0 0 0 0 0 0 ] 1; + } + } +} + +{ + dataSources + { + dictSources 10 ( "/home/dave/OpenFOAM/dave-1.5-dev/run/tutorials/equationReaderTester/testDict1" "/home/dave/OpenFOAM/dave-1.5-dev/run/tutorials/equationReaderTester/testDict2" "/home/dave/OpenFOAM/dave-1.5-dev/run/tutorials/equationReaderTester/testDict3" "/home/dave/OpenFOAM/dave-1.5-dev/run/tutorials/equationReaderTester/testDict4" "/home/dave/OpenFOAM/dave-1.5-dev/run/tutorials/equationReaderTester/testDict5" "/home/dave/OpenFOAM/dave-1.5-dev/run/tutorials/equationReaderTester/testDict6" "/home/dave/OpenFOAM/dave-1.5-dev/run/tutorials/equationReaderTester/testDict7" "/home/dave/OpenFOAM/dave-1.5-dev/run/tutorials/equationReaderTester/testDict8" "/home/dave/OpenFOAM/dave-1.5-dev/run/tutorials/equationReaderTester/testDict9" "/home/dave/OpenFOAM/dave-1.5-dev/run/tutorials/equationReaderTester/testDict10" ); + dictLookups 14 ( fivea sixa sevena eighta tena fiveg sixf sevenj sevend sevenh eightg ninej fivec eighti ); + externalDScalars 16 ( DSa [ 0 0 0 0 0 0 0 ] 1 DSb [ 0 0 0 0 0 0 0 ] 2 DSc [ 0 0 0 0 0 0 0 ] 3 DSd [ 0 0 0 0 0 0 0 ] 4 DSe [ 0 0 0 0 0 0 0 ] 5 DSf [ 0 0 0 0 0 0 0 ] 6 DSg [ 0 0 0 0 0 0 0 ] 7 DSh [ 0 0 0 0 0 0 0 ] 8 DSi [ 0 0 0 0 0 0 0 ] 9 DSj [ 0 0 0 0 0 0 0 ] 10 DSk [ 0 0 0 0 0 0 0 ] 11 DSl [ 0 0 0 0 0 0 0 ] 12 DSm [ 0 0 0 0 0 0 0 ] 13 DSn [ 0 0 0 0 0 0 0 ] 14 DSo [ 0 0 0 0 0 0 0 ] 15 DStime [ 0 0 0 0 0 0 0 ] 0.1 ); + externalScalars 12 ( 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 0.1 0.11 0.12 ); + externalScalarNames 12 ( Sa Sb Sc Se Sd Sf Sg Sh Si Sj Sk Sl ); + outputScalars 7 ( Aa [ 0 0 0 0 0 0 0 ] 3.54308 Ab [ 0 0 0 0 0 0 0 ] 0 Ac [ 0 0 0 0 0 0 0 ] 523.335 Ad [ 0 0 0 0 0 0 0 ] 38.26 Ae [ 0 0 0 0 0 0 0 ] 12 Af [ 0 0 0 0 0 0 0 ] 2 nu [ 0 2 -1 0 0 0 0 ] 0.01001 ); + internalScalars 8 ( 100 10 1e-15 2.71828 0 0.01 1 10000 ); + } +} + + +// ************************************************************************* // diff --git a/tutorials/equationReader/equationReaderTester/0/p b/tutorials/equationReader/equationReaderTester/0/p new file mode 100644 index 000000000..8c5250182 --- /dev/null +++ b/tutorials/equationReader/equationReaderTester/0/p @@ -0,0 +1,39 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + movingWall + { + type zeroGradient; + } + + fixedWalls + { + type zeroGradient; + } + + frontAndBack + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/equationReader/equationReaderTester/constant/polyMesh/blockMeshDict b/tutorials/equationReader/equationReaderTester/constant/polyMesh/blockMeshDict new file mode 100644 index 000000000..d89701b42 --- /dev/null +++ b/tutorials/equationReader/equationReaderTester/constant/polyMesh/blockMeshDict @@ -0,0 +1,63 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +convertToMeters 0.1; + +vertices +( + (0 0 0) + (1 0 0) + (1 1 0) + (0 1 0) + (0 0 0.1) + (1 0 0.1) + (1 1 0.1) + (0 1 0.1) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) (20 20 1) simpleGrading (1 1 1) +); + +edges +( +); + +patches +( + wall movingWall + ( + (3 7 6 2) + ) + wall fixedWalls + ( + (0 4 7 3) + (2 6 5 1) + (1 5 4 0) + ) + empty frontAndBack + ( + (0 3 2 1) + (4 5 6 7) + ) +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/tutorials/equationReader/equationReaderTester/constant/polyMesh/boundary b/tutorials/equationReader/equationReaderTester/constant/polyMesh/boundary new file mode 100644 index 000000000..ba0763bac --- /dev/null +++ b/tutorials/equationReader/equationReaderTester/constant/polyMesh/boundary @@ -0,0 +1,40 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5-dev | +| \\ / A nd | Revision: exported | +| \\/ M anipulation | Web: http://www.OpenFOAM.org | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class polyBoundaryMesh; + location "constant/polyMesh"; + object boundary; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +3 +( + movingWall + { + type wall; + nFaces 20; + startFace 760; + } + fixedWalls + { + type wall; + nFaces 60; + startFace 780; + } + frontAndBack + { + type empty; + nFaces 800; + startFace 840; + } +) + +// ************************************************************************* // diff --git a/tutorials/equationReader/equationReaderTester/constant/transportProperties b/tutorials/equationReader/equationReaderTester/constant/transportProperties new file mode 100644 index 000000000..cdba3d784 --- /dev/null +++ b/tutorials/equationReader/equationReaderTester/constant/transportProperties @@ -0,0 +1,19 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object transportProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +nu nu [0 2 -1 0 0 0 0] 0.01; + +// ************************************************************************* // diff --git a/tutorials/equationReader/equationReaderTester/expectedOutput b/tutorials/equationReader/equationReaderTester/expectedOutput new file mode 100644 index 000000000..e4fb25117 --- /dev/null +++ b/tutorials/equationReader/equationReaderTester/expectedOutput @@ -0,0 +1,2968 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM Extend Project: Open source CFD | +| \\ / O peration | Version: 1.6-ext | +| \\ / A nd | Web: www.extend-project.de | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +Build : 1.6-ext-1f09367282cf +Exec : equationReaderTester +Date : Apr 07 2011 +Time : 09:03:35 +Host : Bruce +PID : 4052 +Case : /home/dave/OpenFOAM/dave-1.6-ext/run/tutorials/equationReaderTester +nProcs : 1 +SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE). + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +Create time + +Create mesh for time = 0 + +Reading transportProperties + +Reading field p + +Creating dummy field + +Dummy name dummy +Reading field U + +Reading/calculating face flux field phi + +Creating the equationReader object + +Reading testDict dictionaries + +Stand-alone test: +saA = 1 +saB = 2 +saC = 3 +saD = 4 +saE = 5 +saF = 6 +dsaA = dsaA [0.1 0 0 0 0 0 0] 1e-05 +dsaB = dsaB [0 0.1 0 0 0 0 0] 20 +dsaC = dsaC [0 0 0.1 0 0 0 0] 30 +dsaD = dsaD [0 0 0 0.1 0 0 0] 40 +dsaE = dsaE [0 0 0 0 0.1 0 0] 50 +dsaF = dsaF [0 0 0 0 0 0.1 0] 60 +Pa is at index 0 +Pb is at index 2 +Pc is at index 3 +Pd is at index 6 +Pe is at index 7 +Pf is at index 8 +Aa is at index 9 +Ab is at index 10 +Ac is at index 11 +Ad is at index 12 +Ae is at index 13 +Af is at index 14 +nu is at index 22 + +Starting time loop + +Time = 0.01 + +Moving p index to 1... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 2.15431 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 522.165 +Ad = Ad [0 0 0 0 0 0 0] 38.17 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010001 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 0.275721 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 581.386 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0 max: 0 velocity magnitude: 0 +DILUPBiCG: Solving for Ux, Initial residual = 1, Final residual = 4.03296e-06, No Iterations 10 +DILUPBiCG: Solving for Uy, Initial residual = 0, Final residual = 0, No Iterations 0 +DICPCG: Solving for p, Initial residual = 1, Final residual = 6.19585e-07, No Iterations 35 +time step continuity errors : sum local = 1.19691e-08, global = -1.21761e-19, cumulative = -1.21761e-19 +DICPCG: Solving for p, Initial residual = 0.591076, Final residual = 8.95649e-07, No Iterations 34 +time step continuity errors : sum local = 2.68811e-08, global = -7.49095e-19, cumulative = -8.70856e-19 +ExecutionTime = 0.08 s ClockTime = 1 s + +Time = 0.02 + +Moving p index to 2... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 2.30862 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 522.295 +Ad = Ad [0 0 0 0 0 0 0] 38.18 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010002 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 0.551441 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 581.956 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.128578 max: 1.29396 velocity magnitude: 0.64698 +DILUPBiCG: Solving for Ux, Initial residual = 0.129651, Final residual = 4.71277e-06, No Iterations 8 +DILUPBiCG: Solving for Uy, Initial residual = 0.262473, Final residual = 4.09295e-06, No Iterations 9 +DICPCG: Solving for p, Initial residual = 0.498818, Final residual = 3.08891e-07, No Iterations 34 +time step continuity errors : sum local = 7.65506e-09, global = -3.00101e-19, cumulative = -1.17096e-18 +DICPCG: Solving for p, Initial residual = 0.392883, Final residual = 6.42421e-07, No Iterations 33 +time step continuity errors : sum local = 1.77384e-08, global = 1.77362e-18, cumulative = 6.02663e-19 +ExecutionTime = 0.1 s ClockTime = 1 s + +Time = 0.03 + +Moving p index to 3... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 2.46292 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 522.425 +Ad = Ad [0 0 0 0 0 0 0] 38.19 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010003 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 0.827162 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 582.526 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.185741 max: 1.6461 velocity magnitude: 0.823048 +DILUPBiCG: Solving for Ux, Initial residual = 0.0294556, Final residual = 4.04557e-06, No Iterations 8 +DILUPBiCG: Solving for Uy, Initial residual = 0.0544908, Final residual = 2.35694e-06, No Iterations 8 +DICPCG: Solving for p, Initial residual = 0.229358, Final residual = 4.74348e-07, No Iterations 33 +time step continuity errors : sum local = 8.32516e-09, global = 1.15144e-19, cumulative = 7.17807e-19 +DICPCG: Solving for p, Initial residual = 0.187652, Final residual = 3.33756e-07, No Iterations 33 +time step continuity errors : sum local = 5.79388e-09, global = -9.85668e-19, cumulative = -2.67862e-19 +ExecutionTime = 0.12 s ClockTime = 1 s + +Time = 0.04 + +Moving p index to 4... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 2.61723 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 522.555 +Ad = Ad [0 0 0 0 0 0 0] 38.2 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010004 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 1.10288 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 583.096 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.204428 max: 1.65755 velocity magnitude: 0.828775 +DILUPBiCG: Solving for Ux, Initial residual = 0.0120538, Final residual = 1.74808e-06, No Iterations 8 +DILUPBiCG: Solving for Uy, Initial residual = 0.0339442, Final residual = 6.40872e-06, No Iterations 7 +DICPCG: Solving for p, Initial residual = 0.076503, Final residual = 5.37689e-07, No Iterations 32 +time step continuity errors : sum local = 9.36536e-09, global = 2.3793e-18, cumulative = 2.11144e-18 +DICPCG: Solving for p, Initial residual = 0.0620413, Final residual = 3.54663e-07, No Iterations 32 +time step continuity errors : sum local = 6.24356e-09, global = -1.38172e-18, cumulative = 7.29718e-19 +ExecutionTime = 0.14 s ClockTime = 1 s + +Time = 0.05 + +Moving p index to 5... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 2.77154 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 522.685 +Ad = Ad [0 0 0 0 0 0 0] 38.21 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010005 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 1.3786 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 583.666 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.216232 max: 1.68509 velocity magnitude: 0.842547 +DILUPBiCG: Solving for Ux, Initial residual = 0.0068727, Final residual = 2.45261e-06, No Iterations 7 +DILUPBiCG: Solving for Uy, Initial residual = 0.0159984, Final residual = 3.46637e-06, No Iterations 7 +DICPCG: Solving for p, Initial residual = 0.0371471, Final residual = 5.5855e-07, No Iterations 30 +time step continuity errors : sum local = 9.54531e-09, global = 7.30897e-19, cumulative = 1.46061e-18 +DICPCG: Solving for p, Initial residual = 0.0305971, Final residual = 3.92368e-07, No Iterations 30 +time step continuity errors : sum local = 6.69483e-09, global = -1.73377e-18, cumulative = -2.73156e-19 +ExecutionTime = 0.17 s ClockTime = 1 s + +Time = 0.06 + +Moving p index to 6... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 2.92585 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 522.815 +Ad = Ad [0 0 0 0 0 0 0] 38.22 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010006 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 1.65432 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 584.236 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.222634 max: 1.69185 velocity magnitude: 0.845924 +DILUPBiCG: Solving for Ux, Initial residual = 0.00382478, Final residual = 9.07759e-06, No Iterations 5 +DILUPBiCG: Solving for Uy, Initial residual = 0.0100601, Final residual = 4.60975e-06, No Iterations 6 +DICPCG: Solving for p, Initial residual = 0.0152903, Final residual = 7.61663e-07, No Iterations 29 +time step continuity errors : sum local = 1.30035e-08, global = 1.71475e-18, cumulative = 1.44159e-18 +DICPCG: Solving for p, Initial residual = 0.0127069, Final residual = 5.48597e-07, No Iterations 29 +time step continuity errors : sum local = 9.36373e-09, global = -1.8595e-19, cumulative = 1.25564e-18 +ExecutionTime = 0.19 s ClockTime = 1 s + +Time = 0.07 + +Moving p index to 7... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 3.08016 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 522.945 +Ad = Ad [0 0 0 0 0 0 0] 38.23 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010007 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 1.93004 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 584.806 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.226715 max: 1.69731 velocity magnitude: 0.848657 +DILUPBiCG: Solving for Ux, Initial residual = 0.00239759, Final residual = 5.46641e-06, No Iterations 5 +DILUPBiCG: Solving for Uy, Initial residual = 0.00612175, Final residual = 2.74341e-06, No Iterations 6 +DICPCG: Solving for p, Initial residual = 0.0104525, Final residual = 9.9741e-07, No Iterations 28 +time step continuity errors : sum local = 1.70227e-08, global = -1.31853e-19, cumulative = 1.12379e-18 +DICPCG: Solving for p, Initial residual = 0.00866341, Final residual = 6.43813e-07, No Iterations 28 +time step continuity errors : sum local = 1.09749e-08, global = 3.8497e-19, cumulative = 1.50876e-18 +ExecutionTime = 0.21 s ClockTime = 1 s + +Time = 0.08 + +Moving p index to 8... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 3.23446 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 523.075 +Ad = Ad [0 0 0 0 0 0 0] 38.24 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010008 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 2.20576 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 585.376 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.229256 max: 1.69995 velocity magnitude: 0.849973 +DILUPBiCG: Solving for Ux, Initial residual = 0.00150719, Final residual = 3.3473e-06, No Iterations 5 +DILUPBiCG: Solving for Uy, Initial residual = 0.00392926, Final residual = 1.85486e-06, No Iterations 6 +DICPCG: Solving for p, Initial residual = 0.00595047, Final residual = 5.19658e-07, No Iterations 28 +time step continuity errors : sum local = 8.93036e-09, global = -2.94145e-19, cumulative = 1.21461e-18 +DICPCG: Solving for p, Initial residual = 0.00489196, Final residual = 4.48192e-07, No Iterations 28 +time step continuity errors : sum local = 7.71646e-09, global = -2.96627e-19, cumulative = 9.17984e-19 +ExecutionTime = 0.24 s ClockTime = 1 s + +Time = 0.09 + +Moving p index to 9... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 3.38877 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 523.205 +Ad = Ad [0 0 0 0 0 0 0] 38.25 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010009 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 2.48149 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 585.946 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.230882 max: 1.70162 velocity magnitude: 0.850809 +DILUPBiCG: Solving for Ux, Initial residual = 0.00097323, Final residual = 2.43569e-06, No Iterations 5 +DILUPBiCG: Solving for Uy, Initial residual = 0.00252728, Final residual = 8.35714e-06, No Iterations 7 +DICPCG: Solving for p, Initial residual = 0.00399438, Final residual = 8.08472e-07, No Iterations 27 +time step continuity errors : sum local = 1.38743e-08, global = 1.1344e-18, cumulative = 2.05238e-18 +DICPCG: Solving for p, Initial residual = 0.00327854, Final residual = 5.10516e-07, No Iterations 25 +time step continuity errors : sum local = 8.75289e-09, global = -7.85822e-20, cumulative = 1.9738e-18 +ExecutionTime = 0.26 s ClockTime = 1 s + +Time = 0.1 + +Moving p index to 10... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 3.54308 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 523.335 +Ad = Ad [0 0 0 0 0 0 0] 38.26 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.01001 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 2.75721 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 586.516 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.231926 max: 1.70261 velocity magnitude: 0.851303 +DILUPBiCG: Solving for Ux, Initial residual = 0.000632732, Final residual = 1.5485e-06, No Iterations 5 +DILUPBiCG: Solving for Uy, Initial residual = 0.0016409, Final residual = 7.81803e-06, No Iterations 5 +DICPCG: Solving for p, Initial residual = 0.00250763, Final residual = 5.76385e-07, No Iterations 27 +time step continuity errors : sum local = 9.84437e-09, global = 1.20735e-18, cumulative = 3.18115e-18 +DICPCG: Solving for p, Initial residual = 0.00205286, Final residual = 5.73723e-07, No Iterations 27 +time step continuity errors : sum local = 9.81059e-09, global = 8.62088e-19, cumulative = 4.04324e-18 +ExecutionTime = 0.29 s ClockTime = 1 s + +Time = 0.11 + +Moving p index to 11... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 3.69739 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 523.465 +Ad = Ad [0 0 0 0 0 0 0] 38.27 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010011 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 3.03293 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 587.086 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.232602 max: 1.70322 velocity magnitude: 0.851609 +DILUPBiCG: Solving for Ux, Initial residual = 0.000414761, Final residual = 1.02601e-06, No Iterations 5 +DILUPBiCG: Solving for Uy, Initial residual = 0.00106888, Final residual = 4.44886e-06, No Iterations 5 +DICPCG: Solving for p, Initial residual = 0.00166151, Final residual = 9.28221e-07, No Iterations 26 +time step continuity errors : sum local = 1.59185e-08, global = 3.98701e-20, cumulative = 4.08311e-18 +DICPCG: Solving for p, Initial residual = 0.00135473, Final residual = 7.66074e-07, No Iterations 26 +time step continuity errors : sum local = 1.31088e-08, global = -6.42719e-19, cumulative = 3.44039e-18 +ExecutionTime = 0.31 s ClockTime = 1 s + +Time = 0.12 + +Moving p index to 12... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 3.8517 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 523.595 +Ad = Ad [0 0 0 0 0 0 0] 38.28 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010012 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 3.30865 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 587.656 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.23304 max: 1.7036 velocity magnitude: 0.851799 +DILUPBiCG: Solving for Ux, Initial residual = 0.000273734, Final residual = 6.65266e-07, No Iterations 5 +DILUPBiCG: Solving for Uy, Initial residual = 0.000698747, Final residual = 6.73378e-06, No Iterations 4 +DICPCG: Solving for p, Initial residual = 0.0010952, Final residual = 6.86661e-07, No Iterations 26 +time step continuity errors : sum local = 1.17782e-08, global = -5.29396e-19, cumulative = 2.91099e-18 +DICPCG: Solving for p, Initial residual = 0.000890157, Final residual = 5.29018e-07, No Iterations 26 +time step continuity errors : sum local = 9.05946e-09, global = -1.99896e-18, cumulative = 9.12029e-19 +ExecutionTime = 0.34 s ClockTime = 1 s + +Time = 0.13 + +Moving p index to 13... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 4.006 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 523.725 +Ad = Ad [0 0 0 0 0 0 0] 38.29 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010013 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 3.58437 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 588.226 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233324 max: 1.70384 velocity magnitude: 0.85192 +DILUPBiCG: Solving for Ux, Initial residual = 0.000182181, Final residual = 6.35526e-06, No Iterations 4 +DILUPBiCG: Solving for Uy, Initial residual = 0.000457311, Final residual = 4.77931e-06, No Iterations 4 +DICPCG: Solving for p, Initial residual = 0.000720863, Final residual = 5.11064e-07, No Iterations 26 +time step continuity errors : sum local = 8.75327e-09, global = -2.93649e-19, cumulative = 6.18379e-19 +DICPCG: Solving for p, Initial residual = 0.000583231, Final residual = 9.69214e-07, No Iterations 25 +time step continuity errors : sum local = 1.6556e-08, global = -1.1157e-18, cumulative = -4.97322e-19 +ExecutionTime = 0.36 s ClockTime = 1 s + +Time = 0.14 + +Moving p index to 14... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 4.16031 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 523.855 +Ad = Ad [0 0 0 0 0 0 0] 38.3 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010014 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 3.86009 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 588.796 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233508 max: 1.70399 velocity magnitude: 0.851996 +DILUPBiCG: Solving for Ux, Initial residual = 0.000123966, Final residual = 9.28349e-06, No Iterations 3 +DILUPBiCG: Solving for Uy, Initial residual = 0.000300651, Final residual = 2.97326e-06, No Iterations 4 +DICPCG: Solving for p, Initial residual = 0.000482526, Final residual = 4.53165e-07, No Iterations 26 +time step continuity errors : sum local = 7.81137e-09, global = -4.00025e-19, cumulative = -8.97346e-19 +DICPCG: Solving for p, Initial residual = 0.000386241, Final residual = 5.82688e-07, No Iterations 16 +time step continuity errors : sum local = 1.35169e-08, global = 1.40207e-18, cumulative = 5.04725e-19 +ExecutionTime = 0.38 s ClockTime = 1 s + +Time = 0.15 + +Moving p index to 15... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 4.31462 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 523.985 +Ad = Ad [0 0 0 0 0 0 0] 38.31 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010015 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 4.13581 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 589.367 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233626 max: 1.70409 velocity magnitude: 0.852045 +DILUPBiCG: Solving for Ux, Initial residual = 8.60485e-05, Final residual = 5.39774e-06, No Iterations 3 +DILUPBiCG: Solving for Uy, Initial residual = 0.000200679, Final residual = 2.0296e-06, No Iterations 4 +DICPCG: Solving for p, Initial residual = 0.000350351, Final residual = 8.00625e-07, No Iterations 18 +time step continuity errors : sum local = 1.72981e-08, global = 1.42771e-18, cumulative = 1.93244e-18 +DICPCG: Solving for p, Initial residual = 0.000277604, Final residual = 8.62603e-07, No Iterations 15 +time step continuity errors : sum local = 1.74024e-08, global = 7.84167e-20, cumulative = 2.01086e-18 +ExecutionTime = 0.4 s ClockTime = 1 s + +Time = 0.16 + +Moving p index to 16... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 4.46893 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 524.115 +Ad = Ad [0 0 0 0 0 0 0] 38.32 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010016 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 4.41153 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 589.937 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233704 max: 1.70415 velocity magnitude: 0.852076 +DILUPBiCG: Solving for Ux, Initial residual = 6.01462e-05, Final residual = 3.03685e-06, No Iterations 3 +DILUPBiCG: Solving for Uy, Initial residual = 0.000135901, Final residual = 1.46879e-06, No Iterations 4 +DICPCG: Solving for p, Initial residual = 0.000257985, Final residual = 6.23369e-07, No Iterations 25 +time step continuity errors : sum local = 1.06746e-08, global = 2.12089e-19, cumulative = 2.22294e-18 +DICPCG: Solving for p, Initial residual = 0.000203616, Final residual = 9.12131e-07, No Iterations 17 +time step continuity errors : sum local = 1.89831e-08, global = 2.39188e-18, cumulative = 4.61482e-18 +ExecutionTime = 0.42 s ClockTime = 1 s + +Time = 0.17 + +Moving p index to 17... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 4.62324 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 524.245 +Ad = Ad [0 0 0 0 0 0 0] 38.33 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010017 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 4.68725 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 590.507 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233756 max: 1.70419 velocity magnitude: 0.852096 +DILUPBiCG: Solving for Ux, Initial residual = 4.28138e-05, Final residual = 1.72046e-06, No Iterations 3 +DILUPBiCG: Solving for Uy, Initial residual = 9.3866e-05, Final residual = 1.12685e-06, No Iterations 4 +DICPCG: Solving for p, Initial residual = 0.000200357, Final residual = 7.45204e-07, No Iterations 24 +time step continuity errors : sum local = 1.27699e-08, global = -6.45201e-20, cumulative = 4.5503e-18 +DICPCG: Solving for p, Initial residual = 0.000157745, Final residual = 5.67908e-07, No Iterations 24 +time step continuity errors : sum local = 9.73194e-09, global = -1.09932e-18, cumulative = 3.45098e-18 +ExecutionTime = 0.44 s ClockTime = 1 s + +Time = 0.18 + +Moving p index to 18... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 4.77755 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 524.375 +Ad = Ad [0 0 0 0 0 0 0] 38.34 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010018 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 4.96297 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 591.077 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233791 max: 1.70422 velocity magnitude: 0.852109 +DILUPBiCG: Solving for Ux, Initial residual = 3.15539e-05, Final residual = 1.1144e-06, No Iterations 3 +DILUPBiCG: Solving for Uy, Initial residual = 6.58072e-05, Final residual = 6.48167e-06, No Iterations 3 +DICPCG: Solving for p, Initial residual = 0.000164491, Final residual = 5.87135e-07, No Iterations 24 +time step continuity errors : sum local = 1.00558e-08, global = -2.29625e-19, cumulative = 3.22135e-18 +DICPCG: Solving for p, Initial residual = 0.000130599, Final residual = 9.81702e-07, No Iterations 23 +time step continuity errors : sum local = 1.67585e-08, global = -1.06888e-18, cumulative = 2.15247e-18 +ExecutionTime = 0.46 s ClockTime = 1 s + +Time = 0.19 + +Moving p index to 19... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 4.93185 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 524.505 +Ad = Ad [0 0 0 0 0 0 0] 38.35 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010019 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 5.23869 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 591.647 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233814 max: 1.70424 velocity magnitude: 0.852118 +DILUPBiCG: Solving for Ux, Initial residual = 2.40382e-05, Final residual = 7.26458e-07, No Iterations 3 +DILUPBiCG: Solving for Uy, Initial residual = 4.64734e-05, Final residual = 8.34047e-06, No Iterations 2 +DICPCG: Solving for p, Initial residual = 0.000137099, Final residual = 9.18422e-07, No Iterations 18 +time step continuity errors : sum local = 2.14501e-08, global = -1.07848e-18, cumulative = 1.07399e-18 +DICPCG: Solving for p, Initial residual = 0.000108256, Final residual = 9.6813e-07, No Iterations 16 +time step continuity errors : sum local = 1.7575e-08, global = -9.67801e-20, cumulative = 9.7721e-19 +ExecutionTime = 0.48 s ClockTime = 1 s + +Time = 0.2 + +Moving p index to 20... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 5.08616 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 524.635 +Ad = Ad [0 0 0 0 0 0 0] 38.36 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.01002 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 5.51441 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 592.217 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233829 max: 1.70425 velocity magnitude: 0.852124 +DILUPBiCG: Solving for Ux, Initial residual = 1.91765e-05, Final residual = 3.14833e-06, No Iterations 2 +DILUPBiCG: Solving for Uy, Initial residual = 3.44636e-05, Final residual = 6.16516e-06, No Iterations 2 +DICPCG: Solving for p, Initial residual = 0.000142509, Final residual = 6.7399e-07, No Iterations 24 +time step continuity errors : sum local = 1.15301e-08, global = -2.70819e-19, cumulative = 7.06391e-19 +DICPCG: Solving for p, Initial residual = 0.000114909, Final residual = 5.05187e-07, No Iterations 24 +time step continuity errors : sum local = 8.65079e-09, global = -2.88355e-19, cumulative = 4.18036e-19 +ExecutionTime = 0.51 s ClockTime = 1 s + +Time = 0.21 + +Moving p index to 21... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 5.24047 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 524.765 +Ad = Ad [0 0 0 0 0 0 0] 38.37 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010021 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 5.79013 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 592.787 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.23384 max: 1.70426 velocity magnitude: 0.852128 +DILUPBiCG: Solving for Ux, Initial residual = 1.49147e-05, Final residual = 1.40638e-06, No Iterations 2 +DILUPBiCG: Solving for Uy, Initial residual = 2.91358e-05, Final residual = 4.51047e-06, No Iterations 2 +DICPCG: Solving for p, Initial residual = 0.000112109, Final residual = 5.52778e-07, No Iterations 24 +time step continuity errors : sum local = 9.46135e-09, global = 8.36941e-19, cumulative = 1.25498e-18 +DICPCG: Solving for p, Initial residual = 8.7367e-05, Final residual = 4.14559e-07, No Iterations 24 +time step continuity errors : sum local = 7.10321e-09, global = -1.70896e-18, cumulative = -4.53977e-19 +ExecutionTime = 0.54 s ClockTime = 1 s + +Time = 0.22 + +Moving p index to 22... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 5.39478 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 524.895 +Ad = Ad [0 0 0 0 0 0 0] 38.38 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010022 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 6.06585 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 593.357 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233846 max: 1.70426 velocity magnitude: 0.852131 +DILUPBiCG: Solving for Ux, Initial residual = 1.35049e-05, Final residual = 1.32916e-06, No Iterations 2 +DILUPBiCG: Solving for Uy, Initial residual = 2.43295e-05, Final residual = 3.16036e-06, No Iterations 2 +DICPCG: Solving for p, Initial residual = 0.000110479, Final residual = 5.8499e-07, No Iterations 24 +time step continuity errors : sum local = 1.0035e-08, global = -1.89987e-18, cumulative = -2.35385e-18 +DICPCG: Solving for p, Initial residual = 8.59878e-05, Final residual = 4.3554e-07, No Iterations 24 +time step continuity errors : sum local = 7.47543e-09, global = -1.3665e-18, cumulative = -3.72035e-18 +ExecutionTime = 0.56 s ClockTime = 1 s + +Time = 0.23 + +Moving p index to 23... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 5.54909 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 525.025 +Ad = Ad [0 0 0 0 0 0 0] 38.39 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010023 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 6.34157 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 593.927 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.23385 max: 1.70426 velocity magnitude: 0.852132 +DILUPBiCG: Solving for Ux, Initial residual = 1.21645e-05, Final residual = 1.35615e-06, No Iterations 2 +DILUPBiCG: Solving for Uy, Initial residual = 2.27789e-05, Final residual = 2.00117e-06, No Iterations 2 +DICPCG: Solving for p, Initial residual = 0.000105374, Final residual = 5.56894e-07, No Iterations 24 +time step continuity errors : sum local = 9.54349e-09, global = 1.0439e-18, cumulative = -2.67645e-18 +DICPCG: Solving for p, Initial residual = 8.10236e-05, Final residual = 4.12499e-07, No Iterations 24 +time step continuity errors : sum local = 7.07586e-09, global = 2.106e-19, cumulative = -2.46585e-18 +ExecutionTime = 0.58 s ClockTime = 1 s + +Time = 0.24 + +Moving p index to 24... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 5.70339 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 525.155 +Ad = Ad [0 0 0 0 0 0 0] 38.4 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010024 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 6.61729 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 594.497 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233853 max: 1.70427 velocity magnitude: 0.852133 +DILUPBiCG: Solving for Ux, Initial residual = 1.14376e-05, Final residual = 1.38145e-06, No Iterations 2 +DILUPBiCG: Solving for Uy, Initial residual = 2.23563e-05, Final residual = 2.18639e-06, No Iterations 2 +DICPCG: Solving for p, Initial residual = 0.000102807, Final residual = 5.43654e-07, No Iterations 24 +time step continuity errors : sum local = 9.31635e-09, global = 1.05681e-18, cumulative = -1.40904e-18 +DICPCG: Solving for p, Initial residual = 7.84452e-05, Final residual = 9.84023e-07, No Iterations 23 +time step continuity errors : sum local = 1.68273e-08, global = 6.68858e-19, cumulative = -7.40182e-19 +ExecutionTime = 0.6 s ClockTime = 1 s + +Time = 0.25 + +Moving p index to 25... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 5.8577 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 525.285 +Ad = Ad [0 0 0 0 0 0 0] 38.41 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010025 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 6.89301 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 595.067 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233855 max: 1.70427 velocity magnitude: 0.852134 +DILUPBiCG: Solving for Ux, Initial residual = 1.09681e-05, Final residual = 1.41882e-06, No Iterations 2 +DILUPBiCG: Solving for Uy, Initial residual = 2.26966e-05, Final residual = 4.42931e-06, No Iterations 2 +DICPCG: Solving for p, Initial residual = 0.000101097, Final residual = 5.13595e-07, No Iterations 24 +time step continuity errors : sum local = 8.79767e-09, global = -2.51231e-18, cumulative = -3.25249e-18 +DICPCG: Solving for p, Initial residual = 7.63743e-05, Final residual = 9.38463e-07, No Iterations 23 +time step continuity errors : sum local = 1.60407e-08, global = -7.91943e-19, cumulative = -4.04444e-18 +ExecutionTime = 0.62 s ClockTime = 1 s + +Time = 0.26 + +Moving p index to 26... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 6.01201 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 525.415 +Ad = Ad [0 0 0 0 0 0 0] 38.42 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010026 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 7.16873 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 595.637 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233856 max: 1.70427 velocity magnitude: 0.852135 +DILUPBiCG: Solving for Ux, Initial residual = 1.06896e-05, Final residual = 1.45615e-06, No Iterations 2 +DILUPBiCG: Solving for Uy, Initial residual = 2.34574e-05, Final residual = 7.22144e-06, No Iterations 2 +DICPCG: Solving for p, Initial residual = 0.000100651, Final residual = 4.93519e-07, No Iterations 24 +time step continuity errors : sum local = 8.45355e-09, global = -3.77178e-18, cumulative = -7.81622e-18 +DICPCG: Solving for p, Initial residual = 7.56163e-05, Final residual = 9.0138e-07, No Iterations 23 +time step continuity errors : sum local = 1.54055e-08, global = -1.35492e-19, cumulative = -7.95171e-18 +ExecutionTime = 0.64 s ClockTime = 1 s + +Time = 0.27 + +Moving p index to 27... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 6.16632 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 525.545 +Ad = Ad [0 0 0 0 0 0 0] 38.43 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010027 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 7.44446 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 596.207 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233857 max: 1.70427 velocity magnitude: 0.852136 +DILUPBiCG: Solving for Ux, Initial residual = 1.06061e-05, Final residual = 9.96445e-06, No Iterations 1 +DILUPBiCG: Solving for Uy, Initial residual = 2.45016e-05, Final residual = 1.34963e-06, No Iterations 3 +DICPCG: Solving for p, Initial residual = 0.000139181, Final residual = 7.44327e-07, No Iterations 24 +time step continuity errors : sum local = 1.27595e-08, global = -5.1401e-19, cumulative = -8.46572e-18 +DICPCG: Solving for p, Initial residual = 0.000111618, Final residual = 5.8629e-07, No Iterations 24 +time step continuity errors : sum local = 1.00614e-08, global = 3.91918e-19, cumulative = -8.0738e-18 +ExecutionTime = 0.66 s ClockTime = 1 s + +Time = 0.28 + +Moving p index to 28... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 6.32063 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 525.675 +Ad = Ad [0 0 0 0 0 0 0] 38.44 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010028 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 7.72018 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 596.777 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233858 max: 1.70427 velocity magnitude: 0.852136 +DILUPBiCG: Solving for Ux, Initial residual = 9.9815e-06, Final residual = 9.9815e-06, No Iterations 0 +DILUPBiCG: Solving for Uy, Initial residual = 2.56066e-05, Final residual = 7.16223e-06, No Iterations 2 +DICPCG: Solving for p, Initial residual = 7.69103e-05, Final residual = 8.31322e-07, No Iterations 12 +time step continuity errors : sum local = 2.10947e-08, global = -7.6233e-19, cumulative = -8.83613e-18 +DICPCG: Solving for p, Initial residual = 4.63569e-05, Final residual = 8.92534e-07, No Iterations 11 +time step continuity errors : sum local = 1.64036e-08, global = -2.84385e-19, cumulative = -9.12051e-18 +ExecutionTime = 0.68 s ClockTime = 1 s + +Time = 0.29 + +Moving p index to 29... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 6.47493 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 525.805 +Ad = Ad [0 0 0 0 0 0 0] 38.45 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010029 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 7.9959 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 597.347 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233857 max: 1.70427 velocity magnitude: 0.852136 +DILUPBiCG: Solving for Ux, Initial residual = 1.23244e-05, Final residual = 7.98139e-06, No Iterations 1 +DILUPBiCG: Solving for Uy, Initial residual = 2.43003e-05, Final residual = 6.9121e-06, No Iterations 1 +DICPCG: Solving for p, Initial residual = 0.000154198, Final residual = 6.68257e-07, No Iterations 24 +time step continuity errors : sum local = 1.14736e-08, global = -1.99963e-18, cumulative = -1.11201e-17 +DICPCG: Solving for p, Initial residual = 0.000118736, Final residual = 5.0479e-07, No Iterations 24 +time step continuity errors : sum local = 8.68328e-09, global = -9.52085e-19, cumulative = -1.20722e-17 +ExecutionTime = 0.71 s ClockTime = 1 s + +Time = 0.3 + +Moving p index to 30... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 6.62924 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 525.935 +Ad = Ad [0 0 0 0 0 0 0] 38.46 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.01003 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 8.27162 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 597.917 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233859 max: 1.70427 velocity magnitude: 0.852137 +DILUPBiCG: Solving for Ux, Initial residual = 1.00212e-05, Final residual = 1.31625e-06, No Iterations 2 +DILUPBiCG: Solving for Uy, Initial residual = 2.51639e-05, Final residual = 7.92632e-06, No Iterations 2 +DICPCG: Solving for p, Initial residual = 9.51516e-05, Final residual = 4.33567e-07, No Iterations 24 +time step continuity errors : sum local = 7.42502e-09, global = 2.4104e-19, cumulative = -1.18312e-17 +DICPCG: Solving for p, Initial residual = 7.2261e-05, Final residual = 7.80594e-07, No Iterations 23 +time step continuity errors : sum local = 1.33379e-08, global = -6.5612e-19, cumulative = -1.24873e-17 +ExecutionTime = 0.74 s ClockTime = 1 s + +Time = 0.31 + +Moving p index to 31... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 6.78355 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 526.065 +Ad = Ad [0 0 0 0 0 0 0] 38.47 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010031 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 8.54734 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 598.487 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233859 max: 1.70427 velocity magnitude: 0.852137 +DILUPBiCG: Solving for Ux, Initial residual = 1.06935e-05, Final residual = 8.41088e-06, No Iterations 1 +DILUPBiCG: Solving for Uy, Initial residual = 2.55959e-05, Final residual = 9.53806e-06, No Iterations 1 +DICPCG: Solving for p, Initial residual = 0.000140761, Final residual = 6.02978e-07, No Iterations 24 +time step continuity errors : sum local = 1.03339e-08, global = 1.8514e-18, cumulative = -1.06359e-17 +DICPCG: Solving for p, Initial residual = 0.000109401, Final residual = 4.55244e-07, No Iterations 24 +time step continuity errors : sum local = 7.81418e-09, global = -1.46461e-18, cumulative = -1.21005e-17 +ExecutionTime = 0.76 s ClockTime = 1 s + +Time = 0.32 + +Moving p index to 32... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 6.93786 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 526.195 +Ad = Ad [0 0 0 0 0 0 0] 38.48 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010032 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 8.82306 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 599.057 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.23386 max: 1.70428 velocity magnitude: 0.852138 +DILUPBiCG: Solving for Ux, Initial residual = 1.01805e-05, Final residual = 1.39733e-06, No Iterations 2 +DILUPBiCG: Solving for Uy, Initial residual = 2.76532e-05, Final residual = 1.5962e-06, No Iterations 3 +DICPCG: Solving for p, Initial residual = 0.00010114, Final residual = 5.63167e-07, No Iterations 24 +time step continuity errors : sum local = 9.65348e-09, global = -2.30188e-18, cumulative = -1.44024e-17 +DICPCG: Solving for p, Initial residual = 7.93505e-05, Final residual = 9.5282e-07, No Iterations 23 +time step continuity errors : sum local = 1.63039e-08, global = -6.64557e-19, cumulative = -1.5067e-17 +ExecutionTime = 0.78 s ClockTime = 1 s + +Time = 0.33 + +Moving p index to 33... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 7.09217 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 526.325 +Ad = Ad [0 0 0 0 0 0 0] 38.49 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010033 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 9.09878 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 599.627 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233859 max: 1.70427 velocity magnitude: 0.852136 +DILUPBiCG: Solving for Ux, Initial residual = 1.055e-05, Final residual = 7.45796e-06, No Iterations 1 +DILUPBiCG: Solving for Uy, Initial residual = 2.48608e-05, Final residual = 8.75212e-06, No Iterations 1 +DICPCG: Solving for p, Initial residual = 0.000129175, Final residual = 5.08864e-07, No Iterations 24 +time step continuity errors : sum local = 8.72486e-09, global = -1.46295e-18, cumulative = -1.65299e-17 +DICPCG: Solving for p, Initial residual = 9.73802e-05, Final residual = 3.88992e-07, No Iterations 24 +time step continuity errors : sum local = 6.67783e-09, global = 2.05108e-18, cumulative = -1.44788e-17 +ExecutionTime = 0.8 s ClockTime = 1 s + +Time = 0.34 + +Moving p index to 34... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 7.24647 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 526.455 +Ad = Ad [0 0 0 0 0 0 0] 38.5 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010034 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 9.3745 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 600.197 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.23386 max: 1.70428 velocity magnitude: 0.852138 +DILUPBiCG: Solving for Ux, Initial residual = 1.03495e-05, Final residual = 1.39857e-06, No Iterations 2 +DILUPBiCG: Solving for Uy, Initial residual = 2.73181e-05, Final residual = 1.53211e-06, No Iterations 3 +DICPCG: Solving for p, Initial residual = 0.00010263, Final residual = 5.93843e-07, No Iterations 24 +time step continuity errors : sum local = 1.01783e-08, global = 2.14289e-18, cumulative = -1.23359e-17 +DICPCG: Solving for p, Initial residual = 8.05563e-05, Final residual = 9.95561e-07, No Iterations 23 +time step continuity errors : sum local = 1.70372e-08, global = 2.77767e-19, cumulative = -1.20582e-17 +ExecutionTime = 0.82 s ClockTime = 1 s + +Time = 0.35 + +Moving p index to 35... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 7.40078 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 526.585 +Ad = Ad [0 0 0 0 0 0 0] 38.51 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010035 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 9.65022 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 600.767 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233859 max: 1.70427 velocity magnitude: 0.852136 +DILUPBiCG: Solving for Ux, Initial residual = 1.05243e-05, Final residual = 7.63003e-06, No Iterations 1 +DILUPBiCG: Solving for Uy, Initial residual = 2.4688e-05, Final residual = 9.0102e-06, No Iterations 1 +DICPCG: Solving for p, Initial residual = 0.000129707, Final residual = 5.03164e-07, No Iterations 24 +time step continuity errors : sum local = 8.62691e-09, global = 5.60001e-19, cumulative = -1.14982e-17 +DICPCG: Solving for p, Initial residual = 9.79878e-05, Final residual = 3.87893e-07, No Iterations 24 +time step continuity errors : sum local = 6.65755e-09, global = -5.16822e-19, cumulative = -1.2015e-17 +ExecutionTime = 0.85 s ClockTime = 1 s + +Time = 0.36 + +Moving p index to 36... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 7.55509 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 526.715 +Ad = Ad [0 0 0 0 0 0 0] 38.52 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010036 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 9.92594 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 601.337 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.23386 max: 1.70428 velocity magnitude: 0.852138 +DILUPBiCG: Solving for Ux, Initial residual = 1.03409e-05, Final residual = 1.3919e-06, No Iterations 2 +DILUPBiCG: Solving for Uy, Initial residual = 2.73717e-05, Final residual = 1.54077e-06, No Iterations 3 +DICPCG: Solving for p, Initial residual = 0.000102473, Final residual = 5.97345e-07, No Iterations 24 +time step continuity errors : sum local = 1.02378e-08, global = -2.37053e-18, cumulative = -1.43855e-17 +DICPCG: Solving for p, Initial residual = 8.04774e-05, Final residual = 9.9965e-07, No Iterations 23 +time step continuity errors : sum local = 1.71068e-08, global = 6.41727e-19, cumulative = -1.37438e-17 +ExecutionTime = 0.87 s ClockTime = 1 s + +Time = 0.37 + +Moving p index to 37... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 7.7094 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 526.845 +Ad = Ad [0 0 0 0 0 0 0] 38.53 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010037 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 10.2017 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 601.907 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233859 max: 1.70427 velocity magnitude: 0.852136 +DILUPBiCG: Solving for Ux, Initial residual = 1.05225e-05, Final residual = 7.63311e-06, No Iterations 1 +DILUPBiCG: Solving for Uy, Initial residual = 2.46815e-05, Final residual = 8.9904e-06, No Iterations 1 +DICPCG: Solving for p, Initial residual = 0.000129707, Final residual = 5.04275e-07, No Iterations 24 +time step continuity errors : sum local = 8.64563e-09, global = 2.43853e-18, cumulative = -1.13053e-17 +DICPCG: Solving for p, Initial residual = 9.79724e-05, Final residual = 3.89046e-07, No Iterations 24 +time step continuity errors : sum local = 6.67693e-09, global = -7.7755e-21, cumulative = -1.1313e-17 +ExecutionTime = 0.89 s ClockTime = 1 s + +Time = 0.38 + +Moving p index to 38... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 7.86371 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 526.975 +Ad = Ad [0 0 0 0 0 0 0] 38.54 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010038 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 10.4774 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 602.477 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.23386 max: 1.70428 velocity magnitude: 0.852138 +DILUPBiCG: Solving for Ux, Initial residual = 1.03385e-05, Final residual = 1.3904e-06, No Iterations 2 +DILUPBiCG: Solving for Uy, Initial residual = 2.73616e-05, Final residual = 1.54145e-06, No Iterations 3 +DICPCG: Solving for p, Initial residual = 0.000102427, Final residual = 5.97549e-07, No Iterations 24 +time step continuity errors : sum local = 1.02411e-08, global = 1.33838e-19, cumulative = -1.11792e-17 +DICPCG: Solving for p, Initial residual = 8.04475e-05, Final residual = 9.99861e-07, No Iterations 23 +time step continuity errors : sum local = 1.71102e-08, global = -3.50344e-18, cumulative = -1.46826e-17 +ExecutionTime = 0.92 s ClockTime = 1 s + +Time = 0.39 + +Moving p index to 39... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 8.01801 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 527.105 +Ad = Ad [0 0 0 0 0 0 0] 38.55 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010039 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 10.7531 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 603.047 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233859 max: 1.70427 velocity magnitude: 0.852136 +DILUPBiCG: Solving for Ux, Initial residual = 1.05211e-05, Final residual = 7.6389e-06, No Iterations 1 +DILUPBiCG: Solving for Uy, Initial residual = 2.46745e-05, Final residual = 8.97564e-06, No Iterations 1 +DICPCG: Solving for p, Initial residual = 0.000129743, Final residual = 5.0487e-07, No Iterations 24 +time step continuity errors : sum local = 8.65579e-09, global = -6.73656e-19, cumulative = -1.53563e-17 +DICPCG: Solving for p, Initial residual = 9.80089e-05, Final residual = 3.89566e-07, No Iterations 24 +time step continuity errors : sum local = 6.68582e-09, global = 1.03083e-18, cumulative = -1.43255e-17 +ExecutionTime = 0.94 s ClockTime = 1 s + +Time = 0.4 + +Moving p index to 40... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 8.17232 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 527.235 +Ad = Ad [0 0 0 0 0 0 0] 38.56 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.01004 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 11.0288 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 603.617 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.23386 max: 1.70428 velocity magnitude: 0.852138 +DILUPBiCG: Solving for Ux, Initial residual = 1.03359e-05, Final residual = 1.38976e-06, No Iterations 2 +DILUPBiCG: Solving for Uy, Initial residual = 2.73554e-05, Final residual = 1.54186e-06, No Iterations 3 +DICPCG: Solving for p, Initial residual = 0.0001024, Final residual = 5.9741e-07, No Iterations 24 +time step continuity errors : sum local = 1.02386e-08, global = -9.501e-19, cumulative = -1.52756e-17 +DICPCG: Solving for p, Initial residual = 8.04296e-05, Final residual = 9.99607e-07, No Iterations 23 +time step continuity errors : sum local = 1.71058e-08, global = -1.65304e-18, cumulative = -1.69286e-17 +ExecutionTime = 0.97 s ClockTime = 1 s + +Time = 0.41 + +Moving p index to 41... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 8.32663 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 527.365 +Ad = Ad [0 0 0 0 0 0 0] 38.57 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010041 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 11.3045 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 604.187 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233859 max: 1.70427 velocity magnitude: 0.852136 +DILUPBiCG: Solving for Ux, Initial residual = 1.05195e-05, Final residual = 7.64105e-06, No Iterations 1 +DILUPBiCG: Solving for Uy, Initial residual = 2.46701e-05, Final residual = 8.96839e-06, No Iterations 1 +DICPCG: Solving for p, Initial residual = 0.00012975, Final residual = 5.05058e-07, No Iterations 24 +time step continuity errors : sum local = 8.65902e-09, global = 1.61399e-18, cumulative = -1.53146e-17 +DICPCG: Solving for p, Initial residual = 9.80187e-05, Final residual = 3.89728e-07, No Iterations 24 +time step continuity errors : sum local = 6.6886e-09, global = -5.82335e-19, cumulative = -1.58969e-17 +ExecutionTime = 0.99 s ClockTime = 1 s + +Time = 0.42 + +Moving p index to 42... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 8.48094 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 527.495 +Ad = Ad [0 0 0 0 0 0 0] 38.58 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010042 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 11.5803 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 604.757 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.23386 max: 1.70428 velocity magnitude: 0.852138 +DILUPBiCG: Solving for Ux, Initial residual = 1.03339e-05, Final residual = 1.38949e-06, No Iterations 2 +DILUPBiCG: Solving for Uy, Initial residual = 2.7351e-05, Final residual = 1.54221e-06, No Iterations 3 +DICPCG: Solving for p, Initial residual = 0.000102382, Final residual = 5.97283e-07, No Iterations 24 +time step continuity errors : sum local = 1.02365e-08, global = -2.92326e-19, cumulative = -1.61893e-17 +DICPCG: Solving for p, Initial residual = 8.04176e-05, Final residual = 9.99385e-07, No Iterations 23 +time step continuity errors : sum local = 1.7102e-08, global = -2.4832e-19, cumulative = -1.64376e-17 +ExecutionTime = 1 s ClockTime = 1 s + +Time = 0.43 + +Moving p index to 43... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 8.63525 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 527.625 +Ad = Ad [0 0 0 0 0 0 0] 38.59 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010043 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 11.856 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 605.327 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233859 max: 1.70427 velocity magnitude: 0.852137 +DILUPBiCG: Solving for Ux, Initial residual = 1.05178e-05, Final residual = 7.64237e-06, No Iterations 1 +DILUPBiCG: Solving for Uy, Initial residual = 2.46665e-05, Final residual = 8.96536e-06, No Iterations 1 +DICPCG: Solving for p, Initial residual = 0.000129747, Final residual = 5.05093e-07, No Iterations 24 +time step continuity errors : sum local = 8.65963e-09, global = -1.48032e-18, cumulative = -1.79179e-17 +DICPCG: Solving for p, Initial residual = 9.80202e-05, Final residual = 3.89769e-07, No Iterations 24 +time step continuity errors : sum local = 6.68931e-09, global = -3.19953e-19, cumulative = -1.82379e-17 +ExecutionTime = 1.02 s ClockTime = 2 s + +Time = 0.44 + +Moving p index to 44... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 8.78955 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 527.755 +Ad = Ad [0 0 0 0 0 0 0] 38.6 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010044 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 12.1317 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 605.897 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.23386 max: 1.70428 velocity magnitude: 0.852138 +DILUPBiCG: Solving for Ux, Initial residual = 1.03319e-05, Final residual = 1.38934e-06, No Iterations 2 +DILUPBiCG: Solving for Uy, Initial residual = 2.73477e-05, Final residual = 1.5426e-06, No Iterations 3 +DICPCG: Solving for p, Initial residual = 0.000102366, Final residual = 5.97179e-07, No Iterations 24 +time step continuity errors : sum local = 1.02347e-08, global = 4.58258e-20, cumulative = -1.8192e-17 +DICPCG: Solving for p, Initial residual = 8.04074e-05, Final residual = 9.992e-07, No Iterations 23 +time step continuity errors : sum local = 1.70988e-08, global = 9.82691e-19, cumulative = -1.72093e-17 +ExecutionTime = 1.05 s ClockTime = 2 s + +Time = 0.45 + +Moving p index to 45... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 8.94386 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 527.885 +Ad = Ad [0 0 0 0 0 0 0] 38.61 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010045 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 12.4074 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 606.467 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233859 max: 1.70427 velocity magnitude: 0.852137 +DILUPBiCG: Solving for Ux, Initial residual = 1.0516e-05, Final residual = 7.6434e-06, No Iterations 1 +DILUPBiCG: Solving for Uy, Initial residual = 2.46633e-05, Final residual = 8.96398e-06, No Iterations 1 +DICPCG: Solving for p, Initial residual = 0.000129742, Final residual = 5.05075e-07, No Iterations 24 +time step continuity errors : sum local = 8.65933e-09, global = 8.73337e-19, cumulative = -1.6336e-17 +DICPCG: Solving for p, Initial residual = 9.80188e-05, Final residual = 3.8977e-07, No Iterations 24 +time step continuity errors : sum local = 6.68934e-09, global = 7.73745e-19, cumulative = -1.55623e-17 +ExecutionTime = 1.07 s ClockTime = 2 s + +Time = 0.46 + +Moving p index to 46... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 9.09817 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 528.015 +Ad = Ad [0 0 0 0 0 0 0] 38.62 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010046 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 12.6831 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 607.037 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.23386 max: 1.70428 velocity magnitude: 0.852139 +DILUPBiCG: Solving for Ux, Initial residual = 1.033e-05, Final residual = 1.38923e-06, No Iterations 2 +DILUPBiCG: Solving for Uy, Initial residual = 2.73449e-05, Final residual = 1.54301e-06, No Iterations 3 +DICPCG: Solving for p, Initial residual = 0.000102351, Final residual = 5.97085e-07, No Iterations 24 +time step continuity errors : sum local = 1.02331e-08, global = -1.99599e-18, cumulative = -1.75583e-17 +DICPCG: Solving for p, Initial residual = 8.03978e-05, Final residual = 9.99031e-07, No Iterations 23 +time step continuity errors : sum local = 1.70959e-08, global = 1.13638e-18, cumulative = -1.64219e-17 +ExecutionTime = 1.09 s ClockTime = 2 s + +Time = 0.47 + +Moving p index to 47... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 9.25248 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 528.145 +Ad = Ad [0 0 0 0 0 0 0] 38.63 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010047 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 12.9589 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 607.607 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233859 max: 1.70427 velocity magnitude: 0.852137 +DILUPBiCG: Solving for Ux, Initial residual = 1.05143e-05, Final residual = 7.64432e-06, No Iterations 1 +DILUPBiCG: Solving for Uy, Initial residual = 2.46603e-05, Final residual = 8.96323e-06, No Iterations 1 +DICPCG: Solving for p, Initial residual = 0.000129735, Final residual = 5.05039e-07, No Iterations 24 +time step continuity errors : sum local = 8.65872e-09, global = -1.1023e-18, cumulative = -1.75242e-17 +DICPCG: Solving for p, Initial residual = 9.80165e-05, Final residual = 3.89758e-07, No Iterations 24 +time step continuity errors : sum local = 6.68915e-09, global = 1.26691e-18, cumulative = -1.62573e-17 +ExecutionTime = 1.11 s ClockTime = 2 s + +Time = 0.48 + +Moving p index to 48... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 9.40679 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 528.275 +Ad = Ad [0 0 0 0 0 0 0] 38.64 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010048 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 13.2346 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 608.177 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.23386 max: 1.70428 velocity magnitude: 0.852139 +DILUPBiCG: Solving for Ux, Initial residual = 1.03282e-05, Final residual = 1.38913e-06, No Iterations 2 +DILUPBiCG: Solving for Uy, Initial residual = 2.73424e-05, Final residual = 1.54344e-06, No Iterations 3 +DICPCG: Solving for p, Initial residual = 0.000102336, Final residual = 5.96995e-07, No Iterations 24 +time step continuity errors : sum local = 1.02316e-08, global = 1.34417e-18, cumulative = -1.49131e-17 +DICPCG: Solving for p, Initial residual = 8.03884e-05, Final residual = 9.98869e-07, No Iterations 23 +time step continuity errors : sum local = 1.70932e-08, global = 3.07364e-18, cumulative = -1.18395e-17 +ExecutionTime = 1.14 s ClockTime = 2 s + +Time = 0.49 + +Moving p index to 49... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 9.5611 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 528.405 +Ad = Ad [0 0 0 0 0 0 0] 38.65 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010049 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 13.5103 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 608.747 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233859 max: 1.70427 velocity magnitude: 0.852137 +DILUPBiCG: Solving for Ux, Initial residual = 1.05125e-05, Final residual = 7.64521e-06, No Iterations 1 +DILUPBiCG: Solving for Uy, Initial residual = 2.46573e-05, Final residual = 8.96269e-06, No Iterations 1 +DICPCG: Solving for p, Initial residual = 0.000129728, Final residual = 5.04996e-07, No Iterations 24 +time step continuity errors : sum local = 8.65801e-09, global = -1.9131e-18, cumulative = -1.37526e-17 +DICPCG: Solving for p, Initial residual = 9.80139e-05, Final residual = 3.89741e-07, No Iterations 24 +time step continuity errors : sum local = 6.68887e-09, global = 9.35541e-19, cumulative = -1.2817e-17 +ExecutionTime = 1.16 s ClockTime = 2 s + +Time = 0.5 + +Moving p index to 50... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 9.7154 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 528.535 +Ad = Ad [0 0 0 0 0 0 0] 38.66 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.01005 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 13.786 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 609.318 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.23386 max: 1.70428 velocity magnitude: 0.852139 +DILUPBiCG: Solving for Ux, Initial residual = 1.03263e-05, Final residual = 1.38904e-06, No Iterations 2 +DILUPBiCG: Solving for Uy, Initial residual = 2.73399e-05, Final residual = 1.54386e-06, No Iterations 3 +DICPCG: Solving for p, Initial residual = 0.000102322, Final residual = 5.96907e-07, No Iterations 24 +time step continuity errors : sum local = 1.02301e-08, global = -1.81649e-19, cumulative = -1.29987e-17 +DICPCG: Solving for p, Initial residual = 8.03791e-05, Final residual = 9.98709e-07, No Iterations 23 +time step continuity errors : sum local = 1.70904e-08, global = 7.84167e-20, cumulative = -1.29203e-17 +ExecutionTime = 1.19 s ClockTime = 2 s + +Time = 0.51 + +Moving p index to 51... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 9.86971 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 528.665 +Ad = Ad [0 0 0 0 0 0 0] 38.67 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010051 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 14.0617 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 609.888 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233859 max: 1.70427 velocity magnitude: 0.852137 +DILUPBiCG: Solving for Ux, Initial residual = 1.05107e-05, Final residual = 7.64608e-06, No Iterations 1 +DILUPBiCG: Solving for Uy, Initial residual = 2.46545e-05, Final residual = 8.96224e-06, No Iterations 1 +DICPCG: Solving for p, Initial residual = 0.00012972, Final residual = 5.04952e-07, No Iterations 24 +time step continuity errors : sum local = 8.65726e-09, global = -2.01286e-18, cumulative = -1.49331e-17 +DICPCG: Solving for p, Initial residual = 9.80111e-05, Final residual = 3.89723e-07, No Iterations 24 +time step continuity errors : sum local = 6.68858e-09, global = -1.96075e-18, cumulative = -1.68939e-17 +ExecutionTime = 1.21 s ClockTime = 2 s + +Time = 0.52 + +Moving p index to 52... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 10.024 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 528.795 +Ad = Ad [0 0 0 0 0 0 0] 38.68 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010052 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 14.3375 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 610.458 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233861 max: 1.70428 velocity magnitude: 0.852139 +DILUPBiCG: Solving for Ux, Initial residual = 1.03244e-05, Final residual = 1.38895e-06, No Iterations 2 +DILUPBiCG: Solving for Uy, Initial residual = 2.73375e-05, Final residual = 1.54429e-06, No Iterations 3 +DICPCG: Solving for p, Initial residual = 0.000102307, Final residual = 5.9682e-07, No Iterations 24 +time step continuity errors : sum local = 1.02286e-08, global = 6.51984e-19, cumulative = -1.62419e-17 +DICPCG: Solving for p, Initial residual = 8.03699e-05, Final residual = 9.9855e-07, No Iterations 23 +time step continuity errors : sum local = 1.70877e-08, global = -8.48026e-19, cumulative = -1.70899e-17 +ExecutionTime = 1.23 s ClockTime = 2 s + +Time = 0.53 + +Moving p index to 53... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 10.1783 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 528.925 +Ad = Ad [0 0 0 0 0 0 0] 38.69 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010053 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 14.6132 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 611.028 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.23386 max: 1.70427 velocity magnitude: 0.852137 +DILUPBiCG: Solving for Ux, Initial residual = 1.05089e-05, Final residual = 7.64694e-06, No Iterations 1 +DILUPBiCG: Solving for Uy, Initial residual = 2.46516e-05, Final residual = 8.9618e-06, No Iterations 1 +DICPCG: Solving for p, Initial residual = 0.000129713, Final residual = 5.04906e-07, No Iterations 24 +time step continuity errors : sum local = 8.65649e-09, global = -3.83481e-19, cumulative = -1.74734e-17 +DICPCG: Solving for p, Initial residual = 9.80083e-05, Final residual = 3.89705e-07, No Iterations 24 +time step continuity errors : sum local = 6.68827e-09, global = 1.63285e-18, cumulative = -1.58405e-17 +ExecutionTime = 1.26 s ClockTime = 2 s + +Time = 0.54 + +Moving p index to 54... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 10.3326 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 529.055 +Ad = Ad [0 0 0 0 0 0 0] 38.7 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010054 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 14.8889 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 611.598 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233861 max: 1.70428 velocity magnitude: 0.852139 +DILUPBiCG: Solving for Ux, Initial residual = 1.03226e-05, Final residual = 1.38886e-06, No Iterations 2 +DILUPBiCG: Solving for Uy, Initial residual = 2.73351e-05, Final residual = 1.54472e-06, No Iterations 3 +DICPCG: Solving for p, Initial residual = 0.000102292, Final residual = 5.96733e-07, No Iterations 24 +time step continuity errors : sum local = 1.02271e-08, global = 4.62559e-19, cumulative = -1.5378e-17 +DICPCG: Solving for p, Initial residual = 8.03606e-05, Final residual = 9.98391e-07, No Iterations 23 +time step continuity errors : sum local = 1.7085e-08, global = -9.5953e-19, cumulative = -1.63375e-17 +ExecutionTime = 1.28 s ClockTime = 2 s + +Time = 0.55 + +Moving p index to 55... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 10.4869 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 529.185 +Ad = Ad [0 0 0 0 0 0 0] 38.71 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010055 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 15.1646 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 612.168 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.23386 max: 1.70427 velocity magnitude: 0.852137 +DILUPBiCG: Solving for Ux, Initial residual = 1.05071e-05, Final residual = 7.64781e-06, No Iterations 1 +DILUPBiCG: Solving for Uy, Initial residual = 2.46488e-05, Final residual = 8.96138e-06, No Iterations 1 +DICPCG: Solving for p, Initial residual = 0.000129706, Final residual = 5.0486e-07, No Iterations 24 +time step continuity errors : sum local = 8.65572e-09, global = 5.47594e-20, cumulative = -1.62827e-17 +DICPCG: Solving for p, Initial residual = 9.80055e-05, Final residual = 3.89686e-07, No Iterations 24 +time step continuity errors : sum local = 6.68797e-09, global = -2.7694e-19, cumulative = -1.65597e-17 +ExecutionTime = 1.3 s ClockTime = 2 s + +Time = 0.56 + +Moving p index to 56... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 10.6413 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 529.315 +Ad = Ad [0 0 0 0 0 0 0] 38.72 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010056 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 15.4404 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 612.738 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233861 max: 1.70428 velocity magnitude: 0.852139 +DILUPBiCG: Solving for Ux, Initial residual = 1.03207e-05, Final residual = 1.38877e-06, No Iterations 2 +DILUPBiCG: Solving for Uy, Initial residual = 2.73327e-05, Final residual = 1.54514e-06, No Iterations 3 +DICPCG: Solving for p, Initial residual = 0.000102278, Final residual = 5.96646e-07, No Iterations 24 +time step continuity errors : sum local = 1.02256e-08, global = 9.53905e-19, cumulative = -1.56058e-17 +DICPCG: Solving for p, Initial residual = 8.03513e-05, Final residual = 9.98232e-07, No Iterations 23 +time step continuity errors : sum local = 1.70823e-08, global = 4.40391e-19, cumulative = -1.51654e-17 +ExecutionTime = 1.32 s ClockTime = 2 s + +Time = 0.57 + +Moving p index to 57... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 10.7956 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 529.445 +Ad = Ad [0 0 0 0 0 0 0] 38.73 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010057 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 15.7161 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 613.308 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.23386 max: 1.70427 velocity magnitude: 0.852137 +DILUPBiCG: Solving for Ux, Initial residual = 1.05053e-05, Final residual = 7.64867e-06, No Iterations 1 +DILUPBiCG: Solving for Uy, Initial residual = 2.46459e-05, Final residual = 8.96096e-06, No Iterations 1 +DICPCG: Solving for p, Initial residual = 0.000129699, Final residual = 5.04815e-07, No Iterations 24 +time step continuity errors : sum local = 8.65495e-09, global = 1.44442e-18, cumulative = -1.3721e-17 +DICPCG: Solving for p, Initial residual = 9.80028e-05, Final residual = 3.89668e-07, No Iterations 24 +time step continuity errors : sum local = 6.68766e-09, global = -4.67357e-19, cumulative = -1.41883e-17 +ExecutionTime = 1.34 s ClockTime = 2 s + +Time = 0.58 + +Moving p index to 58... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 10.9499 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 529.575 +Ad = Ad [0 0 0 0 0 0 0] 38.74 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010058 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 15.9918 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 613.878 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233861 max: 1.70428 velocity magnitude: 0.852139 +DILUPBiCG: Solving for Ux, Initial residual = 1.03188e-05, Final residual = 1.38868e-06, No Iterations 2 +DILUPBiCG: Solving for Uy, Initial residual = 2.73303e-05, Final residual = 1.54557e-06, No Iterations 3 +DICPCG: Solving for p, Initial residual = 0.000102263, Final residual = 5.96559e-07, No Iterations 24 +time step continuity errors : sum local = 1.02241e-08, global = -1.31803e-18, cumulative = -1.55063e-17 +DICPCG: Solving for p, Initial residual = 8.03421e-05, Final residual = 9.98074e-07, No Iterations 23 +time step continuity errors : sum local = 1.70796e-08, global = 1.56321e-18, cumulative = -1.39431e-17 +ExecutionTime = 1.37 s ClockTime = 2 s + +Time = 0.59 + +Moving p index to 59... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 11.1042 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 529.705 +Ad = Ad [0 0 0 0 0 0 0] 38.75 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010059 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 16.2675 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 614.448 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.23386 max: 1.70427 velocity magnitude: 0.852137 +DILUPBiCG: Solving for Ux, Initial residual = 1.05035e-05, Final residual = 7.64953e-06, No Iterations 1 +DILUPBiCG: Solving for Uy, Initial residual = 2.46431e-05, Final residual = 8.96054e-06, No Iterations 1 +DICPCG: Solving for p, Initial residual = 0.000129691, Final residual = 5.04769e-07, No Iterations 24 +time step continuity errors : sum local = 8.65418e-09, global = 3.92414e-19, cumulative = -1.35507e-17 +DICPCG: Solving for p, Initial residual = 9.8e-05, Final residual = 3.89649e-07, No Iterations 24 +time step continuity errors : sum local = 6.68735e-09, global = 4.30134e-20, cumulative = -1.35077e-17 +ExecutionTime = 1.39 s ClockTime = 2 s + +Time = 0.6 + +Moving p index to 60... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 11.2585 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 529.835 +Ad = Ad [0 0 0 0 0 0 0] 38.76 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.01006 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 16.5432 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 615.018 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233861 max: 1.70428 velocity magnitude: 0.852139 +DILUPBiCG: Solving for Ux, Initial residual = 1.0317e-05, Final residual = 1.38859e-06, No Iterations 2 +DILUPBiCG: Solving for Uy, Initial residual = 2.73279e-05, Final residual = 1.546e-06, No Iterations 3 +DICPCG: Solving for p, Initial residual = 0.000102249, Final residual = 5.96472e-07, No Iterations 24 +time step continuity errors : sum local = 1.02226e-08, global = -4.64876e-19, cumulative = -1.39726e-17 +DICPCG: Solving for p, Initial residual = 8.03329e-05, Final residual = 9.97916e-07, No Iterations 23 +time step continuity errors : sum local = 1.70769e-08, global = 3.52544e-19, cumulative = -1.362e-17 +ExecutionTime = 1.42 s ClockTime = 2 s + +Time = 0.61 + +Moving p index to 61... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 11.4128 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 529.965 +Ad = Ad [0 0 0 0 0 0 0] 38.77 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010061 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 16.819 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 615.588 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.23386 max: 1.70427 velocity magnitude: 0.852137 +DILUPBiCG: Solving for Ux, Initial residual = 1.05017e-05, Final residual = 7.6504e-06, No Iterations 1 +DILUPBiCG: Solving for Uy, Initial residual = 2.46403e-05, Final residual = 8.96012e-06, No Iterations 1 +DICPCG: Solving for p, Initial residual = 0.000129684, Final residual = 5.04723e-07, No Iterations 24 +time step continuity errors : sum local = 8.65341e-09, global = -2.28881e-18, cumulative = -1.59089e-17 +DICPCG: Solving for p, Initial residual = 9.79972e-05, Final residual = 3.8963e-07, No Iterations 24 +time step continuity errors : sum local = 6.68704e-09, global = 1.26906e-18, cumulative = -1.46398e-17 +ExecutionTime = 1.44 s ClockTime = 2 s + +Time = 0.62 + +Moving p index to 62... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 11.5671 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 530.095 +Ad = Ad [0 0 0 0 0 0 0] 38.78 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010062 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 17.0947 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 616.158 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233861 max: 1.70428 velocity magnitude: 0.852139 +DILUPBiCG: Solving for Ux, Initial residual = 1.03151e-05, Final residual = 1.3885e-06, No Iterations 2 +DILUPBiCG: Solving for Uy, Initial residual = 2.73255e-05, Final residual = 1.54643e-06, No Iterations 3 +DICPCG: Solving for p, Initial residual = 0.000102234, Final residual = 5.96385e-07, No Iterations 24 +time step continuity errors : sum local = 1.02211e-08, global = 7.44628e-19, cumulative = -1.38952e-17 +DICPCG: Solving for p, Initial residual = 8.03237e-05, Final residual = 9.97757e-07, No Iterations 23 +time step continuity errors : sum local = 1.70742e-08, global = -6.29981e-19, cumulative = -1.45251e-17 +ExecutionTime = 1.46 s ClockTime = 2 s + +Time = 0.63 + +Moving p index to 63... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 11.7214 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 530.225 +Ad = Ad [0 0 0 0 0 0 0] 38.79 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010063 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 17.3704 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 616.728 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.23386 max: 1.70428 velocity magnitude: 0.852138 +DILUPBiCG: Solving for Ux, Initial residual = 1.04999e-05, Final residual = 7.65126e-06, No Iterations 1 +DILUPBiCG: Solving for Uy, Initial residual = 2.46374e-05, Final residual = 8.9597e-06, No Iterations 1 +DICPCG: Solving for p, Initial residual = 0.000129677, Final residual = 5.04677e-07, No Iterations 24 +time step continuity errors : sum local = 8.65264e-09, global = 8.96498e-19, cumulative = -1.36286e-17 +DICPCG: Solving for p, Initial residual = 9.79944e-05, Final residual = 3.89612e-07, No Iterations 24 +time step continuity errors : sum local = 6.68673e-09, global = 6.96652e-19, cumulative = -1.2932e-17 +ExecutionTime = 1.49 s ClockTime = 2 s + +Time = 0.64 + +Moving p index to 64... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 11.8757 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 530.355 +Ad = Ad [0 0 0 0 0 0 0] 38.8 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010064 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 17.6461 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 617.298 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233861 max: 1.70428 velocity magnitude: 0.852139 +DILUPBiCG: Solving for Ux, Initial residual = 1.03133e-05, Final residual = 1.38841e-06, No Iterations 2 +DILUPBiCG: Solving for Uy, Initial residual = 2.73231e-05, Final residual = 1.54686e-06, No Iterations 3 +DICPCG: Solving for p, Initial residual = 0.000102219, Final residual = 5.96299e-07, No Iterations 24 +time step continuity errors : sum local = 1.02197e-08, global = -4.62725e-19, cumulative = -1.33947e-17 +DICPCG: Solving for p, Initial residual = 8.03145e-05, Final residual = 9.97599e-07, No Iterations 23 +time step continuity errors : sum local = 1.70715e-08, global = -5.66122e-19, cumulative = -1.39608e-17 +ExecutionTime = 1.51 s ClockTime = 2 s + +Time = 0.65 + +Moving p index to 65... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 12.03 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 530.485 +Ad = Ad [0 0 0 0 0 0 0] 38.81 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010065 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 17.9218 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 617.868 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.23386 max: 1.70428 velocity magnitude: 0.852138 +DILUPBiCG: Solving for Ux, Initial residual = 1.04982e-05, Final residual = 7.65212e-06, No Iterations 1 +DILUPBiCG: Solving for Uy, Initial residual = 2.46346e-05, Final residual = 8.95928e-06, No Iterations 1 +DICPCG: Solving for p, Initial residual = 0.00012967, Final residual = 5.04631e-07, No Iterations 24 +time step continuity errors : sum local = 8.65187e-09, global = -3.24867e-18, cumulative = -1.72095e-17 +DICPCG: Solving for p, Initial residual = 9.79916e-05, Final residual = 3.89593e-07, No Iterations 24 +time step continuity errors : sum local = 6.68642e-09, global = -6.32462e-19, cumulative = -1.7842e-17 +ExecutionTime = 1.53 s ClockTime = 2 s + +Time = 0.66 + +Moving p index to 66... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 12.1843 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 530.615 +Ad = Ad [0 0 0 0 0 0 0] 38.82 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010066 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 18.1976 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 618.438 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233861 max: 1.70428 velocity magnitude: 0.85214 +DILUPBiCG: Solving for Ux, Initial residual = 1.03114e-05, Final residual = 1.38832e-06, No Iterations 2 +DILUPBiCG: Solving for Uy, Initial residual = 2.73208e-05, Final residual = 1.54729e-06, No Iterations 3 +DICPCG: Solving for p, Initial residual = 0.000102205, Final residual = 5.96212e-07, No Iterations 24 +time step continuity errors : sum local = 1.02182e-08, global = -7.28581e-19, cumulative = -1.85706e-17 +DICPCG: Solving for p, Initial residual = 8.03052e-05, Final residual = 9.9744e-07, No Iterations 23 +time step continuity errors : sum local = 1.70688e-08, global = -3.99363e-19, cumulative = -1.89699e-17 +ExecutionTime = 1.55 s ClockTime = 2 s + +Time = 0.67 + +Moving p index to 67... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 12.3386 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 530.745 +Ad = Ad [0 0 0 0 0 0 0] 38.83 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010067 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 18.4733 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 619.008 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.23386 max: 1.70428 velocity magnitude: 0.852138 +DILUPBiCG: Solving for Ux, Initial residual = 1.04964e-05, Final residual = 7.65298e-06, No Iterations 1 +DILUPBiCG: Solving for Uy, Initial residual = 2.46318e-05, Final residual = 8.95886e-06, No Iterations 1 +DICPCG: Solving for p, Initial residual = 0.000129662, Final residual = 5.04586e-07, No Iterations 24 +time step continuity errors : sum local = 8.6511e-09, global = -1.57776e-18, cumulative = -2.05477e-17 +DICPCG: Solving for p, Initial residual = 9.79888e-05, Final residual = 3.89574e-07, No Iterations 24 +time step continuity errors : sum local = 6.68611e-09, global = -7.40988e-19, cumulative = -2.12887e-17 +ExecutionTime = 1.58 s ClockTime = 2 s + +Time = 0.68 + +Moving p index to 68... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 12.4929 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 530.875 +Ad = Ad [0 0 0 0 0 0 0] 38.84 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010068 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 18.749 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 619.578 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233861 max: 1.70428 velocity magnitude: 0.85214 +DILUPBiCG: Solving for Ux, Initial residual = 1.03095e-05, Final residual = 1.38823e-06, No Iterations 2 +DILUPBiCG: Solving for Uy, Initial residual = 2.73184e-05, Final residual = 1.54771e-06, No Iterations 3 +DICPCG: Solving for p, Initial residual = 0.00010219, Final residual = 5.96125e-07, No Iterations 24 +time step continuity errors : sum local = 1.02167e-08, global = -1.8954e-18, cumulative = -2.31841e-17 +DICPCG: Solving for p, Initial residual = 8.0296e-05, Final residual = 9.97282e-07, No Iterations 23 +time step continuity errors : sum local = 1.70661e-08, global = -4.19215e-19, cumulative = -2.36033e-17 +ExecutionTime = 1.6 s ClockTime = 2 s + +Time = 0.69 + +Moving p index to 69... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 12.6473 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 531.005 +Ad = Ad [0 0 0 0 0 0 0] 38.85 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010069 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 19.0247 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 620.148 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.23386 max: 1.70428 velocity magnitude: 0.852138 +DILUPBiCG: Solving for Ux, Initial residual = 1.04946e-05, Final residual = 7.65384e-06, No Iterations 1 +DILUPBiCG: Solving for Uy, Initial residual = 2.46289e-05, Final residual = 8.95844e-06, No Iterations 1 +DICPCG: Solving for p, Initial residual = 0.000129655, Final residual = 5.0454e-07, No Iterations 24 +time step continuity errors : sum local = 8.65033e-09, global = -1.62061e-18, cumulative = -2.52239e-17 +DICPCG: Solving for p, Initial residual = 9.79861e-05, Final residual = 3.89556e-07, No Iterations 24 +time step continuity errors : sum local = 6.6858e-09, global = -2.39469e-18, cumulative = -2.76186e-17 +ExecutionTime = 1.62 s ClockTime = 2 s + +Time = 0.7 + +Moving p index to 70... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 12.8016 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 531.135 +Ad = Ad [0 0 0 0 0 0 0] 38.86 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.01007 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 19.3004 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 620.718 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233861 max: 1.70428 velocity magnitude: 0.85214 +DILUPBiCG: Solving for Ux, Initial residual = 1.03077e-05, Final residual = 1.38814e-06, No Iterations 2 +DILUPBiCG: Solving for Uy, Initial residual = 2.7316e-05, Final residual = 1.54814e-06, No Iterations 3 +DICPCG: Solving for p, Initial residual = 0.000102175, Final residual = 5.96038e-07, No Iterations 24 +time step continuity errors : sum local = 1.02152e-08, global = 1.58819e-18, cumulative = -2.60304e-17 +DICPCG: Solving for p, Initial residual = 8.02868e-05, Final residual = 9.97124e-07, No Iterations 23 +time step continuity errors : sum local = 1.70634e-08, global = -1.92799e-18, cumulative = -2.79584e-17 +ExecutionTime = 1.65 s ClockTime = 2 s + +Time = 0.71 + +Moving p index to 71... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 12.9559 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 531.265 +Ad = Ad [0 0 0 0 0 0 0] 38.87 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010071 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 19.5762 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 621.288 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.23386 max: 1.70428 velocity magnitude: 0.852138 +DILUPBiCG: Solving for Ux, Initial residual = 1.04928e-05, Final residual = 7.65471e-06, No Iterations 1 +DILUPBiCG: Solving for Uy, Initial residual = 2.46261e-05, Final residual = 8.95802e-06, No Iterations 1 +DICPCG: Solving for p, Initial residual = 0.000129648, Final residual = 5.04494e-07, No Iterations 24 +time step continuity errors : sum local = 8.64956e-09, global = -6.56947e-19, cumulative = -2.86153e-17 +DICPCG: Solving for p, Initial residual = 9.79833e-05, Final residual = 3.89537e-07, No Iterations 24 +time step continuity errors : sum local = 6.6855e-09, global = -1.01015e-18, cumulative = -2.96255e-17 +ExecutionTime = 1.67 s ClockTime = 2 s + +Time = 0.72 + +Moving p index to 72... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 13.1102 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 531.395 +Ad = Ad [0 0 0 0 0 0 0] 38.88 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010072 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 19.8519 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 621.858 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233861 max: 1.70428 velocity magnitude: 0.85214 +DILUPBiCG: Solving for Ux, Initial residual = 1.03058e-05, Final residual = 1.38805e-06, No Iterations 2 +DILUPBiCG: Solving for Uy, Initial residual = 2.73136e-05, Final residual = 1.54857e-06, No Iterations 3 +DICPCG: Solving for p, Initial residual = 0.000102161, Final residual = 5.95951e-07, No Iterations 24 +time step continuity errors : sum local = 1.02137e-08, global = 6.35109e-19, cumulative = -2.89904e-17 +DICPCG: Solving for p, Initial residual = 8.02776e-05, Final residual = 9.96966e-07, No Iterations 23 +time step continuity errors : sum local = 1.70607e-08, global = 6.85567e-19, cumulative = -2.83048e-17 +ExecutionTime = 1.7 s ClockTime = 2 s + +Time = 0.73 + +Moving p index to 73... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 13.2645 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 531.525 +Ad = Ad [0 0 0 0 0 0 0] 38.89 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010073 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 20.1276 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 622.428 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.23386 max: 1.70428 velocity magnitude: 0.852138 +DILUPBiCG: Solving for Ux, Initial residual = 1.0491e-05, Final residual = 7.65557e-06, No Iterations 1 +DILUPBiCG: Solving for Uy, Initial residual = 2.46233e-05, Final residual = 8.9576e-06, No Iterations 1 +DICPCG: Solving for p, Initial residual = 0.000129641, Final residual = 5.04448e-07, No Iterations 24 +time step continuity errors : sum local = 8.64879e-09, global = 1.18518e-18, cumulative = -2.71196e-17 +DICPCG: Solving for p, Initial residual = 9.79805e-05, Final residual = 3.89518e-07, No Iterations 24 +time step continuity errors : sum local = 6.68519e-09, global = -1.1607e-18, cumulative = -2.82803e-17 +ExecutionTime = 1.72 s ClockTime = 2 s + +Time = 0.74 + +Moving p index to 74... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 13.4188 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 531.655 +Ad = Ad [0 0 0 0 0 0 0] 38.9 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010074 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 20.4033 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 622.998 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233861 max: 1.70428 velocity magnitude: 0.85214 +DILUPBiCG: Solving for Ux, Initial residual = 1.0304e-05, Final residual = 1.38796e-06, No Iterations 2 +DILUPBiCG: Solving for Uy, Initial residual = 2.73112e-05, Final residual = 1.549e-06, No Iterations 3 +DICPCG: Solving for p, Initial residual = 0.000102146, Final residual = 5.95865e-07, No Iterations 24 +time step continuity errors : sum local = 1.02123e-08, global = -1.4249e-18, cumulative = -2.97052e-17 +DICPCG: Solving for p, Initial residual = 8.02684e-05, Final residual = 9.96808e-07, No Iterations 23 +time step continuity errors : sum local = 1.7058e-08, global = 1.45815e-18, cumulative = -2.82471e-17 +ExecutionTime = 1.74 s ClockTime = 2 s + +Time = 0.75 + +Moving p index to 75... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 13.5731 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 531.785 +Ad = Ad [0 0 0 0 0 0 0] 38.91 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010075 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 20.679 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 623.568 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.23386 max: 1.70428 velocity magnitude: 0.852138 +DILUPBiCG: Solving for Ux, Initial residual = 1.04892e-05, Final residual = 7.65643e-06, No Iterations 1 +DILUPBiCG: Solving for Uy, Initial residual = 2.46205e-05, Final residual = 8.95718e-06, No Iterations 1 +DICPCG: Solving for p, Initial residual = 0.000129633, Final residual = 5.04403e-07, No Iterations 24 +time step continuity errors : sum local = 8.64802e-09, global = 1.32564e-18, cumulative = -2.69214e-17 +DICPCG: Solving for p, Initial residual = 9.79777e-05, Final residual = 3.895e-07, No Iterations 24 +time step continuity errors : sum local = 6.68488e-09, global = 1.66594e-19, cumulative = -2.67548e-17 +ExecutionTime = 1.76 s ClockTime = 2 s + +Time = 0.76 + +Moving p index to 76... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 13.7274 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 531.915 +Ad = Ad [0 0 0 0 0 0 0] 38.92 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010076 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 20.9548 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 624.138 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233861 max: 1.70428 velocity magnitude: 0.85214 +DILUPBiCG: Solving for Ux, Initial residual = 1.03021e-05, Final residual = 1.38787e-06, No Iterations 2 +DILUPBiCG: Solving for Uy, Initial residual = 2.73089e-05, Final residual = 1.54943e-06, No Iterations 3 +DICPCG: Solving for p, Initial residual = 0.000102132, Final residual = 5.95778e-07, No Iterations 24 +time step continuity errors : sum local = 1.02108e-08, global = 3.19176e-18, cumulative = -2.35631e-17 +DICPCG: Solving for p, Initial residual = 8.02592e-05, Final residual = 9.96649e-07, No Iterations 23 +time step continuity errors : sum local = 1.70553e-08, global = -2.05108e-18, cumulative = -2.56142e-17 +ExecutionTime = 1.78 s ClockTime = 2 s + +Time = 0.77 + +Moving p index to 77... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 13.8817 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 532.045 +Ad = Ad [0 0 0 0 0 0 0] 38.93 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010077 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 21.2305 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 624.708 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.23386 max: 1.70428 velocity magnitude: 0.852138 +DILUPBiCG: Solving for Ux, Initial residual = 1.04874e-05, Final residual = 7.65729e-06, No Iterations 1 +DILUPBiCG: Solving for Uy, Initial residual = 2.46176e-05, Final residual = 8.95675e-06, No Iterations 1 +DICPCG: Solving for p, Initial residual = 0.000129626, Final residual = 5.04357e-07, No Iterations 24 +time step continuity errors : sum local = 8.64725e-09, global = 8.25195e-19, cumulative = -2.4789e-17 +DICPCG: Solving for p, Initial residual = 9.7975e-05, Final residual = 3.89481e-07, No Iterations 24 +time step continuity errors : sum local = 6.68457e-09, global = -1.06011e-18, cumulative = -2.58491e-17 +ExecutionTime = 1.81 s ClockTime = 2 s + +Time = 0.78 + +Moving p index to 78... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 14.036 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 532.175 +Ad = Ad [0 0 0 0 0 0 0] 38.94 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010078 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 21.5062 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 625.278 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233861 max: 1.70428 velocity magnitude: 0.85214 +DILUPBiCG: Solving for Ux, Initial residual = 1.03003e-05, Final residual = 1.38778e-06, No Iterations 2 +DILUPBiCG: Solving for Uy, Initial residual = 2.73065e-05, Final residual = 1.54985e-06, No Iterations 3 +DICPCG: Solving for p, Initial residual = 0.000102117, Final residual = 5.95691e-07, No Iterations 24 +time step continuity errors : sum local = 1.02093e-08, global = 1.19081e-18, cumulative = -2.46583e-17 +DICPCG: Solving for p, Initial residual = 8.025e-05, Final residual = 9.96491e-07, No Iterations 23 +time step continuity errors : sum local = 1.70527e-08, global = -1.43284e-18, cumulative = -2.60911e-17 +ExecutionTime = 1.83 s ClockTime = 2 s + +Time = 0.79 + +Moving p index to 79... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 14.1903 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 532.305 +Ad = Ad [0 0 0 0 0 0 0] 38.95 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010079 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 21.7819 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 625.848 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.23386 max: 1.70428 velocity magnitude: 0.852138 +DILUPBiCG: Solving for Ux, Initial residual = 1.04857e-05, Final residual = 7.65816e-06, No Iterations 1 +DILUPBiCG: Solving for Uy, Initial residual = 2.46148e-05, Final residual = 8.95633e-06, No Iterations 1 +DICPCG: Solving for p, Initial residual = 0.000129619, Final residual = 5.04311e-07, No Iterations 24 +time step continuity errors : sum local = 8.64648e-09, global = -1.25765e-18, cumulative = -2.73488e-17 +DICPCG: Solving for p, Initial residual = 9.79722e-05, Final residual = 3.89463e-07, No Iterations 24 +time step continuity errors : sum local = 6.68426e-09, global = 4.97963e-19, cumulative = -2.68508e-17 +ExecutionTime = 1.85 s ClockTime = 2 s + +Time = 0.8 + +Moving p index to 80... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 14.3446 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 532.435 +Ad = Ad [0 0 0 0 0 0 0] 38.96 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.01008 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 22.0576 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 626.418 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233861 max: 1.70428 velocity magnitude: 0.85214 +DILUPBiCG: Solving for Ux, Initial residual = 1.02984e-05, Final residual = 1.38769e-06, No Iterations 2 +DILUPBiCG: Solving for Uy, Initial residual = 2.73041e-05, Final residual = 1.55028e-06, No Iterations 3 +DICPCG: Solving for p, Initial residual = 0.000102103, Final residual = 5.95605e-07, No Iterations 24 +time step continuity errors : sum local = 1.02078e-08, global = 1.99185e-19, cumulative = -2.66516e-17 +DICPCG: Solving for p, Initial residual = 8.02408e-05, Final residual = 9.96333e-07, No Iterations 23 +time step continuity errors : sum local = 1.705e-08, global = -9.87654e-19, cumulative = -2.76393e-17 +ExecutionTime = 1.88 s ClockTime = 2 s + +Time = 0.81 + +Moving p index to 81... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 14.499 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 532.565 +Ad = Ad [0 0 0 0 0 0 0] 38.97 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010081 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 22.3334 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 626.988 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.23386 max: 1.70428 velocity magnitude: 0.852138 +DILUPBiCG: Solving for Ux, Initial residual = 1.04839e-05, Final residual = 7.65902e-06, No Iterations 1 +DILUPBiCG: Solving for Uy, Initial residual = 2.4612e-05, Final residual = 8.95591e-06, No Iterations 1 +DICPCG: Solving for p, Initial residual = 0.000129612, Final residual = 5.04266e-07, No Iterations 24 +time step continuity errors : sum local = 8.64571e-09, global = -8.09314e-19, cumulative = -2.84486e-17 +DICPCG: Solving for p, Initial residual = 9.79694e-05, Final residual = 3.89444e-07, No Iterations 24 +time step continuity errors : sum local = 6.68396e-09, global = 5.35682e-19, cumulative = -2.79129e-17 +ExecutionTime = 1.91 s ClockTime = 2 s + +Time = 0.82 + +Moving p index to 82... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 14.6533 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 532.695 +Ad = Ad [0 0 0 0 0 0 0] 38.98 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010082 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 22.6091 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 627.558 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233861 max: 1.70428 velocity magnitude: 0.85214 +DILUPBiCG: Solving for Ux, Initial residual = 1.02966e-05, Final residual = 1.38759e-06, No Iterations 2 +DILUPBiCG: Solving for Uy, Initial residual = 2.73017e-05, Final residual = 1.55071e-06, No Iterations 3 +DICPCG: Solving for p, Initial residual = 0.000102088, Final residual = 5.95518e-07, No Iterations 24 +time step continuity errors : sum local = 1.02063e-08, global = 1.72434e-18, cumulative = -2.61886e-17 +DICPCG: Solving for p, Initial residual = 8.02316e-05, Final residual = 9.96175e-07, No Iterations 23 +time step continuity errors : sum local = 1.70473e-08, global = -7.68616e-19, cumulative = -2.69572e-17 +ExecutionTime = 1.93 s ClockTime = 2 s + +Time = 0.83 + +Moving p index to 83... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 14.8076 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 532.825 +Ad = Ad [0 0 0 0 0 0 0] 38.99 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010083 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 22.8848 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 628.128 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.23386 max: 1.70428 velocity magnitude: 0.852139 +DILUPBiCG: Solving for Ux, Initial residual = 1.04821e-05, Final residual = 7.65988e-06, No Iterations 1 +DILUPBiCG: Solving for Uy, Initial residual = 2.46091e-05, Final residual = 8.95548e-06, No Iterations 1 +DICPCG: Solving for p, Initial residual = 0.000129604, Final residual = 5.0422e-07, No Iterations 24 +time step continuity errors : sum local = 8.64495e-09, global = 7.84167e-20, cumulative = -2.68788e-17 +DICPCG: Solving for p, Initial residual = 9.79667e-05, Final residual = 3.89425e-07, No Iterations 24 +time step continuity errors : sum local = 6.68365e-09, global = -1.4747e-18, cumulative = -2.83535e-17 +ExecutionTime = 1.95 s ClockTime = 2 s + +Time = 0.84 + +Moving p index to 84... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 14.9619 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 532.955 +Ad = Ad [0 0 0 0 0 0 0] 39 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010084 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 23.1605 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 628.699 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233862 max: 1.70428 velocity magnitude: 0.852141 +DILUPBiCG: Solving for Ux, Initial residual = 1.02947e-05, Final residual = 1.3875e-06, No Iterations 2 +DILUPBiCG: Solving for Uy, Initial residual = 2.72993e-05, Final residual = 1.55114e-06, No Iterations 3 +DICPCG: Solving for p, Initial residual = 0.000102073, Final residual = 5.95431e-07, No Iterations 24 +time step continuity errors : sum local = 1.02049e-08, global = -2.20328e-18, cumulative = -3.05567e-17 +DICPCG: Solving for p, Initial residual = 8.02224e-05, Final residual = 9.96017e-07, No Iterations 23 +time step continuity errors : sum local = 1.70446e-08, global = 1.40687e-18, cumulative = -2.91499e-17 +ExecutionTime = 1.97 s ClockTime = 2 s + +Time = 0.85 + +Moving p index to 85... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 15.1162 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 533.085 +Ad = Ad [0 0 0 0 0 0 0] 39.01 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010085 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 23.4362 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 629.269 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233861 max: 1.70428 velocity magnitude: 0.852139 +DILUPBiCG: Solving for Ux, Initial residual = 1.04803e-05, Final residual = 7.66074e-06, No Iterations 1 +DILUPBiCG: Solving for Uy, Initial residual = 2.46063e-05, Final residual = 8.95506e-06, No Iterations 1 +DICPCG: Solving for p, Initial residual = 0.000129597, Final residual = 5.04174e-07, No Iterations 24 +time step continuity errors : sum local = 8.64418e-09, global = -4.12929e-19, cumulative = -2.95628e-17 +DICPCG: Solving for p, Initial residual = 9.79639e-05, Final residual = 3.89407e-07, No Iterations 24 +time step continuity errors : sum local = 6.68334e-09, global = -8.28835e-20, cumulative = -2.96457e-17 +ExecutionTime = 1.99 s ClockTime = 2 s + +Time = 0.86 + +Moving p index to 86... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 15.2705 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 533.215 +Ad = Ad [0 0 0 0 0 0 0] 39.02 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010086 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 23.712 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 629.839 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233862 max: 1.70428 velocity magnitude: 0.852141 +DILUPBiCG: Solving for Ux, Initial residual = 1.02928e-05, Final residual = 1.38741e-06, No Iterations 2 +DILUPBiCG: Solving for Uy, Initial residual = 2.7297e-05, Final residual = 1.55157e-06, No Iterations 3 +DICPCG: Solving for p, Initial residual = 0.000102059, Final residual = 5.95345e-07, No Iterations 24 +time step continuity errors : sum local = 1.02034e-08, global = -5.69762e-19, cumulative = -3.02154e-17 +DICPCG: Solving for p, Initial residual = 8.02132e-05, Final residual = 9.95859e-07, No Iterations 23 +time step continuity errors : sum local = 1.70419e-08, global = 5.99044e-19, cumulative = -2.96164e-17 +ExecutionTime = 2.02 s ClockTime = 2 s + +Time = 0.87 + +Moving p index to 87... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 15.4248 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 533.345 +Ad = Ad [0 0 0 0 0 0 0] 39.03 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010087 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 23.9877 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 630.409 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233861 max: 1.70428 velocity magnitude: 0.852139 +DILUPBiCG: Solving for Ux, Initial residual = 1.04785e-05, Final residual = 7.6616e-06, No Iterations 1 +DILUPBiCG: Solving for Uy, Initial residual = 2.46035e-05, Final residual = 8.95464e-06, No Iterations 1 +DICPCG: Solving for p, Initial residual = 0.00012959, Final residual = 5.04129e-07, No Iterations 24 +time step continuity errors : sum local = 8.64341e-09, global = -1.59596e-18, cumulative = -3.12124e-17 +DICPCG: Solving for p, Initial residual = 9.79612e-05, Final residual = 3.89388e-07, No Iterations 24 +time step continuity errors : sum local = 6.68303e-09, global = 5.12025e-19, cumulative = -3.07003e-17 +ExecutionTime = 2.04 s ClockTime = 3 s + +Time = 0.88 + +Moving p index to 88... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 15.5791 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 533.475 +Ad = Ad [0 0 0 0 0 0 0] 39.04 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010088 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 24.2634 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 630.979 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233862 max: 1.70428 velocity magnitude: 0.852141 +DILUPBiCG: Solving for Ux, Initial residual = 1.0291e-05, Final residual = 1.38732e-06, No Iterations 2 +DILUPBiCG: Solving for Uy, Initial residual = 2.72946e-05, Final residual = 1.55199e-06, No Iterations 3 +DICPCG: Solving for p, Initial residual = 0.000102044, Final residual = 5.95258e-07, No Iterations 24 +time step continuity errors : sum local = 1.02019e-08, global = -1.00751e-19, cumulative = -3.08011e-17 +DICPCG: Solving for p, Initial residual = 8.0204e-05, Final residual = 9.95701e-07, No Iterations 23 +time step continuity errors : sum local = 1.70392e-08, global = 1.83005e-18, cumulative = -2.8971e-17 +ExecutionTime = 2.06 s ClockTime = 3 s + +Time = 0.89 + +Moving p index to 89... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 15.7334 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 533.605 +Ad = Ad [0 0 0 0 0 0 0] 39.05 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010089 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 24.5391 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 631.549 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233861 max: 1.70428 velocity magnitude: 0.852139 +DILUPBiCG: Solving for Ux, Initial residual = 1.04767e-05, Final residual = 7.66247e-06, No Iterations 1 +DILUPBiCG: Solving for Uy, Initial residual = 2.46007e-05, Final residual = 8.95421e-06, No Iterations 1 +DICPCG: Solving for p, Initial residual = 0.000129583, Final residual = 5.04083e-07, No Iterations 24 +time step continuity errors : sum local = 8.64264e-09, global = -1.43003e-18, cumulative = -3.04011e-17 +DICPCG: Solving for p, Initial residual = 9.79584e-05, Final residual = 3.8937e-07, No Iterations 24 +time step continuity errors : sum local = 6.68272e-09, global = -2.12023e-18, cumulative = -3.25213e-17 +ExecutionTime = 2.08 s ClockTime = 3 s + +Time = 0.9 + +Moving p index to 90... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 15.8877 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 533.735 +Ad = Ad [0 0 0 0 0 0 0] 39.06 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.01009 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 24.8149 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 632.119 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233862 max: 1.70428 velocity magnitude: 0.852141 +DILUPBiCG: Solving for Ux, Initial residual = 1.02891e-05, Final residual = 1.38723e-06, No Iterations 2 +DILUPBiCG: Solving for Uy, Initial residual = 2.72922e-05, Final residual = 1.55242e-06, No Iterations 3 +DICPCG: Solving for p, Initial residual = 0.00010203, Final residual = 5.95171e-07, No Iterations 24 +time step continuity errors : sum local = 1.02004e-08, global = -8.84587e-19, cumulative = -3.34059e-17 +DICPCG: Solving for p, Initial residual = 8.01949e-05, Final residual = 9.95543e-07, No Iterations 23 +time step continuity errors : sum local = 1.70365e-08, global = -5.92096e-19, cumulative = -3.3998e-17 +ExecutionTime = 2.11 s ClockTime = 3 s + +Time = 0.91 + +Moving p index to 91... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 16.042 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 533.865 +Ad = Ad [0 0 0 0 0 0 0] 39.07 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010091 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 25.0906 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 632.689 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233861 max: 1.70428 velocity magnitude: 0.852139 +DILUPBiCG: Solving for Ux, Initial residual = 1.0475e-05, Final residual = 7.66333e-06, No Iterations 1 +DILUPBiCG: Solving for Uy, Initial residual = 2.45978e-05, Final residual = 8.95379e-06, No Iterations 1 +DICPCG: Solving for p, Initial residual = 0.000129575, Final residual = 5.04038e-07, No Iterations 24 +time step continuity errors : sum local = 8.64188e-09, global = -1.53359e-19, cumulative = -3.41513e-17 +DICPCG: Solving for p, Initial residual = 9.79557e-05, Final residual = 3.89351e-07, No Iterations 24 +time step continuity errors : sum local = 6.68242e-09, global = 1.02984e-18, cumulative = -3.31215e-17 +ExecutionTime = 2.14 s ClockTime = 3 s + +Time = 0.92 + +Moving p index to 92... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 16.1963 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 533.995 +Ad = Ad [0 0 0 0 0 0 0] 39.08 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010092 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 25.3663 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 633.259 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233862 max: 1.70428 velocity magnitude: 0.852141 +DILUPBiCG: Solving for Ux, Initial residual = 1.02873e-05, Final residual = 1.38714e-06, No Iterations 2 +DILUPBiCG: Solving for Uy, Initial residual = 2.72898e-05, Final residual = 1.55285e-06, No Iterations 3 +DICPCG: Solving for p, Initial residual = 0.000102015, Final residual = 5.95085e-07, No Iterations 24 +time step continuity errors : sum local = 1.0199e-08, global = 1.6001e-18, cumulative = -3.15214e-17 +DICPCG: Solving for p, Initial residual = 8.01857e-05, Final residual = 9.95385e-07, No Iterations 23 +time step continuity errors : sum local = 1.70338e-08, global = 7.32717e-19, cumulative = -3.07887e-17 +ExecutionTime = 2.16 s ClockTime = 3 s + +Time = 0.93 + +Moving p index to 93... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 16.3506 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 534.125 +Ad = Ad [0 0 0 0 0 0 0] 39.09 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010093 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 25.642 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 633.829 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233861 max: 1.70428 velocity magnitude: 0.852139 +DILUPBiCG: Solving for Ux, Initial residual = 1.04732e-05, Final residual = 7.66419e-06, No Iterations 1 +DILUPBiCG: Solving for Uy, Initial residual = 2.4595e-05, Final residual = 8.95336e-06, No Iterations 1 +DICPCG: Solving for p, Initial residual = 0.000129568, Final residual = 5.03992e-07, No Iterations 24 +time step continuity errors : sum local = 8.64111e-09, global = 1.73361e-18, cumulative = -2.90551e-17 +DICPCG: Solving for p, Initial residual = 9.79529e-05, Final residual = 3.89333e-07, No Iterations 24 +time step continuity errors : sum local = 6.68211e-09, global = -8.3082e-19, cumulative = -2.98859e-17 +ExecutionTime = 2.18 s ClockTime = 3 s + +Time = 0.94 + +Moving p index to 94... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 16.505 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 534.255 +Ad = Ad [0 0 0 0 0 0 0] 39.1 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010094 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 25.9177 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 634.399 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233862 max: 1.70428 velocity magnitude: 0.852141 +DILUPBiCG: Solving for Ux, Initial residual = 1.02854e-05, Final residual = 1.38705e-06, No Iterations 2 +DILUPBiCG: Solving for Uy, Initial residual = 2.72875e-05, Final residual = 1.55328e-06, No Iterations 3 +DICPCG: Solving for p, Initial residual = 0.000102001, Final residual = 5.94998e-07, No Iterations 24 +time step continuity errors : sum local = 1.01975e-08, global = 1.02934e-18, cumulative = -2.88565e-17 +DICPCG: Solving for p, Initial residual = 8.01765e-05, Final residual = 9.95228e-07, No Iterations 23 +time step continuity errors : sum local = 1.70311e-08, global = -2.87743e-18, cumulative = -3.1734e-17 +ExecutionTime = 2.2 s ClockTime = 3 s + +Time = 0.95 + +Moving p index to 95... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 16.6593 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 534.385 +Ad = Ad [0 0 0 0 0 0 0] 39.11 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010095 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 26.1935 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 634.969 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233861 max: 1.70428 velocity magnitude: 0.852139 +DILUPBiCG: Solving for Ux, Initial residual = 1.04714e-05, Final residual = 7.66505e-06, No Iterations 1 +DILUPBiCG: Solving for Uy, Initial residual = 2.45922e-05, Final residual = 8.95294e-06, No Iterations 1 +DICPCG: Solving for p, Initial residual = 0.000129561, Final residual = 5.03946e-07, No Iterations 24 +time step continuity errors : sum local = 8.64034e-09, global = 2.29956e-18, cumulative = -2.94344e-17 +DICPCG: Solving for p, Initial residual = 9.79501e-05, Final residual = 3.89314e-07, No Iterations 24 +time step continuity errors : sum local = 6.6818e-09, global = 1.00221e-18, cumulative = -2.84322e-17 +ExecutionTime = 2.22 s ClockTime = 3 s + +Time = 0.96 + +Moving p index to 96... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 16.8136 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 534.515 +Ad = Ad [0 0 0 0 0 0 0] 39.12 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010096 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 26.4692 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 635.539 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233862 max: 1.70428 velocity magnitude: 0.852141 +DILUPBiCG: Solving for Ux, Initial residual = 1.02836e-05, Final residual = 1.38696e-06, No Iterations 2 +DILUPBiCG: Solving for Uy, Initial residual = 2.72851e-05, Final residual = 1.55371e-06, No Iterations 3 +DICPCG: Solving for p, Initial residual = 0.000101986, Final residual = 5.94912e-07, No Iterations 24 +time step continuity errors : sum local = 1.0196e-08, global = 2.3707e-19, cumulative = -2.81951e-17 +DICPCG: Solving for p, Initial residual = 8.01673e-05, Final residual = 9.9507e-07, No Iterations 23 +time step continuity errors : sum local = 1.70284e-08, global = -2.51033e-18, cumulative = -3.07055e-17 +ExecutionTime = 2.25 s ClockTime = 3 s + +Time = 0.97 + +Moving p index to 97... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 16.9679 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 534.645 +Ad = Ad [0 0 0 0 0 0 0] 39.13 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010097 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 26.7449 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 636.109 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233861 max: 1.70428 velocity magnitude: 0.852139 +DILUPBiCG: Solving for Ux, Initial residual = 1.04696e-05, Final residual = 7.66591e-06, No Iterations 1 +DILUPBiCG: Solving for Uy, Initial residual = 2.45894e-05, Final residual = 8.95251e-06, No Iterations 1 +DICPCG: Solving for p, Initial residual = 0.000129554, Final residual = 5.03901e-07, No Iterations 24 +time step continuity errors : sum local = 8.63958e-09, global = 1.47569e-19, cumulative = -3.05579e-17 +DICPCG: Solving for p, Initial residual = 9.79474e-05, Final residual = 3.89296e-07, No Iterations 24 +time step continuity errors : sum local = 6.6815e-09, global = 8.44551e-19, cumulative = -2.97133e-17 +ExecutionTime = 2.27 s ClockTime = 3 s + +Time = 0.98 + +Moving p index to 98... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 17.1222 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 534.775 +Ad = Ad [0 0 0 0 0 0 0] 39.14 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010098 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 27.0206 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 636.679 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233862 max: 1.70428 velocity magnitude: 0.852141 +DILUPBiCG: Solving for Ux, Initial residual = 1.02817e-05, Final residual = 1.38687e-06, No Iterations 2 +DILUPBiCG: Solving for Uy, Initial residual = 2.72827e-05, Final residual = 1.55414e-06, No Iterations 3 +DICPCG: Solving for p, Initial residual = 0.000101972, Final residual = 5.94825e-07, No Iterations 24 +time step continuity errors : sum local = 1.01945e-08, global = -6.46359e-19, cumulative = -3.03597e-17 +DICPCG: Solving for p, Initial residual = 8.01581e-05, Final residual = 9.94912e-07, No Iterations 23 +time step continuity errors : sum local = 1.70257e-08, global = -3.45761e-20, cumulative = -3.03943e-17 +ExecutionTime = 2.29 s ClockTime = 3 s + +Time = 0.99 + +Moving p index to 99... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 17.2765 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 534.905 +Ad = Ad [0 0 0 0 0 0 0] 39.15 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.010099 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 27.2963 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 637.249 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233861 max: 1.70428 velocity magnitude: 0.852139 +DILUPBiCG: Solving for Ux, Initial residual = 1.04678e-05, Final residual = 7.66678e-06, No Iterations 1 +DILUPBiCG: Solving for Uy, Initial residual = 2.45866e-05, Final residual = 8.95208e-06, No Iterations 1 +DICPCG: Solving for p, Initial residual = 0.000129547, Final residual = 5.03855e-07, No Iterations 24 +time step continuity errors : sum local = 8.63881e-09, global = -2.39816e-18, cumulative = -3.27924e-17 +DICPCG: Solving for p, Initial residual = 9.79447e-05, Final residual = 3.89277e-07, No Iterations 24 +time step continuity errors : sum local = 6.68119e-09, global = 8.78135e-19, cumulative = -3.19143e-17 +ExecutionTime = 2.31 s ClockTime = 3 s + +Time = 1 + +Moving p index to 100... +Passive reread... +Active reread... +Updating active equations... +Aa = Aa [0 0 0 0 0 0 0] 17.4308 +Ab = Ab [0 0 0 0 0 0 0] 0 +Ac = Ac [0 0 0 0 0 0 0] 535.035 +Ad = Ad [0 0 0 0 0 0 0] 39.16 +Ae = Ae [0 0 0 0 0 0 0] 12 +Af = Af [0 0 0 0 0 0 0] 2 +nu = nu [0 2 -1 0 0 0 0] 0.0101 +Evaluating passive equations: Pa, Pb, Pc, Pd, Pe, Pf. +Pa = Pa [0 0 0 0 0 0 0] 1 +Pb = Pb [0 0 0 0 0 0 0] 1.54308 +Pc = Pc [0 0 0 0 0 0 0] 27.5721 +Pd = Pe [0 0 0 0 0 0 0] 0.411732 +Pe = Pd [0 0 0 0 0 0 0] 637.819 +Pf = Pf [0 0 0 0 0 0 0] 1.66667 +Courant Number mean: 0.233862 max: 1.70428 velocity magnitude: 0.852141 +DILUPBiCG: Solving for Ux, Initial residual = 1.02799e-05, Final residual = 1.38678e-06, No Iterations 2 +DILUPBiCG: Solving for Uy, Initial residual = 2.72803e-05, Final residual = 1.55456e-06, No Iterations 3 +DICPCG: Solving for p, Initial residual = 0.000101957, Final residual = 5.94739e-07, No Iterations 24 +time step continuity errors : sum local = 1.0193e-08, global = -9.94602e-19, cumulative = -3.29089e-17 +DICPCG: Solving for p, Initial residual = 8.0149e-05, Final residual = 9.94754e-07, No Iterations 23 +time step continuity errors : sum local = 1.7023e-08, global = 1.6585e-18, cumulative = -3.12504e-17 +ExecutionTime = 2.34 s ClockTime = 3 s + +End + diff --git a/tutorials/equationReader/equationReaderTester/system/controlDict b/tutorials/equationReader/equationReaderTester/system/controlDict new file mode 100644 index 000000000..a845aa339 --- /dev/null +++ b/tutorials/equationReader/equationReaderTester/system/controlDict @@ -0,0 +1,33 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application equationReaderTester; +startFrom startTime; +startTime 0; +stopAt endTime; +endTime "2/2"; +deltaT 0.01; +writeControl timeStep; +writeInterval 10; +purgeWrite 0; +writeFormat ascii; +writePrecision 6; +writeCompression uncompressed; +timeFormat general; +timePrecision 6; +runTimeModifiable yes; + +// ************************************************************************* // diff --git a/tutorials/equationReader/equationReaderTester/system/fvSchemes b/tutorials/equationReader/equationReaderTester/system/fvSchemes new file mode 100644 index 000000000..712cc1a60 --- /dev/null +++ b/tutorials/equationReader/equationReaderTester/system/fvSchemes @@ -0,0 +1,58 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default Gauss linear; + grad(p) Gauss linear; +} + +divSchemes +{ + default none; + div(phi,U) Gauss linear; +} + +laplacianSchemes +{ + default none; + laplacian(nu,U) Gauss linear corrected; + laplacian((1|A(U)),p) Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; + interpolate(HbyA) linear; +} + +snGradSchemes +{ + default corrected; +} + +fluxRequired +{ + default no; + p; +} + +// ************************************************************************* // diff --git a/tutorials/equationReader/equationReaderTester/system/fvSolution b/tutorials/equationReader/equationReaderTester/system/fvSolution new file mode 100644 index 000000000..f29239916 --- /dev/null +++ b/tutorials/equationReader/equationReaderTester/system/fvSolution @@ -0,0 +1,44 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + p + { + solver PCG; + preconditioner DIC; + tolerance 1e-06; + relTol 0; + }; + + U + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-05; + relTol 0; + }; +} + +PISO +{ + nCorrectors 2; + nNonOrthogonalCorrectors 0; + pRefCell 0; + pRefValue 0; +} + +// ************************************************************************* // diff --git a/tutorials/equationReader/equationReaderTester/testDict1 b/tutorials/equationReader/equationReaderTester/testDict1 new file mode 100644 index 000000000..1d576a857 --- /dev/null +++ b/tutorials/equationReader/equationReaderTester/testDict1 @@ -0,0 +1,49 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object testDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +// Scalar standalone test +saA "5^0"; +saB "1+1"; +saC "1+2"; +saD "2^2"; +saE "sqrt(25)"; +saF "sin(pi_) + cbrt(6^2 * (3 + 2 + 1))"; + +// Dimensioned scalar standalone test +dsaA dsaA [0.1 0 0 0 0 0 0] "1e-5"; +dsaB dsaB [0 0.1 0 0 0 0 0] "sqrt(400)"; +dsaC dsaC [0 0 0.1 0 0 0 0] "(5+5*2)*2"; +dsaD dsaD [0 0 0 0.1 0 0 0] "5*2^3"; +dsaE dsaE [0 0 0 0 0.1 0 0] "log10(1e5)*2*(2^2+1)"; +dsaF dsaF [0 0 0 0 0 0.1 0] "60"; + +// Passive equations +Pa "twoa"; +//Pb "2* DSa + sign(Sa) * cosh(twoa^threea) / (Pc + Aa)"; +Pb "sign(Sa)*cosh(twoa)";//^threea)"; +Pc "DStime * 1e2 / sinh(foura + fivea / sixa^(sevena-eighta/ninea^inv(tena)))"; +Pd "Pa+Pb+Pc+Pe+Pf+Aa+Ab+Ac+Ad+Ae+Af"; +Pe "Sa+(Sb*Sc^(Sd-Se/Sf^(Sg+Sh^Si)))"; +Pf "DSa+(DSb*DSc^(DSd-DSe/DSf^inv(DSg+DSh^DSi)))"; + +// Active equations +Aa "twob/log10(twoc*10)+cosh(threef) * DStime/Sa+fiveg^max(sixf,sevenj) * dummy"; +Ab "fourf*log(pos(sevend))*inv(stabilise(Af, SMALL_))"; +Ac "DSo + DSm * erf(e_^0) + Ad*Ae+Ad + pdimless"; +Ad "Ae+Ae*Af+Pb*inv(stabilise(Af, SMALL_))^Pe+DStime^DSa*twog+sevenh"; +Ae "threej + eightg / nineb*DSk - lgamma(ninej)"; +Af "fiveg^fivec+eighti"; +nu [0 2 -1 0 0 0 0] "0.01 + nuAdd"; diff --git a/tutorials/equationReader/equationReaderTester/testDict10 b/tutorials/equationReader/equationReaderTester/testDict10 new file mode 100644 index 000000000..7a055725b --- /dev/null +++ b/tutorials/equationReader/equationReaderTester/testDict10 @@ -0,0 +1,27 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object testDict10; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Sa..Sl; DSa..DSo; Aa..Af; Pa..Pf + +tena 1; +tenb 1; +tenc 1; +tend 1; +tene 1; +tenf 1; +teng 1; +tenh 1; +teni 1; +tenj 1; diff --git a/tutorials/equationReader/equationReaderTester/testDict2 b/tutorials/equationReader/equationReaderTester/testDict2 new file mode 100644 index 000000000..c5c15ee06 --- /dev/null +++ b/tutorials/equationReader/equationReaderTester/testDict2 @@ -0,0 +1,27 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object testDict2; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Sa..Sl; DSa..DSo; Aa..Af; Pa..Pf + +twoa "1"; +twob "1"; +twoc "1"; +twod "1"; +twoe "1"; +twof "1"; +twog "1"; +twoh "1"; +twoi "1"; +twoj "1"; diff --git a/tutorials/equationReader/equationReaderTester/testDict3 b/tutorials/equationReader/equationReaderTester/testDict3 new file mode 100644 index 000000000..2a95edde0 --- /dev/null +++ b/tutorials/equationReader/equationReaderTester/testDict3 @@ -0,0 +1,30 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object testDict3; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Sa..Sl; DSa..DSo; Aa..Af; Pa..Pf + +threea "1"; +threeb "1"; +threec "1"; +threed "1"; +threee "1"; +threef "1"; +threeg "1"; +threeh "1"; +threei "1"; +threej "1"; +nuAdd [0 2 -1 0 0 0 0] "DStime / 10000"; + +pdimless [0 0 0 0 0 0 0] "p"; diff --git a/tutorials/equationReader/equationReaderTester/testDict4 b/tutorials/equationReader/equationReaderTester/testDict4 new file mode 100644 index 000000000..5f0afb8cc --- /dev/null +++ b/tutorials/equationReader/equationReaderTester/testDict4 @@ -0,0 +1,27 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object testDict4; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Sa..Sl; DSa..DSo; Aa..Af; Pa..Pf + +foura "1"; +fourb "1"; +fourc "1"; +fourd "1"; +foure "1"; +fourf "1"; +fourg "1"; +fourh "1"; +fouri "1"; +fourj "1"; diff --git a/tutorials/equationReader/equationReaderTester/testDict5 b/tutorials/equationReader/equationReaderTester/testDict5 new file mode 100644 index 000000000..3286bf8d8 --- /dev/null +++ b/tutorials/equationReader/equationReaderTester/testDict5 @@ -0,0 +1,27 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object testDict5; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Sa..Sl; DSa..DSo; Aa..Af; Pa..Pf + +fivea 1.0; +fiveb 1.0; +fivec 1.0; +fived 1.0; +fivee 1.0; +fivef 1.0; +fiveg 1.0; +fiveh 1.0; +fivei 1.0; +fivej 1.0; diff --git a/tutorials/equationReader/equationReaderTester/testDict6 b/tutorials/equationReader/equationReaderTester/testDict6 new file mode 100644 index 000000000..428b19759 --- /dev/null +++ b/tutorials/equationReader/equationReaderTester/testDict6 @@ -0,0 +1,27 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object testDict6; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Sa..Sl; DSa..DSo; Aa..Af; Pa..Pf + +sixa 1.0; +sixb 1.0; +sixc 1.0; +sixd 1.0; +sixe 1.0; +sixf 1.0; +sixg 1.0; +sixh 1.0; +sixi 1.0; +sixj 1.0; diff --git a/tutorials/equationReader/equationReaderTester/testDict7 b/tutorials/equationReader/equationReaderTester/testDict7 new file mode 100644 index 000000000..624a19e24 --- /dev/null +++ b/tutorials/equationReader/equationReaderTester/testDict7 @@ -0,0 +1,27 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object testDict7; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Sa..Sl; DSa..DSo; Aa..Af; Pa..Pf + +sevena sevena [0 0 0 0 0 0 0] 1.0; +sevenb sevenb [0 0 0 0 0 0 0] 1.0; +sevenc sevenc [0 0 0 0 0 0 0] 1.0; +sevend sevend [0 0 0 0 0 0 0] 1.0; +sevene sevene [0 0 0 0 0 0 0] 1.0; +sevenf sevenf [0 0 0 0 0 0 0] 1.0; +seveng seveng [0 0 0 0 0 0 0] 1.0; +sevenh sevenh [0 0 0 0 0 0 0] 1.0; +seveni seveni [0 0 0 0 0 0 0] 1.0; +sevenj sevenj [0 0 0 0 0 0 0] 1.0; diff --git a/tutorials/equationReader/equationReaderTester/testDict8 b/tutorials/equationReader/equationReaderTester/testDict8 new file mode 100644 index 000000000..fc3e698d3 --- /dev/null +++ b/tutorials/equationReader/equationReaderTester/testDict8 @@ -0,0 +1,27 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object testDict8; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Sa..Sl; DSa..DSo; Aa..Af; Pa..Pf + +eighta eighta [0 0 0 0 0 0 0] 1.0; +eightb eightb [0 0 0 0 0 0 0] 1.0; +eightc eightc [0 0 0 0 0 0 0] 1.0; +eightd eightd [0 0 0 0 0 0 0] 1.0; +eighte eighte [0 0 0 0 0 0 0] 1.0; +eightf eightf [0 0 0 0 0 0 0] 1.0; +eightg eightg [0 0 0 0 0 0 0] 1.0; +eighth eighth [0 0 0 0 0 0 0] 1.0; +eighti eighti [0 0 0 0 0 0 0] 1.0; +eightj eightj [0 0 0 0 0 0 0] 1.0; diff --git a/tutorials/equationReader/equationReaderTester/testDict9 b/tutorials/equationReader/equationReaderTester/testDict9 new file mode 100644 index 000000000..3a53afcad --- /dev/null +++ b/tutorials/equationReader/equationReaderTester/testDict9 @@ -0,0 +1,27 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object testDict9; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Sa..Sl; DSa..DSo; Aa..Af; Pa..Pf + +ninea "nineb"; +nineb "ninec"; +ninec "nined"; +nined "ninee"; +ninee "ninef"; +ninef "nineg"; +nineg "nineh"; +nineh "ninei"; +ninei "ninej"; +ninej 1.0;