diff --git a/ippl/test/Cartesian/CMakeLists.txt b/ippl/test/Cartesian/CMakeLists.txt deleted file mode 100644 index bf02214d9d3c5ab875528492fd7ebe8039fd21c9..0000000000000000000000000000000000000000 --- a/ippl/test/Cartesian/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -file (RELATIVE_PATH _relPath "${CMAKE_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}") -message (STATUS "Only found stub of CMakeList.txt in ${_relPath}") - -# vi: set et ts=4 sw=4 sts=4: - -# Local Variables: -# mode: cmake -# cmake-tab-width: 4 -# indent-tabs-mode: nil -# End: - - diff --git a/ippl/test/Cartesian/TestCartesian-1.cpp b/ippl/test/Cartesian/TestCartesian-1.cpp deleted file mode 100644 index 6a7e746a09474ccff36662b9e5770cc08154bd8b..0000000000000000000000000000000000000000 --- a/ippl/test/Cartesian/TestCartesian-1.cpp +++ /dev/null @@ -1,459 +0,0 @@ -// -*- C++ -*- -/*************************************************************************** - * - * The IPPL Framework - * - * This program was prepared by PSI. - * All rights in the program are reserved by PSI. - * Neither PSI nor the author(s) - * makes any warranty, express or implied, or assumes any liability or - * responsibility for the use of this software - * - * Visit http://www.acl.lanl.gov/POOMS for more details - * - ***************************************************************************/ - -// -*- C++ -*- -/*************************************************************************** - * - * The IPPL Framework - * - * - * Visit http://people.web.psi.ch/adelmann/ for more details - * - ***************************************************************************/ - -// TestCartesian.cpp -// Various tests of Cartesian class - -// include files -#include "Utility/IpplInfo.h" -#include "Utility/Inform.h" -#include "Index/NDIndex.h" -#include "FieldLayout/CenteredFieldLayout.h" -#include "Field/Field.h" -#include "Field/BCond.h" -#include "Field/GuardCellSizes.h" -#include "Meshes/Cartesian.h" -#include "AppTypes/Vektor.h" -#include "Utility/FieldDebug.h" - - -// Some of the tests are specific to 3D, meaning you'll get a compile error if -// you try to run 2D or 1D. By using this C-preprocessor macro to specify the -// dimensionality, the problematic tests are excluded if you set DIM to -// something other than 3: - -#define DIM 3 - -int main(int argc, char *argv[]) -{ - Ippl ippl(argc,argv); - Inform testmsg(argv[0]); - Inform pout(NULL,0); - setInform(pout); - setFormat(2,3); - bool passed = true; // Pass/fail test - - const unsigned D = DIM; // Hardwire dimensionality - const unsigned nv = 6; // Hardwire number of vertices in every direction - unsigned vnodes = 4; // Hardwire 4 vnodes - - double roundOffError = 1.0e-10; - - // Sizes: - unsigned nverts[D], ncells[D]; - unsigned totverts=1, totcells=1; - int d; - for (d=0; d<D; d++) { - ncells[d] = nv - 1; - nverts[d] = nv; - totcells *= ncells[d]; - totverts *= nverts[d]; - } - NDIndex<D> verts, cells; - for (d=0; d<D; d++) { - verts[d] = Index(nverts[d]); - cells[d] = Index(ncells[d]); - } - - //--------------------------------------------------------------------------- - // Construct some CenteredFieldLayout's and Field's to be used below: - - // Create cartesian mesh object: - typedef Cartesian<D,double> M; - - double* delX[D]; - - for (d=0; d<D; d++) - delX[d] = new double[nverts[d]]; - - Vektor<double,D> origin; - for (d=0; d<D; d++) - origin(d) = d + 1.0; - - // Assign nonuniform mesh-spacing values to each component (linear ramps): - for (d=0; d<D; d++) { - double multipplier = (d + 1)*1.0; - for (int vert=0; vert < nverts[d]; vert++) { - (delX[d])[vert] = multipplier*(1 + vert); - } - } - - // Mesh boundary conditions: - MeshBC_E mbc[2*D]; - for (unsigned b=0; b < (2*D); b++) - mbc[b] = Reflective; - - // Test constructing mesh, and then setting spacing, origin, BC's - M mesh(verts); - mesh.set_origin(origin); - mesh.set_meshSpacing(delX); - mesh.set_MeshBC(mbc); - - // Clean up mesh spacing arrays - for (d=0; d<D; d++) - delete [] delX[d]; - - // ada have to cross check Div() fails without this - mesh.storeSpacingFields(); - - BareField<Vektor<double,D>,D>& vertSpacings = *(mesh.VertSpacings); - BareField<Vektor<double,D>,D>& cellSpacings = *(mesh.CellSpacings); - - // Construct CenteredFieldLayout's using this for Vert and Cell centering: - e_dim_tag edt[D]; - for (d=0; d<D; d++) - edt[d] = PARALLEL; - CenteredFieldLayout<D,M,Cell> cl(mesh, edt, vnodes); - CenteredFieldLayout<D,M,Vert> vl(mesh, edt, vnodes); - - // Use 1 guard layer in all Field's: - GuardCellSizes<D> gc(1); - - - - // Vectors: - BConds<Vektor<double,D>,D,M,Vert> vvbc; - BConds<Vektor<double,D>,D,M,Cell> vcbc; - - // Scalars: - BConds<double,D,M,Cell> scbc; - - // Symmetric tensors: - BConds<SymTenzor<double,D>,D,M,Cell> stcbc; - - // Tensors: - BConds<Tenzor<double,D>,D,M,Cell> tcbc; - - // Use linear negative reflecting conditions: - for (int face=0; face<2*D; face++) { - vvbc[face] = new NegReflectFace<Vektor<double,D>,D,M,Vert>(face); - vcbc[face] = new NegReflectFace<Vektor<double,D>,D,M,Cell>(face); - scbc[face] = new NegReflectFace<double,D,M,Cell>(face); - stcbc[face] = new NegReflectFace<SymTenzor<double,D>,D,M,Cell>(face); - tcbc[face] = new NegReflectFace<Tenzor<double,D>,D,M,Cell>(face); - } - - // Now use all this to construct some Field's: - Field<Vektor<double,D>,D,M,Vert> vectorVert(mesh, vl, gc, vvbc); - Field<Vektor<double,D>,D,M,Cell> vectorCell(mesh, cl, gc, vcbc); - Field<SymTenzor<double,D>,D,M,Cell> symtCell(mesh, cl, gc, stcbc); - Field<Tenzor<double,D>,D,M,Cell> tensorCell(mesh, cl, gc, tcbc); - Field<double,D,M,Cell> scalarCell(mesh, cl, gc, scbc); - - //--------------------------------------------------------------------------- - - //--------------------------------------------------------------------------- - // Try out Divergence Vektor/Vert -> Scalar/Cell: - // Assign values into the vert-centered Field<Vektor>: - assign(vectorVert, mesh.getVertexPositionField(vectorVert)); - scalarCell = Div(vectorVert, scalarCell); - // The value should be 3.0 for all elements; test this: - if (abs(sum(scalarCell)/totcells - 1.0*D) > roundOffError) { - testmsg << "Div(vert position field) != const=" << D << ")" << endl; - testmsg << "sum(scalarCell)/totcells = " - << sum(scalarCell)/totcells << endl; - passed = false; - } - //--------------------------------------------------------------------------- - - // -------------------------------------------------------------------------- - // Try out Gradient Scalar/Cell -> Vektor/Vert: - - // Use mesh object and vectorVert and scalarCell Field's constructed above. - vectorCell = mesh.getCellPositionField(vectorCell); - vectorCell -= mesh.get_origin(); - // Assign positive-sloping linear ramp values into the cell-centered - // Field<scalar>: - scalarCell = 0.0; - for (d=0; d<D; d++) scalarCell[cells] += vectorCell[cells](d); - // Now take the gradient: - vectorVert = Grad(scalarCell, vectorVert); - // The value should be (1.0,1.0,1.0) for all elements one at least one - // removed from the last-physical-layer elements. Last-physical-layer - // elements will be different because the BC available in IPPL don't really - // do the kind of linear extrapolation appropriate for the needs here: - Vektor<double,D> unit; for (d=0; d<D; d++) unit[d] = 1.0; - Vektor<double,D> sumVectorVert; - // Use temporary, smaller BareField as a reduced-by-two vector Field to hold - // only the boundary-exclusive elements (needed because of limitations of - // IPPL reductions ops): - NDIndex<D> bev; - for (d=0; d<D; d++) bev[d] = Index(1,nverts[d]-2,1); - FieldLayout<D> templayout(bev); - BareField<Vektor<double,D>,D> temp(templayout); - temp[bev] = vectorVert[bev]; - sumVectorVert = sum(temp); - unsigned totred=1; for (d=0; d<D; d++) totred *= nverts[d] - 2; - sumVectorVert /= totred; - Vektor<double,D> diffVectorVert; - diffVectorVert = sumVectorVert - unit; - double magDiffVectorVert = 0.0; - for (d=0; d<D; d++) magDiffVectorVert += diffVectorVert(d)*diffVectorVert(d); - magDiffVectorVert = sqrt(magDiffVectorVert); - if (abs(magDiffVectorVert) > roundOffError) { - testmsg << "Grad(cell position field) != const=(1.0,1.0,....))" << endl; - testmsg << "sum(vectorVert)/totverts = " - << sumVectorVert << endl; - passed = false; - } - //--------------------------------------------------------------------------- - - // -------------------------------------------------------------------------- - // Try out Gradient Scalar/Cell -> Vektor/Cell: - - // Use mesh object and vectorVert and scalarCell Field's constructed above. - vectorCell = mesh.getCellPositionField(vectorCell); - vectorCell -= mesh.get_origin(); - // Assign positive-sloping linear ramp values into the cell-centered - // Field<scalar>: - scalarCell = 0.0; - for (d=0; d<D; d++) scalarCell[cells] += vectorCell[cells](d); - // Now take the gradient: - vectorCell = Grad(scalarCell, vectorCell); - // The value should be (1.0,1.0,1.0) for all elements one at least one - // removed from the last-physical-layer elements. Last-physical-layer - // elements will be different because the BC available in IPPL don't really - // do the kind of linear extrapolation appropriate for the needs here: - for (d=0; d<D; d++) unit[d] = 1.0; - Vektor<double,D> sumVectorCell; - // Use temporary, smaller BareField as a reduced-by-two vector Field to hold - // only the boundary-exclusive elements (needed because of limitations of - // IPPL reductions ops): - NDIndex<D> bec; - for (d=0; d<D; d++) bec[d] = Index(1,ncells[d]-2,1); - FieldLayout<D> templayout2(bec); - BareField<Vektor<double,D>,D> temp2(templayout); - temp2[bec] = vectorCell[bec]; - sumVectorCell = sum(temp2); - unsigned totredc=1; for (d=0; d<D; d++) totredc *= ncells[d] - 2; - sumVectorCell /= totredc; - Vektor<double,D> diffVectorCell; - diffVectorCell = sumVectorCell - unit; - double magDiffVectorCell = 0.0; - for (d=0; d<D; d++) magDiffVectorCell += diffVectorCell(d)*diffVectorCell(d); - magDiffVectorCell = sqrt(magDiffVectorCell); - if (abs(magDiffVectorCell) > roundOffError) { - testmsg << "Grad(cell position field) != const=(1.0,1.0,....))" << endl; - testmsg << "sum(vectorCell)/totcells = " - << sumVectorCell << endl; - passed = false; - } - //--------------------------------------------------------------------------- - - //--------------------------------------------------------------------------- - // Try out Divergence SymTenzor/Cell -> Vektor/Vert: - - // Use CenteredFieldLayout's from above object to construct SymTenzor Field: - // Assign values into the cell-centered Field<SymTenzor>; use values from - // cell-centered scalar Field scalarCell set up above: - SymTenzor<double,D> unitSymTenzor = 1.0; - symtCell = unitSymTenzor*scalarCell; - // Now take the divergence: - vectorVert = Div(symtCell, vectorVert); - // The value should be (D,D,D,....) for all elements; test this: - // Use temporary, smaller BareField as a reduced-by-two symtensor Field to - // hold only the boundary-exclusive elements (needed because of limitations - // of IPPL reductions ops): - temp[bev] = vectorVert[bev]; - sumVectorVert = sum(temp); - sumVectorVert /= totred; - Vektor<double,D> deesVector; for (d=0; d<D; d++) deesVector(d) = 1.0*D; - diffVectorVert = sumVectorVert - deesVector; - magDiffVectorVert = 0.0; - for (d=0; d<D; d++) magDiffVectorVert += diffVectorVert(d)*diffVectorVert(d); - magDiffVectorVert = sqrt(magDiffVectorVert); - if (abs(magDiffVectorVert) > roundOffError) { - testmsg << "Div(cell position symtensor field) != const=(D,D,....))" - << endl; - testmsg << "sum(vectorVert)/totverts = " << sumVectorVert << endl; - passed = false; - } - //--------------------------------------------------------------------------- - - // -------------------------------------------------------------------------- - // Try out Gradient Vektor/Vert -> Tenzor/Cell: - - // Set up input values in Vektor/Vert field: - vectorVert = mesh.getVertexPositionField(vectorVert); - // Now take the gradient: - tensorCell = Grad(vectorVert, tensorCell); - // Since this is the gradient of the position vector (x*x_hat + y* y_hat + - // z*z_hat), the result should be the identity tensor (NRL Plasma Formulary - // Vector Identities section): - Tenzor<double,D> identityTensor = 0.0; - for (d=0; d<D; d++) identityTensor(d,d) = 1.0; - Tenzor<double,D> sumTensorCell = sum(tensorCell); - sumTensorCell /= totcells; - Tenzor<double,D> diffTensorCell; - diffTensorCell = sumTensorCell - identityTensor; - double magDiffTensorCell = 0.0; - for (d=0; d<D; d++) { - for (int d2=0; d2<D; d2++) { - magDiffTensorCell += diffTensorCell(d,d2)*diffTensorCell(d,d2); - } - } - if (abs(magDiffTensorCell) > roundOffError) { - testmsg << "magDiffTensorCell = " << magDiffTensorCell << endl; - testmsg << "Grad(vert position vector field) != identity tensor)" << endl; - testmsg << "diffTensorCell = " << diffTensorCell << endl; - passed = false; - } - //--------------------------------------------------------------------------- - - //--------------------------------------------------------------------------- - - /* THIS TEST DOES NOT COMPILE - - // Test Average() functions: - // Scalar Field, Cell-Centered - Field<double,D,Cartesian<D>,Cell> C(mesh, cl, gc); - C = 1.0; - // Scalar weight Field, Cell-Centered - Field<double,D,Cartesian<D>,Cell> wC(mesh, cl, gc); - wC = 2.0; - // Scalar Field, Vert-Centered - Field<double,D,Cartesian<D>,Vert> V(mesh, vl, gc); - V = 1.0; - // Scalar weight Field, Vert-Centered - Field<double,D,Cartesian<D>,Vert> wV(mesh, vl, gc); - wV = 2.0; - // Field's to hold weighted averages: - Field<double,D,Cartesian<D>,Cell> avgToC(mesh, cl, gc); - Field<double,D,Cartesian<D>,Vert> avgToV(mesh, vl, gc); - - assign(avgToV, Average(C, wC, avgToV)); - assign(avgToC, Average(V, wV, avgToC)); - - // Weighted average from Cell to Vert: - // ada does not work assign(avgToV, Average(C, wC, avgToV)); - // Weighted average from Vert to Cell: - // ada dones not work assign(avgToC, Average(V, wV, avgToC)); - // Check results: - if (sum(avgToV) != totverts) { - testmsg << "avgToV values wrong" << endl; - testmsg << "sum(avgToV) = " << sum(avgToV) << " ; totverts = " << totverts - << endl; - // passed = false; - } - if (sum(avgToC) != totcells) { - testmsg << "avgToC values wrong" << endl; - testmsg << "sum(avgToC) = " << sum(avgToC) << " ; totcells = " << totcells - << endl; - // passed = false; - } - - */ - - //--------------------------------------------------------------------------- - - //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -#if DIM == 3 // This block-o-tests only compiles in 3D - - //--------------------------------------------------------------------------- - // Some accessor function tests: - double theVolume, theVolume2, theVolume3; - NDIndex<D> ndi; - ndi[0] = Index(2,2,1); - ndi[1] = Index(2,2,1); - ndi[2] = Index(2,2,1); - theVolume = mesh.getCellVolume(ndi); - ndi[0] = Index(0,2,1); - ndi[1] = Index(0,2,1); - ndi[2] = Index(0,2,1); - theVolume2 = mesh.getCellRangeVolume(ndi); - if (theVolume2 != (6.0*12.0*18.0)) { - testmsg << "volume of cells [0:2][0:2][0:2] != 1296" << endl; - testmsg << "volume of cells [0:2][0:2][0:2] = " << theVolume2 << endl; - passed = false; - } - ndi[0] = Index(0,3,1); - ndi[1] = Index(0,3,1); - ndi[2] = Index(0,3,1); - theVolume3 = mesh.getVertRangeVolume(ndi); - if (theVolume3 != theVolume2) { - testmsg << "volume within vertices [0:3][0:3][0:3] != " - << "vol of cells [0:2][0:2][0:2]" << endl; - testmsg << "volume w/in vertices [0:3][0:3][0:3] = " << theVolume3 << endl; - testmsg << "volume of cells [0:2][0:2][0:2] = " << theVolume2 << endl; - passed = false; - } - //--------------------------------------------------------------------------- - Field<double,D,Cartesian<D>,Cell> theVolumes(mesh, cl); - mesh.getCellVolumeField(theVolumes); - if ((sum(theVolumes)/totcells) != theVolume) { - testmsg << "(sum(theVolumes)/totcells) != cell vol" << endl; - testmsg << "(sum(theVolumes)/totcells) = " - << (sum(theVolumes)/totcells) << endl; - testmsg << "cell vol = " << theVolume << endl; - } - //--------------------------------------------------------------------------- - Vektor<double,D> v; - v(0) = 1.5; v(1) = 4.5; v(2) = 9.5; - ndi = mesh.getNearestVertex(v); - if ( ((ndi[0].first() != 1) || ndi[0].length() != 1) || - ((ndi[1].first() != 1) || ndi[1].length() != 1) || - ((ndi[2].first() != 2) || ndi[2].length() != 1) ) { - testmsg << "NEAREST VERTEX TO (1.5,4.5,9.5) = " << ndi << " != (1,1,2)" - << endl; - passed = false; - } - //--------------------------------------------------------------------------- - Vektor<double,D> v1; - v1 = mesh.getVertexPosition(ndi); - v(0) = 2.0; v(1) = 4.0; v(2) = 12.0; // Correct value - if (v1 != v) { - testmsg << "VERT POSITION OF" << ndi << " = " << v1 << " != " << v << endl; - passed = false; - } - //--------------------------------------------------------------------------- - CenteredFieldLayout<D,Cartesian<D>,Vert> - clVert(mesh); - Field<Vektor<double,D>,D,Cartesian<D>,Vert> - thePositions(clVert); - mesh.getVertexPositionField(thePositions); - //--------------------------------------------------------------------------- - v = mesh.getDeltaVertex(ndi); - Vektor<double,D> vcorrect; - vcorrect(0) = 2.0; vcorrect(1) = 4.0; vcorrect(2) = 9.0; - if (v != vcorrect) { - testmsg << "DELTA-VERTEX OF" << ndi << " = " << v - << " != " << vcorrect << endl; - passed = false; - } - //--------------------------------------------------------------------------- - -#endif // DIM == 3 - - //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - testmsg << ( (passed) ? "PASSED" : "FAILED" ) << endl; - return 0; -} - -/*************************************************************************** - * $RCSfile: TestCartesian.cpp,v $ $Author: adelmann $ - * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:38 $ - * IPPL_VERSION_ID: $Id: TestCartesian.cpp,v 1.1.1.1 2003/01/23 07:40:38 adelmann Exp $ - ***************************************************************************/ diff --git a/ippl/test/FFT/nodefile b/ippl/test/FFT/nodefile deleted file mode 100644 index 1fa54a08d4e0eb48109221d1f66c4d1d71b6a3f1..0000000000000000000000000000000000000000 --- a/ippl/test/FFT/nodefile +++ /dev/null @@ -1 +0,0 @@ -merlin00:4 diff --git a/ippl/test/Hal/yfld_q1_err.txt b/ippl/test/Hal/yfld_q1_err.txt deleted file mode 100644 index eb5be7f12db79b386b662929ef2743f77b6982e4..0000000000000000000000000000000000000000 --- a/ippl/test/Hal/yfld_q1_err.txt +++ /dev/null @@ -1,18 +0,0 @@ -`../install/bin/ippl-config --cxx` -o yfld_q1 `../install/bin/ippl-config --cxxflags` -Wno-deprecated yfld_q1.cpp `../install/bin/ippl-config --libs` -yfld_q1.cpp: In function ‘int main(int, char**)’: -yfld_q1.cpp:105: error: no match for ‘operator[]’ in ‘kernel[operator*(const PETE_Expr<T>&, double) [with T = PETE_TUTree<FnSqrt, PETE_TBTree<OpAdd, PETE_TBTree<OpAdd, PETE_TBTree<OpMultipply, PETE_TBTree<OpSubtract, Index::cursor, PETE_Scalar<double> >, PETE_TBTree<OpSubtract, Index::cursor, PETE_Scalar<double> > >, PETE_TBTree<OpMultipply, PETE_TBTree<OpSubtract, Index::cursor, PETE_Scalar<double> >, PETE_TBTree<OpSubtract, Index::cursor, PETE_Scalar<double> > > >, PETE_TBTree<OpMultipply, PETE_TBTree<OpSubtract, Index::cursor, PETE_Scalar<double> >, PETE_TBTree<OpSubtract, Index::cursor, PETE_Scalar<double> > > > >](1.6e+1)]’ -/home/hjf9/preheat/defrost_c/install/include/Field/Field.cpp:393: note: candidates are: IndexedField<T, Dim, 1u, M, C> Field<T, D, M, C>::operator[](const Index&) [with T = double, unsigned int Dim = 1u, M = UniformCartesian<1u, double>, C = Cell] -/home/hjf9/preheat/defrost_c/install/include/Field/Field.cpp:403: note: IndexedField<T, Dim, 1u, M, C> Field<T, D, M, C>::operator[](int) [with T = double, unsigned int Dim = 1u, M = UniformCartesian<1u, double>, C = Cell] -/home/hjf9/preheat/defrost_c/install/include/Field/Field.cpp:413: note: IndexedField<T, Dim, Dim, M, C> Field<T, D, M, C>::operator[](const NDIndex<Dim2>&) [with T = double, unsigned int Dim = 1u, M = UniformCartesian<1u, double>, C = Cell] -/home/hjf9/preheat/defrost_c/install/include/Field/Field.cpp:423: note: SubField<T, Dim, M, C, SIndex<Dim> > Field<T, D, M, C>::operator[](const SIndex<Dim>&) [with T = double, unsigned int Dim = 1u, M = UniformCartesian<1u, double>, C = Cell] -yfld_q1.cpp:105: error: no match for ‘operator[]’ in ‘kernel[operator+(const PETE_Expr<T>&, int) [with T = PETE_TBTree<OpAdd, PETE_TUTree<FnFloor, PETE_TBTree<OpMultipply, PETE_TUTree<FnSqrt, PETE_TBTree<OpAdd, PETE_TBTree<OpAdd, PETE_TBTree<OpMultipply, PETE_TBTree<OpSubtract, Index::cursor, PETE_Scalar<double> >, PETE_TBTree<OpSubtract, Index::cursor, PETE_Scalar<double> > >, PETE_TBTree<OpMultipply, PETE_TBTree<OpSubtract, Index::cursor, PETE_Scalar<double> >, PETE_TBTree<OpSubtract, Index::cursor, PETE_Scalar<double> > > >, PETE_TBTree<OpMultipply, PETE_TBTree<OpSubtract, Index::cursor, PETE_Scalar<double> >, PETE_TBTree<OpSubtract, Index::cursor, PETE_Scalar<double> > > > >, PETE_Scalar<double> > >, PETE_Scalar<int> >](1)]’ -/home/hjf9/preheat/defrost_c/install/include/Field/Field.cpp:393: note: candidates are: IndexedField<T, Dim, 1u, M, C> Field<T, D, M, C>::operator[](const Index&) [with T = double, unsigned int Dim = 1u, M = UniformCartesian<1u, double>, C = Cell] -/home/hjf9/preheat/defrost_c/install/include/Field/Field.cpp:403: note: IndexedField<T, Dim, 1u, M, C> Field<T, D, M, C>::operator[](int) [with T = double, unsigned int Dim = 1u, M = UniformCartesian<1u, double>, C = Cell] -/home/hjf9/preheat/defrost_c/install/include/Field/Field.cpp:413: note: IndexedField<T, Dim, Dim, M, C> Field<T, D, M, C>::operator[](const NDIndex<Dim2>&) [with T = double, unsigned int Dim = 1u, M = UniformCartesian<1u, double>, C = Cell] -/home/hjf9/preheat/defrost_c/install/include/Field/Field.cpp:423: note: SubField<T, Dim, M, C, SIndex<Dim> > Field<T, D, M, C>::operator[](const SIndex<Dim>&) [with T = double, unsigned int Dim = 1u, M = UniformCartesian<1u, double>, C = Cell] -yfld_q1.cpp:105: error: no match for ‘operator[]’ in ‘kernel[operator*(const PETE_Expr<T>&, double) [with T = PETE_TUTree<FnSqrt, PETE_TBTree<OpAdd, PETE_TBTree<OpAdd, PETE_TBTree<OpMultipply, PETE_TBTree<OpSubtract, Index::cursor, PETE_Scalar<double> >, PETE_TBTree<OpSubtract, Index::cursor, PETE_Scalar<double> > >, PETE_TBTree<OpMultipply, PETE_TBTree<OpSubtract, Index::cursor, PETE_Scalar<double> >, PETE_TBTree<OpSubtract, Index::cursor, PETE_Scalar<double> > > >, PETE_TBTree<OpMultipply, PETE_TBTree<OpSubtract, Index::cursor, PETE_Scalar<double> >, PETE_TBTree<OpSubtract, Index::cursor, PETE_Scalar<double> > > > >](1.6e+1)]’ -/home/hjf9/preheat/defrost_c/install/include/Field/Field.cpp:393: note: candidates are: IndexedField<T, Dim, 1u, M, C> Field<T, D, M, C>::operator[](const Index&) [with T = double, unsigned int Dim = 1u, M = UniformCartesian<1u, double>, C = Cell] -/home/hjf9/preheat/defrost_c/install/include/Field/Field.cpp:403: note: IndexedField<T, Dim, 1u, M, C> Field<T, D, M, C>::operator[](int) [with T = double, unsigned int Dim = 1u, M = UniformCartesian<1u, double>, C = Cell] -/home/hjf9/preheat/defrost_c/install/include/Field/Field.cpp:413: note: IndexedField<T, Dim, Dim, M, C> Field<T, D, M, C>::operator[](const NDIndex<Dim2>&) [with T = double, unsigned int Dim = 1u, M = UniformCartesian<1u, double>, C = Cell] -/home/hjf9/preheat/defrost_c/install/include/Field/Field.cpp:423: note: SubField<T, Dim, M, C, SIndex<Dim> > Field<T, D, M, C>::operator[](const SIndex<Dim>&) [with T = double, unsigned int Dim = 1u, M = UniformCartesian<1u, double>, C = Cell] -make: *** [yfld_q1] Error 1 diff --git a/ippl/test/adaTests/CMakeLists.txt b/ippl/test/adaTests/CMakeLists.txt deleted file mode 100644 index e2b74ac85430e0b96a0ade240d790e98650b7664..0000000000000000000000000000000000000000 --- a/ippl/test/adaTests/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -file (RELATIVE_PATH _relPath "${CMAKE_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}") -message (STATUS "Only found stub of CMakeList.txt in ${_relPath}") - -# vi: set et ts=4 sw=4 sts=4: - -# Local Variables: -# mode: cmake -# cmake-tab-width: 4 -# indent-tabs-mode: nil -# End: diff --git a/ippl/test/adaTests/TestDot1.cpp b/ippl/test/adaTests/TestDot1.cpp deleted file mode 100644 index 80e2febc293eb2898856de86e5ec13bfe65d6acb..0000000000000000000000000000000000000000 --- a/ippl/test/adaTests/TestDot1.cpp +++ /dev/null @@ -1,50 +0,0 @@ -// -*- C++ -*- -/*************************************************************************** - * - * The IPPL Framework - * - * This program was prepared by PSI. - * All rights in the program are reserved by PSI. - * Neither PSI nor the author(s) - * makes any warranty, express or implied, or assumes any liability or - * responsibility for the use of this software - * - ***************************************************************************/ - -// include files -#include "Ippl.h" - -// set dimensionality and problem size -const unsigned Dim = 3; - -int main(int argc, char *argv[]) -{ - Ippl ippl(argc,argv); - Inform testmsg(argv[0]); - - Vektor<double,Dim> boxMin(-1.0,-1.0,-1.0); - Vektor<double,Dim> boxMax( 1.0, 1.0, 1.0); - - Vektor<double,Dim> p1( .5, .5, .5); - Vektor<double,Dim> p2( 1.5, 1.5, 1.5); - - if ( dot(p1,p1) <= dot(boxMax,boxMax)) - testmsg << p1 << " is in the box" << endl; - else - testmsg << p1 << " is out of the box" << endl; - - if ( dot(p2,p2) <= dot(boxMax,boxMax)) - testmsg << p2 << " is in the box" << endl; - else - testmsg << p2 << " is out of the box" << endl; - - - - return 0; -} - -/*************************************************************************** - * $RCSfile: TestDot1.cpp,v $ $Author: adelmann $ - * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:38 $ - * IPPL_VERSION_ID: $Id: TestDot1.cpp,v 1.1.1.1 2003/01/23 07:40:38 adelmann Exp $ - ***************************************************************************/ diff --git a/ippl/test/adaTests/TestDot2.cpp b/ippl/test/adaTests/TestDot2.cpp deleted file mode 100644 index d606ee88d923fdf6454ac726cf7d4a83bb7bbd83..0000000000000000000000000000000000000000 --- a/ippl/test/adaTests/TestDot2.cpp +++ /dev/null @@ -1,51 +0,0 @@ -// -*- C++ -*- -/*************************************************************************** - * - * The IPPL Framework - * - * This program was prepared by PSI. - * All rights in the program are reserved by PSI. - * Neither PSI nor the author(s) - * makes any warranty, express or implied, or assumes any liability or - * responsibility for the use of this software - * - ***************************************************************************/ - -// -*- C++ -*- -#include "Ippl.h" - -// set dimensionality and problem size -const unsigned Dim = 3; - -int main(int argc, char *argv[]) -{ - Ippl ippl(argc,argv); - Inform testmsg(argv[0]); - - Vektor<double,Dim> boxMin(atof(argv[1]),atof(argv[2]),atof(argv[3])); - Vektor<double,Dim> boxMax(atof(argv[4]),atof(argv[5]),atof(argv[6])); - Vektor<double,Dim> h(1.0e-2, 1.0e-2, 0.5e-2); - - Vektor<double,Dim> p1(atof(argv[7]),atof(argv[8]),atof(argv[9])); - - Vektor<unsigned,Dim> N(static_cast<unsigned> (ceil( (abs(boxMin[0])+boxMax[0])/h[0])), - static_cast<unsigned> (ceil( (abs(boxMin[1])+boxMax[1])/h[1])), - static_cast<unsigned> (ceil( (abs(boxMin[2])+boxMax[2])/h[2]))); - - testmsg << "orig= " << boxMin << " maxext= " << boxMax << endl; - testmsg << "h= " << h << " N= " << N << endl; - testmsg << "p1= " << p1 << endl; - - /* - p1 -> n - */ - - testmsg << "n(p1)= " << -(boxMin-p1)/h << endl; - return 0; -} - -/*************************************************************************** - * $RCSfile: TestDot2.cpp,v $ $Author: adelmann $ - * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:38 $ - * IPPL_VERSION_ID: $Id: TestDot2.cpp,v 1.1.1.1 2003/01/23 07:40:38 adelmann Exp $ - ***************************************************************************/ diff --git a/ippl/test/simple/ReadMe b/ippl/test/simple/ReadMe deleted file mode 100755 index df4e421413f1be2f2e4ce5e4caea55c19afee971..0000000000000000000000000000000000000000 --- a/ippl/test/simple/ReadMe +++ /dev/null @@ -1 +0,0 @@ -deleted by acident: tindex.cpp 30-11-2000 diff --git a/ippl/test/simple/Slice.cpp b/ippl/test/simple/Slice.cpp deleted file mode 100644 index f03e23bb600c59f98c420e7aabb9438c7f39c357..0000000000000000000000000000000000000000 --- a/ippl/test/simple/Slice.cpp +++ /dev/null @@ -1,110 +0,0 @@ -// -*- C++ -*- -/*************************************************************************** - * - * The IPPL Framework - * - * This program was prepared by PSI. - * All rights in the program are reserved by PSI. - * Neither PSI nor the author(s) - * makes any warranty, express or implied, or assumes any liability or - * responsibility for the use of this software - * - * Visit http://www.acl.lanl.gov/POOMS for more details - * - ***************************************************************************/ - -// -*- C++ -*- -/*************************************************************************** - * - * The IPPL Framework - * - * - * Visit http://people.web.psi.ch/adelmann/ for more details - * - ***************************************************************************/ - -// include files -#include "Utility/IpplInfo.h" -#include "Utility/Inform.h" -#include "Utility/FieldView.h" -#include "Index/Index.h" -#include "FieldLayout/FieldLayout.h" -#include "Field/Field.h" -#include "Field/GuardCellSizes.h" - -#ifdef IPPL_USE_STANDARD_HEADERS -#include <iostream> -using namespace std; -#else -#include <iostream> -#endif - -#include <math.h> - - -int main(int argc, char *argv[]) -{ - Ippl ippl(argc,argv); - Inform testmsg(argv[0]); - int in; - - cout << "input the number of vnodes" << endl; - int vnodes; - cin >> vnodes; - cout << "input the number of size" << endl; - int size; - cin >> size; - const unsigned Dim=3; - Index I(size), J(size), K(size); - FieldLayout<Dim> layout(I,J,K,PARALLEL,PARALLEL,PARALLEL, vnodes); - Field<double,Dim> X(layout), Y(layout), Z(layout); - Field<double,Dim> A(layout,GuardCellSizes<Dim>(1)); - cout << " Layout is: "<< endl ; - testmsg << layout << endl; - - double pi = 2.0*(4.0*atan(1.0))/size; - -#ifdef IPPL_USE_MEMBER_TEMPLATES - X[I][J][K] = pi * I; - Y[I][J][K] = pi * J; - Z[I][J][K] = pi * K; - A = sin(X)*cos(Y)*Z; -#else - X[I][J][K] << pi * I; - Y[I][J][K] << pi * J; - Z[I][J][K] << pi * K; - A << sin(X)*cos(Y)*Z; -#endif - - A.write("atest"); - - FieldView<double,Dim> plotX(0,A); - int ipplot; - for(ipplot = 0 ; ipplot<size; ipplot++) { - plotX.view(ipplot); - } - cout << "enter an integer to continue" << endl; - cin >> in; - - FieldView<double,Dim> plotY(1,A); - for(ipplot = 0 ; ipplot<size; ipplot++) { - plotY.view(ipplot); - } - cout << "enter an integer to continue" << endl; - cin >> in; - - FieldView<double,Dim> plotZ(2,A); - for(ipplot = 0 ; ipplot<size; ipplot++) { - plotZ.view(ipplot); - } - cout << "enter an integer to continue" << endl; - cin >> in; - - return 0; -} - -/*************************************************************************** - * $RCSfile: Slice.cpp,v $ $Author: adelmann $ - * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:38 $ - * IPPL_VERSION_ID: $Id: Slice.cpp,v 1.1.1.1 2003/01/23 07:40:38 adelmann Exp $ - ***************************************************************************/ diff --git a/ippl/test/simple/TestAverageVC_CV.cpp b/ippl/test/simple/TestAverageVC_CV.cpp deleted file mode 100644 index 5626fe2922be0dc754aa0968fe17f79a27c38155..0000000000000000000000000000000000000000 --- a/ippl/test/simple/TestAverageVC_CV.cpp +++ /dev/null @@ -1,150 +0,0 @@ -// -*- C++ -*- -/*************************************************************************** - * - * The IPPL Framework - * - * This program was prepared by PSI. - * All rights in the program are reserved by PSI. - * Neither PSI nor the author(s) - * makes any warranty, express or implied, or assumes any liability or - * responsibility for the use of this software - * - * Visit http://www.acl.lanl.gov/POOMS for more details - * - ***************************************************************************/ - -// -*- C++ -*- -/*************************************************************************** - * - * The IPPL Framework - * - * - * Visit http://people.web.psi.ch/adelmann/ for more details - * - ***************************************************************************/ - -// TestAverageVC_CV.cpp , Tim Williams 2/6/1997 -// This tests the Average functions in [Uniform]Cartesian class, which do -// weighted averages between Cell and Vertex centered Field's. - -// include files -#include "Utility/IpplInfo.h" -#include "Utility/Inform.h" -#include "Index/NDIndex.h" -#include "FieldLayout/FieldLayout.h" -#include "Field/Field.h" -#include "Field/GuardCellSizes.h" -#include "Meshes/UniformCartesian.h" -#include "AppTypes/Vektor.h" - -// set dimensionality and problem size -const unsigned Dim3 = 3; -const unsigned nx = 4, ny = 4, nz = 4; - - -int main(int argc, char *argv[]) -{ - Ippl ippl(argc,argv); - Inform testmsg(argv[0]); - bool passed = true; // Pass/fail test - - GuardCellSizes<Dim3> gc(1); - Index I(nx); - Index J(ny); - Index K(nz); - FieldLayout<Dim3> layoutVert(I,J,K); - Index Ic(nx-1); - Index Jc(ny-1); - Index Kc(nz-1); - FieldLayout<Dim3> layoutCell(Ic,Jc,Kc); - - // Scalar Field, Cell-Centered - Field<double,Dim3,UniformCartesian<Dim3>,Cell> C(layoutCell,gc); - C = 1.0; - - // Scalar weight Field, Cell-Centered - Field<double,Dim3,UniformCartesian<Dim3>,Cell> wC(layoutCell,gc); - wC = 2.0; - - // Scalar Field, Vert-Centered - Field<double,Dim3,UniformCartesian<Dim3>,Vert> V(layoutVert,gc); - V = 1.0; - - // Scalar weight Field, Vert-Centered - Field<double,Dim3,UniformCartesian<Dim3>,Vert> wV(layoutVert,gc); - wV = 2.0; - - // Field's to hold weighted averages: - Field<double,Dim3,UniformCartesian<Dim3>,Cell> avgToC(layoutCell,gc); - Field<double,Dim3,UniformCartesian<Dim3>,Vert> avgToV(layoutVert,gc); - - // Weighted average from Cell to Vert: - assign(avgToV, Average(C, wC, avgToV)); - - // Weighted average from Vert to Cell: - assign(avgToC, Average(V, wV, avgToC)); - - // Weight from Field<Vektor,Vert> to Field<Vektor,Cell>, using scalar - // weight field wV (Field<double,Vert>) - // Vector Field, Cell-centered - Field<Vektor<double,Dim3>,Dim3,UniformCartesian<Dim3>,Vert> - vV(layoutVert,gc); - Field<Vektor<double,Dim3>,Dim3,UniformCartesian<Dim3>,Cell> - avgToCSW(layoutCell,gc); - Vektor<double,Dim3> ones; - for (int d=0; d < Dim3; d++) ones(d) = 1.0; - vV = ones; - assign(avgToCSW, Average(vV, wV, avgToCSW)); - - // Check results: - if (sum(avgToV) != nx*ny*nz) { - passed = false; - testmsg << "Test of avgToV failed." << endl; - } - if (sum(avgToC) != (nx-1)*(ny-1)*(nz-1)) { - passed = false; - testmsg << "Test of avgToC failed." << endl; - } - // Following triggers two IPPL bugs: - // 1) unsigned*Vektor<double,Dim> doesn't work, have to cast the - // unsigned to a double - // 2) sum(Field<Vektor,...>,...>) doesn't work. - // if (sum(avgToCSW) != (nx-1)*(ny-1)*(nz-1)*ones) passed = false; - // WORKAROUND: - Field<Vektor<double,Dim3>,Dim3,UniformCartesian<Dim3>,Cell>::iterator fi; - Vektor<double,Dim3> thesum = 0.0; - Vektor<double,Dim3> globalSum = 0.0; - for (fi = avgToCSW.begin(); fi != avgToCSW.end(); ++fi) thesum += *fi; - // This gets the global sum to every PE's copy when multiprocessing: - globalSum = thesum; - reduce(globalSum, globalSum, OpAddAssign()); - if (globalSum != ((double)(nx-1)*(ny-1)*(nz-1))*ones) { - passed = false; - testmsg << "Test of avgToCSW failed." << endl; - } - - // Test one of the unweighted (2-argument) Average() functions: - // Average from Field<Vektor,Vert> to Field<Vektor,Cell> - // Vector Field, Cell-centered - Field<Vektor<double,Dim3>,Dim3,UniformCartesian<Dim3>,Vert> - vVu(layoutVert,gc); - Field<Vektor<double,Dim3>,Dim3,UniformCartesian<Dim3>,Cell> - avgToCSu(layoutCell,gc); - vVu = ones; - assign(avgToCSu, Average(vV, avgToCSu)); - // Check results: - if (sum(avgToCSu) != (nx-1)*(ny-1)*(nz-1)) { - passed = false; - testmsg << "Test of avgToCSu failed." << endl; - } - - - testmsg << ( (passed) ? "PASSED" : "FAILED" ) << endl; - return 0; -} - -/*************************************************************************** - * $RCSfile: TestAverageVC_CV.cpp,v $ $Author: adelmann $ - * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:38 $ - * IPPL_VERSION_ID: $Id: TestAverageVC_CV.cpp,v 1.1.1.1 2003/01/23 07:40:38 adelmann Exp $ - ***************************************************************************/ diff --git a/ippl/test/simple/TestBC.cpp b/ippl/test/simple/TestBC.cpp deleted file mode 100644 index 8a248ab40711f3043b04a451ac381a0977200984..0000000000000000000000000000000000000000 --- a/ippl/test/simple/TestBC.cpp +++ /dev/null @@ -1,2951 +0,0 @@ -// -*- C++ -*- -/*************************************************************************** - * - * The IPPL Framework - * - * This program was prepared by PSI. - * All rights in the program are reserved by PSI. - * Neither PSI nor the author(s) - * makes any warranty, express or implied, or assumes any liability or - * responsibility for the use of this software - * - * Visit http://www.acl.lanl.gov/POOMS for more details - * - ***************************************************************************/ - -// -*- C++ -*- -/*************************************************************************** - * - * The IPPL Framework - * - * - * Visit http://people.web.psi.ch/adelmann/ for more details - * - ***************************************************************************/ - -// TestBC.cpp -// Various tests of BCond* classes. - -// include files -#include "Utility/IpplInfo.h" -#include "Utility/Inform.h" -#include "Index/NDIndex.h" -#include "FieldLayout/CenteredFieldLayout.h" -#include "Field/Field.h" -#include "Field/BCond.h" -#include "Meshes/UniformCartesian.h" -#include "AppTypes/Vektor.h" -#include "Utility/FieldDebug.h" - -#ifdef IPPL_USE_STANDARD_HEADERS -#include <fstream> -using namespace std; -#else -#include <fstream> -#endif - -// forward declarations -#ifdef __MWERKS__ -// Work around compiler limitation with really long hardCodedOutput() function. -void hardCodedOutput1(ofstream& of); // Prototype of function defined below. -void hardCodedOutput2(ofstream& of); // Prototype of function defined below. -void hardCodedOutput3(ofstream& of); // Prototype of function defined below. -void hardCodedOutput4(ofstream& of); // Prototype of function defined below. -#else -void hardCodedOutput(char* filename); // Prototype of function defined below. -#endif // __MWERKS__ -bool thediff(char* filename1, char* filename2); - - -int main(int argc, char *argv[]) -{ - Ippl ippl(argc, argv); - Inform testmsg(argv[0]); - bool passed = true; // Pass/fail test - - // For writing file output to compare against hardcoded correct file output: - Inform fdi(NULL,"text.test.TestBC",Inform::OVERWRITE,0); - setInform(fdi); - - const unsigned Dim = 2; - Index I(5); - Index J(5); - NDIndex<Dim> domain; - domain[0] = I; - domain[1] = J; - FieldLayout<Dim> layout(domain); - typedef UniformCartesian<Dim> M; - - // Set Cell-centered boundary conditions. - BConds<double,Dim,M,Cell> cbc; - cbc[0] = new NegReflectFace<double,Dim,M,Cell>(0); - cbc[1] = new ZeroFace<double,Dim,M,Cell>(1); - cbc[2] = new ParallelPeriodicFace<double,Dim,M,Cell>(2); - cbc[3] = new ParallelPeriodicFace<double,Dim,M,Cell>(3); - fdi << "++++++++BConds object cbc begin++++++++" << endl; - fdi << cbc; - fdi << "++++++++BConds object cbc end++++++++++" << endl; - - // Cell-centered test Field's: - testmsg << "layout: " << layout << endl; - Field<double,Dim,M,Cell> cA(layout,GuardCellSizes<Dim>(2),cbc); - Field<double,Dim,M,Cell> cB(layout); - - // Set Vert-centered boundary conditions. - BConds<double,Dim,M,Vert> vbc; - vbc[0] = new NegReflectFace<double,Dim,M,Vert>(0); - vbc[1] = new ZeroFace<double,Dim,M,Vert>(1); - vbc[2] = new ParallelPeriodicFace<double,Dim,M,Vert>(2); - vbc[3] = new ParallelPeriodicFace<double,Dim,M,Vert>(3); - // Vert-centered test Field's: - Field<double,Dim,M,Vert> vA(layout,GuardCellSizes<Dim>(2),vbc); - Field<double,Dim,M,Vert> vB(layout); - - // Assign reference values: - int i,j; - unsigned counter=0; - double value; - for (j=0; j<5; j++) { - for (i=0; i<5; i++) { - value = counter++; - assign(cA[i][j], value); - assign(vA[i][j], value); - } - } - - // Print reference values, then assign values ofsetting across boundaries - // and print results, Cell-centered case: - fdi << "++++++++++cA+++++++++++" << endl ; - fp2(cA); - cB[I][J] = cA[I-2][J-2]; - fdi << "++++++++++cB+++++++++++" << endl ; - fp2(cB); - - // Print reference values, then assign values ofsetting across boundaries - // and print results, Vert-centered case: - fdi << "++++++++++vA+++++++++++" << endl ; - fp2(vA); - vB[I][J] = vA[I-2][J-2]; - fdi << "++++++++++vB+++++++++++" << endl ; - fp2(vB); - - // Componentwise specification of BC's for a Field<Vektor> - // Set Cell-centered boundary conditions. - BConds<Vektor<double,Dim>,Dim,M,Cell> vcbc; - vcbc[0] = new NegReflectFace<Vektor<double,Dim>,Dim,M,Cell>(0,0); - vcbc[1] = new PosReflectFace<Vektor<double,Dim>,Dim,M,Cell>(0,1); - vcbc[2] = new NegReflectFace<Vektor<double,Dim>,Dim,M,Cell>(1,0); - vcbc[3] = new PosReflectFace<Vektor<double,Dim>,Dim,M,Cell>(1,1); - vcbc[4] = new ZeroFace<Vektor<double,Dim>,Dim,M,Cell>(2); - vcbc[5] = new ZeroFace<Vektor<double,Dim>,Dim,M,Cell>(3); - // Cell-centered test Field's: - Field<Vektor<double,Dim>,Dim,M,Cell> vcA(layout,GuardCellSizes<Dim>(2),vcbc); - Field<Vektor<double,Dim>,Dim,M,Cell> vcB(layout); - // Assign reference values: - counter=0; - value=0.0; - for (j=0; j<5; j++) { - for (i=0; i<5; i++) { - value = counter++; - assign(vcA[i][j], (Vektor<double,Dim>)value); - } - } - // Print reference values, then assign values ofsetting across boundaries - // and print results, Cell-centered case: - setFormat(2,2); - fdi << "++++++++++vcA+++++++++++" << endl ; - fp2(vcA); - vcB[I][J] = vcA[I-2][J]; - fdi << "++++++++++vcB+++++++++++" << endl ; - fp2(vcB); - - - // Componentwise specification of BC's for a Field<Vektor> - // Set CartesianCentering-centered boundary conditions. - typedef CommonCartesianCenterings<Dim,2U>::vectorFace vFace; - - // For clarity, construct a mesh. Here, 5 is taken as the number of verts: - M mesh(I,J); - CenteredFieldLayout<Dim,M,vFace> layoutVFace(mesh); - testmsg << "layoutVFace: " << layoutVFace << endl; - - BConds<Vektor<double,Dim>,Dim,M,vFace> vfbc; - vfbc[0] = new NegReflectFace<Vektor<double,Dim>,Dim,M,vFace>(0,0); - vfbc[1] = new PosReflectFace<Vektor<double,Dim>,Dim,M,vFace>(0,1); - vfbc[2] = new NegReflectFace<Vektor<double,Dim>,Dim,M,vFace>(1,0); - vfbc[3] = new PosReflectFace<Vektor<double,Dim>,Dim,M,vFace>(1,1); - if (Ippl::getNodes() == 1) { - vfbc[4] = new PeriodicFace<Vektor<double,Dim>,Dim,M,vFace>(2,0); - vfbc[5] = new PeriodicFace<Vektor<double,Dim>,Dim,M,vFace>(2,1); - vfbc[6] = new PeriodicFace<Vektor<double,Dim>,Dim,M,vFace>(3,0); - vfbc[7] = new PeriodicFace<Vektor<double,Dim>,Dim,M,vFace>(3,1); - } - else { - vfbc[4] = new ParallelPeriodicFace<Vektor<double,Dim>,Dim,M,vFace>(2,0); - vfbc[5] = new ParallelPeriodicFace<Vektor<double,Dim>,Dim,M,vFace>(2,1); - vfbc[6] = new ParallelPeriodicFace<Vektor<double,Dim>,Dim,M,vFace>(3,0); - vfbc[7] = new ParallelPeriodicFace<Vektor<double,Dim>,Dim,M,vFace>(3,1); - } - // vFace-centered test Field's: - Field<Vektor<double,Dim>,Dim,M,vFace> - vfA(layoutVFace,GuardCellSizes<Dim>(2),vfbc); - Field<Vektor<double,Dim>,Dim,M,vFace> vfB(layoutVFace); - // Assign red-flag values for to make inaccessible vector components visible: - vfA = 9.99; - vfB = 9.99; - // Assign reference values: - counter=0; - value=0.0; - Index Iverts(5); - Index Jverts(5); - Index Icells(4); - Index Jcells(4); - assign(vfA[Iverts][Jcells](0), Iverts + Jcells*5.0); - assign(vfA[Icells][Jverts](1), Icells + Jverts*5.0); - // Print reference values, then assign values ofsetting across boundaries - // and print results, vFace-centered case: - setFormat(2,2); - - // Set up for 3D Field's: - const unsigned Dim3 = 3; - Index K(5); - FieldLayout<Dim3> layout3(I,J,K); - typedef UniformCartesian<Dim3> M3; - // Componentwise specification of BC's for a Cell-centered Field<SymTenzor> - // Set boundary conditions, positive reflecting on diagonal, negative - // reflecting on off-diagonal: - typedef SymTenzor<double,Dim3> ST; - BConds<ST,Dim3,M3,Cell> tcc; - // Face 0 - tcc[0] = new PosReflectFace<ST,Dim3,M3,Cell>(0,0,0); - tcc[1] = new PosReflectFace<ST,Dim3,M3,Cell>(0,1,1); - tcc[2] = new PosReflectFace<ST,Dim3,M3,Cell>(0,2,2); - tcc[3] = new NegReflectFace<ST,Dim3,M3,Cell>(0,1,0); - tcc[4] = new NegReflectFace<ST,Dim3,M3,Cell>(0,2,0); - tcc[5] = new NegReflectFace<ST,Dim3,M3,Cell>(0,2,1); - // Face 1 - tcc[6] = new PosReflectFace<ST,Dim3,M3,Cell>(1,0,0); - tcc[7] = new PosReflectFace<ST,Dim3,M3,Cell>(1,1,1); - tcc[8] = new PosReflectFace<ST,Dim3,M3,Cell>(1,2,2); - tcc[9] = new NegReflectFace<ST,Dim3,M3,Cell>(1,1,0); - tcc[10] = new NegReflectFace<ST,Dim3,M3,Cell>(1,2,0); - tcc[11] = new NegReflectFace<ST,Dim3,M3,Cell>(1,2,1); - // Face 2 - tcc[12] = new PosReflectFace<ST,Dim3,M3,Cell>(2,0,0); - tcc[13] = new PosReflectFace<ST,Dim3,M3,Cell>(2,1,1); - tcc[14] = new PosReflectFace<ST,Dim3,M3,Cell>(2,2,2); - tcc[15] = new NegReflectFace<ST,Dim3,M3,Cell>(2,1,0); - tcc[16] = new NegReflectFace<ST,Dim3,M3,Cell>(2,2,0); - tcc[17] = new NegReflectFace<ST,Dim3,M3,Cell>(2,2,1); - // Face 3 - tcc[18] = new PosReflectFace<ST,Dim3,M3,Cell>(3,0,0); - tcc[19] = new PosReflectFace<ST,Dim3,M3,Cell>(3,1,1); - tcc[20] = new PosReflectFace<ST,Dim3,M3,Cell>(3,2,2); - tcc[21] = new NegReflectFace<ST,Dim3,M3,Cell>(3,1,0); - tcc[22] = new NegReflectFace<ST,Dim3,M3,Cell>(3,2,0); - tcc[24] = new NegReflectFace<ST,Dim3,M3,Cell>(3,2,1); - - // Cell-centered test Field's: - Field<ST,Dim3,M3,Cell> sA(layout3,GuardCellSizes<Dim3>(2),tcc); - Field<ST,Dim3,M3,Cell> sB(layout3); - // Assign reference values: - sA[I][J][K] = (I + J + K); - // Print reference values, then assign values ofsetting across boundaries - // and print results, Cell-centered case: - setFormat(1,2); - fdi << "++++++++++sA+++++++++++" << endl ; - fp3(sA); - sB[I][J][K] = sA[I-2][J][K]; - fdi << "++++++++++sB+++++++++++" << endl ; - fp3(sB); - - // Componentwise specification of BC's for a Field<Vektor> Set - // CartesianCenting-centered boundary conditions. - // TJW 12/16/97: this differs from earlier one in that it uses - // NegFeflectZeroFace instead of NegReflectFace. This tests the new - // NegReflectZeroFace BC, which sets last *physical* layers of vert-centered - // quantities/components to zero. Another difference from the earlier one: I - // put in GC and BC on the "B" and (new) "C" Field's, so that BC are applied - // to the results of the stencil ops. - BConds<Vektor<double,Dim>,Dim,M,vFace> vfbcz; - vfbcz[0] = new NegReflectAndZeroFace<Vektor<double,Dim>,Dim,M,vFace>(0,0); - vfbcz[1] = new PosReflectFace<Vektor<double,Dim>,Dim,M,vFace>(0,1); - vfbcz[2] = new NegReflectAndZeroFace<Vektor<double,Dim>,Dim,M,vFace>(1,0); - vfbcz[3] = new PosReflectFace<Vektor<double,Dim>,Dim,M,vFace>(1,1); - vfbcz[4] = new PosReflectFace<Vektor<double,Dim>,Dim,M,vFace>(2,0); - vfbcz[5] = new NegReflectAndZeroFace<Vektor<double,Dim>,Dim,M,vFace>(2,1); - vfbcz[6] = new PosReflectFace<Vektor<double,Dim>,Dim,M,vFace>(3,0); - vfbcz[7] = new NegReflectAndZeroFace<Vektor<double,Dim>,Dim,M,vFace>(3,1); - // vFace-centered test Field's: - Field<Vektor<double,Dim>,Dim,M,vFace> - vfzA(layout,GuardCellSizes<Dim>(2),vfbcz); - Field<Vektor<double,Dim>,Dim,M,vFace> - vfzB(layout,GuardCellSizes<Dim>(2),vfbcz); - Field<Vektor<double,Dim>,Dim,M,vFace> - vfzC(layout,GuardCellSizes<Dim>(2),vfbcz); - // Assign reference values: - counter=0; - value=0.0; - for (j=0; j<5; j++) { - for (i=0; i<5; i++) { - value = counter++; - assign(vfzA[i][j], (Vektor<double,Dim>)value); - } - } - // Print reference values, then assign values ofsetting across boundaries - // and print results, vfzace-centered case: - setFormat(2,2); - fdi << "++++++++++vfzA+++++++++++" << endl ; - fp2(vfzA); - vfzB[I][J] = vfzA[I-2][J]; - fdi << "++++++++++vfzB+++++++++++" << endl ; - fp2(vfzB); - vfzC[I][J] = vfzA[I-2][J-2]; - fdi << "++++++++++vfzC+++++++++++" << endl ; - fp2(vfzC); - - // Test NegReflectZeroFace BC with Vert centering (componentwise BC): - BConds<Vektor<double,Dim>,Dim,M,Vert> vbcz; - vbcz[0] = new NegReflectAndZeroFace<Vektor<double,Dim>,Dim,M,Vert>(0,0); - vbcz[1] = new PosReflectFace<Vektor<double,Dim>,Dim,M,Vert>(0,1); - vbcz[2] = new NegReflectAndZeroFace<Vektor<double,Dim>,Dim,M,Vert>(1,0); - vbcz[3] = new PosReflectFace<Vektor<double,Dim>,Dim,M,Vert>(1,1); - vbcz[4] = new PosReflectFace<Vektor<double,Dim>,Dim,M,Vert>(2,0); - vbcz[5] = new NegReflectAndZeroFace<Vektor<double,Dim>,Dim,M,Vert>(2,1); - vbcz[6] = new PosReflectFace<Vektor<double,Dim>,Dim,M,Vert>(3,0); - vbcz[7] = new NegReflectAndZeroFace<Vektor<double,Dim>,Dim,M,Vert>(3,1); - // vFace-centered test Field's: - Field<Vektor<double,Dim>,Dim,M,Vert> vzA(layout,GuardCellSizes<Dim>(2),vbcz); - Field<Vektor<double,Dim>,Dim,M,Vert> vzB(layout,GuardCellSizes<Dim>(2),vbcz); - Field<Vektor<double,Dim>,Dim,M,Vert> vzC(layout,GuardCellSizes<Dim>(2),vbcz); - // Assign reference values: - counter=0; - value=0.0; - for (j=0; j<5; j++) { - for (i=0; i<5; i++) { - value = counter++; - assign(vzA[i][j], (Vektor<double,Dim>)value); - } - } - // Print reference values, then assign values ofsetting across boundaries - // and print results, vert-centered case: - setFormat(2,2); - fdi << "++++++++++vzA+++++++++++" << endl ; - fp2(vzA); - vzB[I][J] = vzA[I-2][J]; - fdi << "++++++++++vzB+++++++++++" << endl ; - fp2(vzB); - vzC[I][J] = vzA[I-2][J-2]; - fdi << "++++++++++vzC+++++++++++" << endl ; - fp2(vzC); - - fdi << endl ; // Needed to flush output to file - - // Write out "by hand" into another file what the previous field-printing - // functions should have produced; this will be compared with what they - // actually did produce: -#ifdef __MWERKS__ - // Work around compiler limitation with really long hardCodedOutput() - // function. - ofstream of("text.correct.TestBC"); - hardCodedOutput1(of); - hardCodedOutput2(of); - hardCodedOutput3(of); - hardCodedOutput4(of); - of.close; -#else - hardCodedOutput("text.correct.TestBC"); -#endif // __MWERKS__ - - // Compare the two files by mocking up the Unix "diff" command: - passed = thediff("text.test.TestBC", - "text.correct.TestBC"); - - testmsg << ( (passed) ? "PASSED" : "FAILED" ) << endl; - return 0; -} - -//----------------------------------------------------------------------------- -// Mock up the Unix "diff" utility to compare two files: -//----------------------------------------------------------------------------- -bool thediff(char* filename1, char* filename2) -{ - bool same = true; - char ch1, ch2; - ifstream file1(filename1); - ifstream file2(filename2); - while (file1.get(ch1)) { // Read file 1 char-by-char until eof - if (file2.get(ch2)) { // Read equivalent char from file 2 - if (ch1 != ch2) same = false; // If they're different,files are different - } - else { - same = false; // If file 2 ends before file 1, different - } - } - return same; -} - -#ifdef __MWERKS__ - // Work around compiler limitation with really long hardCodedOutput() - // function. -//----------------------------------------------------------------------------- -void hardCodedOutput1(ofstream& of) -{ - of << "++++++++BConds object cbc begin++++++++" << endl; - of << "BConds:(" << endl; - of << "NegReflectFace, Face=0 , " << endl; - of << "ZeroFace, Face=1 , " << endl; - of << "ParallelPeriodicFace, Face=2 , " << endl; - of << "ParallelPeriodicFace, Face=3" << endl; - of << ")" << endl; - of << "" << endl; - of << "++++++++BConds object cbc end++++++++++" << endl; - of << "++++++++++cA+++++++++++" << endl; - of << "~~~~~~~~ field slice (0:4:1, 0:4:1) ~~~~~~~~" << endl; - of << "--------------------------------------------------J = 0" << endl; - of << "0.000e+00 1.000e+00 2.000e+00 3.000e+00 4.000e+00 " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 1" << endl; - of << "5.000e+00 6.000e+00 7.000e+00 8.000e+00 9.000e+00 " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 2" << endl; - of << "1.000e+01 1.100e+01 1.200e+01 1.300e+01 1.400e+01 " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 3" << endl; - of << "1.500e+01 1.600e+01 1.700e+01 1.800e+01 1.900e+01 " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 4" << endl; - of << "2.000e+01 2.100e+01 2.200e+01 2.300e+01 2.400e+01 " << endl; - of << "" << endl; - of << "++++++++++cB+++++++++++" << endl; - of << "~~~~~~~~ field slice (0:4:1, 0:4:1) ~~~~~~~~" << endl; - of << "--------------------------------------------------J = 0" << endl; - of << "-1.600e+01 -1.500e+01 1.500e+01 1.600e+01 1.700e+01 " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 1" << endl; - of << "-2.100e+01 -2.000e+01 2.000e+01 2.100e+01 2.200e+01 " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 2" << endl; - of << "-1.000e+00 0.000e+00 0.000e+00 1.000e+00 2.000e+00 " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 3" << endl; - of << "-6.000e+00 -5.000e+00 5.000e+00 6.000e+00 7.000e+00 " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 4" << endl; - of << "-1.100e+01 -1.000e+01 1.000e+01 1.100e+01 1.200e+01 " << endl; - of << "" << endl; - of << "++++++++++vA+++++++++++" << endl; - of << "~~~~~~~~ field slice (0:4:1, 0:4:1) ~~~~~~~~" << endl; - of << "--------------------------------------------------J = 0" << endl; - of << "0.000e+00 1.000e+00 2.000e+00 3.000e+00 4.000e+00 " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 1" << endl; - of << "5.000e+00 6.000e+00 7.000e+00 8.000e+00 9.000e+00 " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 2" << endl; - of << "1.000e+01 1.100e+01 1.200e+01 1.300e+01 1.400e+01 " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 3" << endl; - of << "1.500e+01 1.600e+01 1.700e+01 1.800e+01 1.900e+01 " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 4" << endl; - of << "0.000e+00 1.000e+00 2.000e+00 3.000e+00 4.000e+00 " << endl; - of << "" << endl; - of << "++++++++++vB+++++++++++" << endl; - of << "~~~~~~~~ field slice (0:4:1, 0:4:1) ~~~~~~~~" << endl; - of << "--------------------------------------------------J = 0" << endl; - of << "-1.200e+01 -1.100e+01 1.000e+01 1.100e+01 1.200e+01 " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 1" << endl; - of << "-1.700e+01 -1.600e+01 1.500e+01 1.600e+01 1.700e+01 " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 2" << endl; - of << "-2.000e+00 -1.000e+00 0.000e+00 1.000e+00 2.000e+00 " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 3" << endl; - of << "-7.000e+00 -6.000e+00 5.000e+00 6.000e+00 7.000e+00 " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 4" << endl; - of << "-1.200e+01 -1.100e+01 1.000e+01 1.100e+01 1.200e+01 " << endl; - of << "" << endl; - of << "++++++++++vcA+++++++++++" << endl; - of << "~~~~~~~~ field slice (0:4:1, 0:4:1) ~~~~~~~~" << endl; - of << "--------------------------------------------------J = 0" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( 1.00e+00 , 1.00e+00 )" << endl; - of << "( 2.00e+00 , 2.00e+00 ) ( 3.00e+00 , 3.00e+00 )" << endl; - of << "( 4.00e+00 , 4.00e+00 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 1" << endl; - of << "( 5.00e+00 , 5.00e+00 ) ( 6.00e+00 , 6.00e+00 )" << endl; - of << "( 7.00e+00 , 7.00e+00 ) ( 8.00e+00 , 8.00e+00 )" << endl; - of << "( 9.00e+00 , 9.00e+00 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 2" << endl; - of << "( 1.00e+01 , 1.00e+01 ) ( 1.10e+01 , 1.10e+01 )" << endl; - of << "( 1.20e+01 , 1.20e+01 ) ( 1.30e+01 , 1.30e+01 )" << endl; - of << "( 1.40e+01 , 1.40e+01 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 3" << endl; - of << "( 1.50e+01 , 1.50e+01 ) ( 1.60e+01 , 1.60e+01 )" << endl; - of << "( 1.70e+01 , 1.70e+01 ) ( 1.80e+01 , 1.80e+01 )" << endl; - of << "( 1.90e+01 , 1.90e+01 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 4" << endl; - of << "( 2.00e+01 , 2.00e+01 ) ( 2.10e+01 , 2.10e+01 )" << endl; - of << "( 2.20e+01 , 2.20e+01 ) ( 2.30e+01 , 2.30e+01 )" << endl; - of << "( 2.40e+01 , 2.40e+01 ) " << endl; - of << "" << endl; - of << "++++++++++vcB+++++++++++" << endl; - of << "~~~~~~~~ field slice (0:4:1, 0:4:1) ~~~~~~~~" << endl; - of << "--------------------------------------------------J = 0" << endl; - of << "( -1.00e+00 , 1.00e+00 ) ( 0.00e+00 , 0.00e+00 )" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( 1.00e+00 , 1.00e+00 )" << endl; - of << "( 2.00e+00 , 2.00e+00 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 1" << endl; - of << "( -6.00e+00 , 6.00e+00 ) ( -5.00e+00 , 5.00e+00 )" << endl; - of << "( 5.00e+00 , 5.00e+00 ) ( 6.00e+00 , 6.00e+00 )" << endl; - of << "( 7.00e+00 , 7.00e+00 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 2" << endl; - of << "( -1.10e+01 , 1.10e+01 ) ( -1.00e+01 , 1.00e+01 )" << endl; - of << "( 1.00e+01 , 1.00e+01 ) ( 1.10e+01 , 1.10e+01 )" << endl; - of << "( 1.20e+01 , 1.20e+01 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 3" << endl; - of << "( -1.60e+01 , 1.60e+01 ) ( -1.50e+01 , 1.50e+01 )" << endl; - of << "( 1.50e+01 , 1.50e+01 ) ( 1.60e+01 , 1.60e+01 )" << endl; - of << "( 1.70e+01 , 1.70e+01 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 4" << endl; - of << "( -2.10e+01 , 2.10e+01 ) ( -2.00e+01 , 2.00e+01 )" << endl; - of << "( 2.00e+01 , 2.00e+01 ) ( 2.10e+01 , 2.10e+01 )" << endl; - of << "( 2.20e+01 , 2.20e+01 ) " << endl; - of << "" << endl; - /* tjw: omit this test until componentwise ParallelPeriodicFace bug is fixed: - of << "++++++++++vfA+++++++++++" << endl; - of << "~~~~~~~~ field slice (0:4:1, 0:4:1) ~~~~~~~~" << endl; - of << "--------------------------------------------------J = 0" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( 1.00e+00 , 1.00e+00 )" << endl; - of << "( 2.00e+00 , 2.00e+00 ) ( 3.00e+00 , 3.00e+00 )" << endl; - of << "( 4.00e+00 , 3.00e+00 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 1" << endl; - of << "( 5.00e+00 , 5.00e+00 ) ( 6.00e+00 , 6.00e+00 )" << endl; - of << "( 7.00e+00 , 7.00e+00 ) ( 8.00e+00 , 8.00e+00 )" << endl; - of << "( 9.00e+00 , 8.00e+00 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 2" << endl; - of << "( 1.00e+01 , 1.00e+01 ) ( 1.10e+01 , 1.10e+01 )" << endl; - of << "( 1.20e+01 , 1.20e+01 ) ( 1.30e+01 , 1.30e+01 )" << endl; - of << "( 1.40e+01 , 1.30e+01 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 3" << endl; - of << "( 1.50e+01 , 1.50e+01 ) ( 1.60e+01 , 1.60e+01 )" << endl; - of << "( 1.70e+01 , 1.70e+01 ) ( 1.80e+01 , 1.80e+01 )" << endl; - of << "( 1.90e+01 , 1.80e+01 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 4" << endl; - of << "( 9.99e+00 , 0.00e+00 ) ( 9.99e+00 , 1.00e+00 )" << endl; - of << "( 9.99e+00 , 2.00e+00 ) ( 9.99e+00 , 3.00e+00 )" << endl; - of << "( 9.99e+00 , 3.00e+00 ) " << endl; - of << "" << endl; - of << "++++++++++vfB+++++++++++" << endl; - of << "~~~~~~~~ field slice (0:4:1, 0:4:1) ~~~~~~~~" << endl; - of << "--------------------------------------------------J = 0" << endl; - of << "( -2.00e+00 , 1.00e+00 ) ( -1.00e+00 , 0.00e+00 )" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( 1.00e+00 , 1.00e+00 )" << endl; - of << "( 2.00e+00 , 2.00e+00 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 1" << endl; - of << "( -7.00e+00 , 6.00e+00 ) ( -6.00e+00 , 5.00e+00 )" << endl; - of << "( 5.00e+00 , 5.00e+00 ) ( 6.00e+00 , 6.00e+00 )" << endl; - of << "( 7.00e+00 , 7.00e+00 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 2" << endl; - of << "( -1.20e+01 , 1.10e+01 ) ( -1.10e+01 , 1.00e+01 )" << endl; - of << "( 1.00e+01 , 1.00e+01 ) ( 1.10e+01 , 1.10e+01 )" << endl; - of << "( 1.20e+01 , 1.20e+01 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 3" << endl; - of << "( -1.70e+01 , 1.60e+01 ) ( -1.60e+01 , 1.50e+01 )" << endl; - of << "( 1.50e+01 , 1.50e+01 ) ( 1.60e+01 , 1.60e+01 )" << endl; - of << "( 1.70e+01 , 1.70e+01 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 4" << endl; - of << "( -9.99e+00 , 1.00e+00 ) ( -9.99e+00 , 0.00e+00 )" << endl; - of << "( 9.99e+00 , 0.00e+00 ) ( 9.99e+00 , 1.00e+00 )" << endl; - of << "( 9.99e+00 , 2.00e+00 ) " << endl; - of << "" << endl; - tjw: omit this test until componentwise ParallelPeriodicFace bug is fixed. */ - of << "++++++++++sA+++++++++++" << endl; - of << "~~~~~~~~ field slice (0:4:1, 0:4:1, 0:4:1) ~~~~~~~~" << endl; - of << "==================================================K = 0" << endl; - of << "--------------------------------------------------J = 0" << endl; - of << "(0.00e+00 , 0.00e+00 , 0.00e+00)"; - of << "(0.00e+00 , 0.00e+00 , 0.00e+00)"; - of << "(0.00e+00 , 0.00e+00 , 0.00e+00)" << endl; - of << "(1.00e+00 , 1.00e+00 , 1.00e+00)"; - of << "(1.00e+00 , 1.00e+00 , 1.00e+00)"; - of << "(1.00e+00 , 1.00e+00 , 1.00e+00)" << endl; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)" << endl; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 1" << endl; - of << "(1.00e+00 , 1.00e+00 , 1.00e+00)"; - of << "(1.00e+00 , 1.00e+00 , 1.00e+00)"; - of << "(1.00e+00 , 1.00e+00 , 1.00e+00)" << endl; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)" << endl; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 2" << endl; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)" << endl; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 3" << endl; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 4" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "==================================================K = 1" << endl; - of << "--------------------------------------------------J = 0" << endl; - of << "(1.00e+00 , 1.00e+00 , 1.00e+00)"; - of << "(1.00e+00 , 1.00e+00 , 1.00e+00)"; - of << "(1.00e+00 , 1.00e+00 , 1.00e+00)" << endl; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)" << endl; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 1" << endl; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; - return; -} -void hardCodedOutput2(ofstream& of) -{ - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)" << endl; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 2" << endl; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 3" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 4" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << endl; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << endl; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << endl; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)" << endl; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)" << endl; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "==================================================K = 2" << endl; - of << "--------------------------------------------------J = 0" << endl; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)" << endl; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 1" << endl; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 2" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 3" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << endl; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 4" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << endl; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)" << endl; - of << "(1.00e+01 , 1.00e+01 , 1.00e+01)"; - of << "(1.00e+01 , 1.00e+01 , 1.00e+01)"; - of << "(1.00e+01 , 1.00e+01 , 1.00e+01)" << endl; - of << "" << endl; - of << "" << endl; - of << "==================================================K = 3" << endl; - of << "--------------------------------------------------J = 0" << endl; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 1" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 2" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << endl; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 3" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << endl; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)" << endl; - of << "(1.00e+01 , 1.00e+01 , 1.00e+01)"; - of << "(1.00e+01 , 1.00e+01 , 1.00e+01)"; - of << "(1.00e+01 , 1.00e+01 , 1.00e+01)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 4" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << endl; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)" << endl; - of << "(1.00e+01 , 1.00e+01 , 1.00e+01)"; - of << "(1.00e+01 , 1.00e+01 , 1.00e+01)"; - of << "(1.00e+01 , 1.00e+01 , 1.00e+01)" << endl; - of << "(1.10e+01 , 1.10e+01 , 1.10e+01)"; - of << "(1.10e+01 , 1.10e+01 , 1.10e+01)"; - of << "(1.10e+01 , 1.10e+01 , 1.10e+01)" << endl; - of << "" << endl; - of << "" << endl; - of << "==================================================K = 4" << endl; - of << "--------------------------------------------------J = 0" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 1" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << endl; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 2" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << endl; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; - return; -} -void hardCodedOutput3(ofstream& of) -{ - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)" << endl; - of << "(1.00e+01 , 1.00e+01 , 1.00e+01)"; - of << "(1.00e+01 , 1.00e+01 , 1.00e+01)"; - of << "(1.00e+01 , 1.00e+01 , 1.00e+01)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 3" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << endl; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)" << endl; - of << "(1.00e+01 , 1.00e+01 , 1.00e+01)"; - of << "(1.00e+01 , 1.00e+01 , 1.00e+01)"; - of << "(1.00e+01 , 1.00e+01 , 1.00e+01)" << endl; - of << "(1.10e+01 , 1.10e+01 , 1.10e+01)"; - of << "(1.10e+01 , 1.10e+01 , 1.10e+01)"; - of << "(1.10e+01 , 1.10e+01 , 1.10e+01)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 4" << endl; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << endl; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)" << endl; - of << "(1.00e+01 , 1.00e+01 , 1.00e+01)"; - of << "(1.00e+01 , 1.00e+01 , 1.00e+01)"; - of << "(1.00e+01 , 1.00e+01 , 1.00e+01)" << endl; - of << "(1.10e+01 , 1.10e+01 , 1.10e+01)"; - of << "(1.10e+01 , 1.10e+01 , 1.10e+01)"; - of << "(1.10e+01 , 1.10e+01 , 1.10e+01)" << endl; - of << "(1.20e+01 , 1.20e+01 , 1.20e+01)"; - of << "(1.20e+01 , 1.20e+01 , 1.20e+01)"; - of << "(1.20e+01 , 1.20e+01 , 1.20e+01)" << endl; - of << "" << endl; - of << "" << endl; - of << "++++++++++sB+++++++++++" << endl; - of << "~~~~~~~~ field slice (0:4:1, 0:4:1, 0:4:1) ~~~~~~~~" << endl; - of << "==================================================K = 0" << endl; - of << "--------------------------------------------------J = 0" << endl; - of << "(1.00e+00 , -1.00e+00 , -1.00e+00)"; - of << "(-1.00e+00 , 1.00e+00 , -1.00e+00)"; - of << "(-1.00e+00 , -1.00e+00 , 1.00e+00)" << endl; - of << "(0.00e+00 , 0.00e+00 , 0.00e+00)"; - of << "(0.00e+00 , 0.00e+00 , 0.00e+00)"; - of << "(0.00e+00 , 0.00e+00 , 0.00e+00)" << endl; - of << "(0.00e+00 , 0.00e+00 , 0.00e+00)"; - of << "(0.00e+00 , 0.00e+00 , 0.00e+00)"; - of << "(0.00e+00 , 0.00e+00 , 0.00e+00)" << endl; - of << "(1.00e+00 , 1.00e+00 , 1.00e+00)"; - of << "(1.00e+00 , 1.00e+00 , 1.00e+00)"; - of << "(1.00e+00 , 1.00e+00 , 1.00e+00)" << endl; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 1" << endl; - of << "(2.00e+00 , -2.00e+00 , -2.00e+00)"; - of << "(-2.00e+00 , 2.00e+00 , -2.00e+00)"; - of << "(-2.00e+00 , -2.00e+00 , 2.00e+00)" << endl; - of << "(1.00e+00 , -1.00e+00 , -1.00e+00)"; - of << "(-1.00e+00 , 1.00e+00 , -1.00e+00)"; - of << "(-1.00e+00 , -1.00e+00 , 1.00e+00)" << endl; - of << "(1.00e+00 , 1.00e+00 , 1.00e+00)"; - of << "(1.00e+00 , 1.00e+00 , 1.00e+00)"; - of << "(1.00e+00 , 1.00e+00 , 1.00e+00)" << endl; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)" << endl; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 2" << endl; - of << "(3.00e+00 , -3.00e+00 , -3.00e+00)"; - of << "(-3.00e+00 , 3.00e+00 , -3.00e+00)"; - of << "(-3.00e+00 , -3.00e+00 , 3.00e+00)" << endl; - of << "(2.00e+00 , -2.00e+00 , -2.00e+00)"; - of << "(-2.00e+00 , 2.00e+00 , -2.00e+00)"; - of << "(-2.00e+00 , -2.00e+00 , 2.00e+00)" << endl; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)" << endl; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 3" << endl; - of << "(4.00e+00 , -4.00e+00 , -4.00e+00)"; - of << "(-4.00e+00 , 4.00e+00 , -4.00e+00)"; - of << "(-4.00e+00 , -4.00e+00 , 4.00e+00)" << endl; - of << "(3.00e+00 , -3.00e+00 , -3.00e+00)"; - of << "(-3.00e+00 , 3.00e+00 , -3.00e+00)"; - of << "(-3.00e+00 , -3.00e+00 , 3.00e+00)" << endl; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 4" << endl; - of << "(5.00e+00 , -5.00e+00 , -5.00e+00)"; - of << "(-5.00e+00 , 5.00e+00 , -5.00e+00)"; - of << "(-5.00e+00 , -5.00e+00 , 5.00e+00)" << endl; - of << "(4.00e+00 , -4.00e+00 , -4.00e+00)"; - of << "(-4.00e+00 , 4.00e+00 , -4.00e+00)"; - of << "(-4.00e+00 , -4.00e+00 , 4.00e+00)" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "==================================================K = 1" << endl; - of << "--------------------------------------------------J = 0" << endl; - of << "(2.00e+00 , -2.00e+00 , -2.00e+00)"; - of << "(-2.00e+00 , 2.00e+00 , -2.00e+00)"; - of << "(-2.00e+00 , -2.00e+00 , 2.00e+00)" << endl; - of << "(1.00e+00 , -1.00e+00 , -1.00e+00)"; - of << "(-1.00e+00 , 1.00e+00 , -1.00e+00)"; - of << "(-1.00e+00 , -1.00e+00 , 1.00e+00)" << endl; - of << "(1.00e+00 , 1.00e+00 , 1.00e+00)"; - of << "(1.00e+00 , 1.00e+00 , 1.00e+00)"; - of << "(1.00e+00 , 1.00e+00 , 1.00e+00)" << endl; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)" << endl; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 1" << endl; - of << "(3.00e+00 , -3.00e+00 , -3.00e+00)"; - of << "(-3.00e+00 , 3.00e+00 , -3.00e+00)"; - of << "(-3.00e+00 , -3.00e+00 , 3.00e+00)" << endl; - of << "(2.00e+00 , -2.00e+00 , -2.00e+00)"; - of << "(-2.00e+00 , 2.00e+00 , -2.00e+00)"; - of << "(-2.00e+00 , -2.00e+00 , 2.00e+00)" << endl; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)" << endl; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 2" << endl; - of << "(4.00e+00 , -4.00e+00 , -4.00e+00)"; - of << "(-4.00e+00 , 4.00e+00 , -4.00e+00)"; - of << "(-4.00e+00 , -4.00e+00 , 4.00e+00)" << endl; - of << "(3.00e+00 , -3.00e+00 , -3.00e+00)"; - of << "(-3.00e+00 , 3.00e+00 , -3.00e+00)"; - of << "(-3.00e+00 , -3.00e+00 , 3.00e+00)" << endl; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 3" << endl; - of << "(5.00e+00 , -5.00e+00 , -5.00e+00)"; - of << "(-5.00e+00 , 5.00e+00 , -5.00e+00)"; - of << "(-5.00e+00 , -5.00e+00 , 5.00e+00)" << endl; - of << "(4.00e+00 , -4.00e+00 , -4.00e+00)"; - of << "(-4.00e+00 , 4.00e+00 , -4.00e+00)"; - of << "(-4.00e+00 , -4.00e+00 , 4.00e+00)" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 4" << endl; - of << "(6.00e+00 , -6.00e+00 , -6.00e+00)"; - of << "(-6.00e+00 , 6.00e+00 , -6.00e+00)"; - of << "(-6.00e+00 , -6.00e+00 , 6.00e+00)" << endl; - of << "(5.00e+00 , -5.00e+00 , -5.00e+00)"; - of << "(-5.00e+00 , 5.00e+00 , -5.00e+00)"; - of << "(-5.00e+00 , -5.00e+00 , 5.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "==================================================K = 2" << endl; - of << "--------------------------------------------------J = 0" << endl; - of << "(3.00e+00 , -3.00e+00 , -3.00e+00)"; - of << "(-3.00e+00 , 3.00e+00 , -3.00e+00)"; - of << "(-3.00e+00 , -3.00e+00 , 3.00e+00)" << endl; - of << "(2.00e+00 , -2.00e+00 , -2.00e+00)"; - of << "(-2.00e+00 , 2.00e+00 , -2.00e+00)"; - of << "(-2.00e+00 , -2.00e+00 , 2.00e+00)" << endl; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)" << endl; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 1" << endl; - of << "(4.00e+00 , -4.00e+00 , -4.00e+00)"; - of << "(-4.00e+00 , 4.00e+00 , -4.00e+00)"; - of << "(-4.00e+00 , -4.00e+00 , 4.00e+00)" << endl; - of << "(3.00e+00 , -3.00e+00 , -3.00e+00)"; - of << "(-3.00e+00 , 3.00e+00 , -3.00e+00)"; - of << "(-3.00e+00 , -3.00e+00 , 3.00e+00)" << endl; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 2" << endl; - of << "(5.00e+00 , -5.00e+00 , -5.00e+00)"; - of << "(-5.00e+00 , 5.00e+00 , -5.00e+00)"; - of << "(-5.00e+00 , -5.00e+00 , 5.00e+00)" << endl; - of << "(4.00e+00 , -4.00e+00 , -4.00e+00)"; - of << "(-4.00e+00 , 4.00e+00 , -4.00e+00)"; - of << "(-4.00e+00 , -4.00e+00 , 4.00e+00)" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 3" << endl; - of << "(6.00e+00 , -6.00e+00 , -6.00e+00)"; - of << "(-6.00e+00 , 6.00e+00 , -6.00e+00)"; - of << "(-6.00e+00 , -6.00e+00 , 6.00e+00)" << endl; - of << "(5.00e+00 , -5.00e+00 , -5.00e+00)"; - of << "(-5.00e+00 , 5.00e+00 , -5.00e+00)"; - of << "(-5.00e+00 , -5.00e+00 , 5.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 4" << endl; - return; -} -void hardCodedOutput4(ofstream& of) -{ - of << "(7.00e+00 , -7.00e+00 , -7.00e+00)"; - of << "(-7.00e+00 , 7.00e+00 , -7.00e+00)"; - of << "(-7.00e+00 , -7.00e+00 , 7.00e+00)" << endl; - of << "(6.00e+00 , -6.00e+00 , -6.00e+00)"; - of << "(-6.00e+00 , 6.00e+00 , -6.00e+00)"; - of << "(-6.00e+00 , -6.00e+00 , 6.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "==================================================K = 3" << endl; - of << "--------------------------------------------------J = 0" << endl; - of << "(4.00e+00 , -4.00e+00 , -4.00e+00)"; - of << "(-4.00e+00 , 4.00e+00 , -4.00e+00)"; - of << "(-4.00e+00 , -4.00e+00 , 4.00e+00)" << endl; - of << "(3.00e+00 , -3.00e+00 , -3.00e+00)"; - of << "(-3.00e+00 , 3.00e+00 , -3.00e+00)"; - of << "(-3.00e+00 , -3.00e+00 , 3.00e+00)" << endl; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 1" << endl; - of << "(5.00e+00 , -5.00e+00 , -5.00e+00)"; - of << "(-5.00e+00 , 5.00e+00 , -5.00e+00)"; - of << "(-5.00e+00 , -5.00e+00 , 5.00e+00)" << endl; - of << "(4.00e+00 , -4.00e+00 , -4.00e+00)"; - of << "(-4.00e+00 , 4.00e+00 , -4.00e+00)"; - of << "(-4.00e+00 , -4.00e+00 , 4.00e+00)" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 2" << endl; - of << "(6.00e+00 , -6.00e+00 , -6.00e+00)"; - of << "(-6.00e+00 , 6.00e+00 , -6.00e+00)"; - of << "(-6.00e+00 , -6.00e+00 , 6.00e+00)" << endl; - of << "(5.00e+00 , -5.00e+00 , -5.00e+00)"; - of << "(-5.00e+00 , 5.00e+00 , -5.00e+00)"; - of << "(-5.00e+00 , -5.00e+00 , 5.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 3" << endl; - of << "(7.00e+00 , -7.00e+00 , -7.00e+00)"; - of << "(-7.00e+00 , 7.00e+00 , -7.00e+00)"; - of << "(-7.00e+00 , -7.00e+00 , 7.00e+00)" << endl; - of << "(6.00e+00 , -6.00e+00 , -6.00e+00)"; - of << "(-6.00e+00 , 6.00e+00 , -6.00e+00)"; - of << "(-6.00e+00 , -6.00e+00 , 6.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 4" << endl; - of << "(8.00e+00 , -8.00e+00 , -8.00e+00)"; - of << "(-8.00e+00 , 8.00e+00 , -8.00e+00)"; - of << "(-8.00e+00 , -8.00e+00 , 8.00e+00)" << endl; - of << "(7.00e+00 , -7.00e+00 , -7.00e+00)"; - of << "(-7.00e+00 , 7.00e+00 , -7.00e+00)"; - of << "(-7.00e+00 , -7.00e+00 , 7.00e+00)" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << endl; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "==================================================K = 4" << endl; - of << "--------------------------------------------------J = 0" << endl; - of << "(5.00e+00 , -5.00e+00 , -5.00e+00)"; - of << "(-5.00e+00 , 5.00e+00 , -5.00e+00)"; - of << "(-5.00e+00 , -5.00e+00 , 5.00e+00)" << endl; - of << "(4.00e+00 , -4.00e+00 , -4.00e+00)"; - of << "(-4.00e+00 , 4.00e+00 , -4.00e+00)"; - of << "(-4.00e+00 , -4.00e+00 , 4.00e+00)" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 1" << endl; - of << "(6.00e+00 , -6.00e+00 , -6.00e+00)"; - of << "(-6.00e+00 , 6.00e+00 , -6.00e+00)"; - of << "(-6.00e+00 , -6.00e+00 , 6.00e+00)" << endl; - of << "(5.00e+00 , -5.00e+00 , -5.00e+00)"; - of << "(-5.00e+00 , 5.00e+00 , -5.00e+00)"; - of << "(-5.00e+00 , -5.00e+00 , 5.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 2" << endl; - of << "(7.00e+00 , -7.00e+00 , -7.00e+00)"; - of << "(-7.00e+00 , 7.00e+00 , -7.00e+00)"; - of << "(-7.00e+00 , -7.00e+00 , 7.00e+00)" << endl; - of << "(6.00e+00 , -6.00e+00 , -6.00e+00)"; - of << "(-6.00e+00 , 6.00e+00 , -6.00e+00)"; - of << "(-6.00e+00 , -6.00e+00 , 6.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 3" << endl; - of << "(8.00e+00 , -8.00e+00 , -8.00e+00)"; - of << "(-8.00e+00 , 8.00e+00 , -8.00e+00)"; - of << "(-8.00e+00 , -8.00e+00 , 8.00e+00)" << endl; - of << "(7.00e+00 , -7.00e+00 , -7.00e+00)"; - of << "(-7.00e+00 , 7.00e+00 , -7.00e+00)"; - of << "(-7.00e+00 , -7.00e+00 , 7.00e+00)" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << endl; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 4" << endl; - of << "(9.00e+00 , -9.00e+00 , -9.00e+00)"; - of << "(-9.00e+00 , 9.00e+00 , -9.00e+00)"; - of << "(-9.00e+00 , -9.00e+00 , 9.00e+00)" << endl; - of << "(8.00e+00 , -8.00e+00 , -8.00e+00)"; - of << "(-8.00e+00 , 8.00e+00 , -8.00e+00)"; - of << "(-8.00e+00 , -8.00e+00 , 8.00e+00)" << endl; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << endl; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)" << endl; - of << "(1.00e+01 , 1.00e+01 , 1.00e+01)"; - of << "(1.00e+01 , 1.00e+01 , 1.00e+01)"; - of << "(1.00e+01 , 1.00e+01 , 1.00e+01)" << endl; - of << "" << endl; - of << "" << endl; - of << "++++++++++vfzA+++++++++++" << endl; - of << "~~~~~~~~ field slice (0:4:1, 0:4:1) ~~~~~~~~" << endl; - of << "--------------------------------------------------J = 0" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( 1.00e+00 , 0.00e+00 )" << endl; - of << "( 2.00e+00 , 0.00e+00 ) ( 3.00e+00 , 0.00e+00 )" << endl; - of << "( 0.00e+00 , 0.00e+00 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 1" << endl; - of << "( 0.00e+00 , 5.00e+00 ) ( 6.00e+00 , 6.00e+00 )" << endl; - of << "( 7.00e+00 , 7.00e+00 ) ( 8.00e+00 , 8.00e+00 )" << endl; - of << "( 0.00e+00 , 8.00e+00 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 2" << endl; - of << "( 0.00e+00 , 1.00e+01 ) ( 1.10e+01 , 1.10e+01 )" << endl; - of << "( 1.20e+01 , 1.20e+01 ) ( 1.30e+01 , 1.30e+01 )" << endl; - of << "( 0.00e+00 , 1.30e+01 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 3" << endl; - of << "( 0.00e+00 , 1.50e+01 ) ( 1.60e+01 , 1.60e+01 )" << endl; - of << "( 1.70e+01 , 1.70e+01 ) ( 1.80e+01 , 1.80e+01 )" << endl; - of << "( 0.00e+00 , 1.80e+01 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 4" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( 1.60e+01 , 0.00e+00 )" << endl; - of << "( 1.70e+01 , 0.00e+00 ) ( 1.80e+01 , 0.00e+00 )" << endl; - of << "( 0.00e+00 , 0.00e+00 ) " << endl; - of << "" << endl; - of << "++++++++++vfzB+++++++++++" << endl; - of << "~~~~~~~~ field slice (0:4:1, 0:4:1) ~~~~~~~~" << endl; - of << "--------------------------------------------------J = 0" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( -1.00e+00 , 0.00e+00 )" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( 1.00e+00 , 0.00e+00 )" << endl; - of << "( 0.00e+00 , 0.00e+00 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 1" << endl; - of << "( 0.00e+00 , 6.00e+00 ) ( -6.00e+00 , 5.00e+00 )" << endl; - of << "( 0.00e+00 , 5.00e+00 ) ( 6.00e+00 , 6.00e+00 )" << endl; - of << "( 0.00e+00 , 6.00e+00 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 2" << endl; - of << "( 0.00e+00 , 1.10e+01 ) ( -1.10e+01 , 1.00e+01 )" << endl; - of << "( 0.00e+00 , 1.00e+01 ) ( 1.10e+01 , 1.10e+01 )" << endl; - of << "( 0.00e+00 , 1.10e+01 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 3" << endl; - of << "( 0.00e+00 , 1.60e+01 ) ( -1.60e+01 , 1.50e+01 )" << endl; - of << "( 0.00e+00 , 1.50e+01 ) ( 1.60e+01 , 1.60e+01 )" << endl; - of << "( 0.00e+00 , 1.60e+01 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 4" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( -1.60e+01 , 0.00e+00 )" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( 1.60e+01 , 0.00e+00 )" << endl; - of << "( 0.00e+00 , 0.00e+00 ) " << endl; - of << "" << endl; - of << "++++++++++vfzC+++++++++++" << endl; - of << "~~~~~~~~ field slice (0:4:1, 0:4:1) ~~~~~~~~" << endl; - of << "--------------------------------------------------J = 0" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( -6.00e+00 , 0.00e+00 )" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( 6.00e+00 , 0.00e+00 )" << endl; - of << "( 0.00e+00 , 0.00e+00 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 1" << endl; - of << "( 0.00e+00 , -6.00e+00 ) ( -1.00e+00 , -5.00e+00 )" << endl; - of << "( 0.00e+00 , -5.00e+00 ) ( 1.00e+00 , -6.00e+00 )" << endl; - of << "( 0.00e+00 , -6.00e+00 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 2" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( -1.00e+00 , 0.00e+00 )" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( 1.00e+00 , 0.00e+00 )" << endl; - of << "( 0.00e+00 , 0.00e+00 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 3" << endl; - of << "( 0.00e+00 , 6.00e+00 ) ( -6.00e+00 , 5.00e+00 )" << endl; - of << "( 0.00e+00 , 5.00e+00 ) ( 6.00e+00 , 6.00e+00 )" << endl; - of << "( 0.00e+00 , 6.00e+00 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 4" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( -6.00e+00 , 0.00e+00 )" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( 6.00e+00 , 0.00e+00 )" << endl; - of << "( 0.00e+00 , 0.00e+00 ) " << endl; - of << "" << endl; - of << "++++++++++vzA+++++++++++" << endl; - of << "~~~~~~~~ field slice (0:4:1, 0:4:1) ~~~~~~~~" << endl; - of << "--------------------------------------------------J = 0" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( 1.00e+00 , 0.00e+00 )" << endl; - of << "( 2.00e+00 , 0.00e+00 ) ( 3.00e+00 , 0.00e+00 )" << endl; - of << "( 0.00e+00 , 0.00e+00 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 1" << endl; - of << "( 0.00e+00 , 5.00e+00 ) ( 6.00e+00 , 6.00e+00 )" << endl; - of << "( 7.00e+00 , 7.00e+00 ) ( 8.00e+00 , 8.00e+00 )" << endl; - of << "( 0.00e+00 , 9.00e+00 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 2" << endl; - of << "( 0.00e+00 , 1.00e+01 ) ( 1.10e+01 , 1.10e+01 )" << endl; - of << "( 1.20e+01 , 1.20e+01 ) ( 1.30e+01 , 1.30e+01 )" << endl; - of << "( 0.00e+00 , 1.40e+01 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 3" << endl; - of << "( 0.00e+00 , 1.50e+01 ) ( 1.60e+01 , 1.60e+01 )" << endl; - of << "( 1.70e+01 , 1.70e+01 ) ( 1.80e+01 , 1.80e+01 )" << endl; - of << "( 0.00e+00 , 1.90e+01 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 4" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( 2.10e+01 , 0.00e+00 )" << endl; - of << "( 2.20e+01 , 0.00e+00 ) ( 2.30e+01 , 0.00e+00 )" << endl; - of << "( 0.00e+00 , 0.00e+00 ) " << endl; - of << "" << endl; - of << "++++++++++vzB+++++++++++" << endl; - of << "~~~~~~~~ field slice (0:4:1, 0:4:1) ~~~~~~~~" << endl; - of << "--------------------------------------------------J = 0" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( -1.00e+00 , 0.00e+00 )" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( 1.00e+00 , 0.00e+00 )" << endl; - of << "( 0.00e+00 , 0.00e+00 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 1" << endl; - of << "( 0.00e+00 , 7.00e+00 ) ( -6.00e+00 , 6.00e+00 )" << endl; - of << "( 0.00e+00 , 5.00e+00 ) ( 6.00e+00 , 6.00e+00 )" << endl; - of << "( 0.00e+00 , 7.00e+00 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 2" << endl; - of << "( 0.00e+00 , 1.20e+01 ) ( -1.10e+01 , 1.10e+01 )" << endl; - of << "( 0.00e+00 , 1.00e+01 ) ( 1.10e+01 , 1.10e+01 )" << endl; - of << "( 0.00e+00 , 1.20e+01 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 3" << endl; - of << "( 0.00e+00 , 1.70e+01 ) ( -1.60e+01 , 1.60e+01 )" << endl; - of << "( 0.00e+00 , 1.50e+01 ) ( 1.60e+01 , 1.60e+01 )" << endl; - of << "( 0.00e+00 , 1.70e+01 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 4" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( -2.10e+01 , 0.00e+00 )" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( 2.10e+01 , 0.00e+00 )" << endl; - of << "( 0.00e+00 , 0.00e+00 ) " << endl; - of << "" << endl; - of << "++++++++++vzC+++++++++++" << endl; - of << "~~~~~~~~ field slice (0:4:1, 0:4:1) ~~~~~~~~" << endl; - of << "--------------------------------------------------J = 0" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( -1.10e+01 , 0.00e+00 )" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( 1.10e+01 , 0.00e+00 )" << endl; - of << "( 0.00e+00 , 0.00e+00 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 1" << endl; - of << "( 0.00e+00 , -7.00e+00 ) ( -6.00e+00 , -6.00e+00 )" << endl; - of << "( 0.00e+00 , -5.00e+00 ) ( 6.00e+00 , -6.00e+00 )" << endl; - of << "( 0.00e+00 , -7.00e+00 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 2" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( -1.00e+00 , 0.00e+00 )" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( 1.00e+00 , 0.00e+00 )" << endl; - of << "( 0.00e+00 , 0.00e+00 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 3" << endl; - of << "( 0.00e+00 , 7.00e+00 ) ( -6.00e+00 , 6.00e+00 )" << endl; - of << "( 0.00e+00 , 5.00e+00 ) ( 6.00e+00 , 6.00e+00 )" << endl; - of << "( 0.00e+00 , 7.00e+00 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 4" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( -1.10e+01 , 0.00e+00 )" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( 1.10e+01 , 0.00e+00 )" << endl; - of << "( 0.00e+00 , 0.00e+00 ) " << endl; - of << "" << endl; - of << "" << endl;; - return; -} -#else -//----------------------------------------------------------------------------- -void hardCodedOutput(char* filename) -{ - ofstream of(filename); - of << "++++++++BConds object cbc begin++++++++" << endl; - of << "BConds:(" << endl; - of << "NegReflectFace, Face=0 , " << endl; - of << "ZeroFace, Face=1 , " << endl; - of << "ParallelPeriodicFace, Face=2 , " << endl; - of << "ParallelPeriodicFace, Face=3" << endl; - of << ")" << endl; - of << "" << endl; - of << "++++++++BConds object cbc end++++++++++" << endl; - of << "++++++++++cA+++++++++++" << endl; - of << "~~~~~~~~ field slice (0:4:1, 0:4:1) ~~~~~~~~" << endl; - of << "--------------------------------------------------J = 0" << endl; - of << "0.000e+00 1.000e+00 2.000e+00 3.000e+00 4.000e+00 " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 1" << endl; - of << "5.000e+00 6.000e+00 7.000e+00 8.000e+00 9.000e+00 " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 2" << endl; - of << "1.000e+01 1.100e+01 1.200e+01 1.300e+01 1.400e+01 " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 3" << endl; - of << "1.500e+01 1.600e+01 1.700e+01 1.800e+01 1.900e+01 " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 4" << endl; - of << "2.000e+01 2.100e+01 2.200e+01 2.300e+01 2.400e+01 " << endl; - of << "" << endl; - of << "++++++++++cB+++++++++++" << endl; - of << "~~~~~~~~ field slice (0:4:1, 0:4:1) ~~~~~~~~" << endl; - of << "--------------------------------------------------J = 0" << endl; - of << "-1.600e+01 -1.500e+01 1.500e+01 1.600e+01 1.700e+01 " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 1" << endl; - of << "-2.100e+01 -2.000e+01 2.000e+01 2.100e+01 2.200e+01 " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 2" << endl; - of << "-1.000e+00 0.000e+00 0.000e+00 1.000e+00 2.000e+00 " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 3" << endl; - of << "-6.000e+00 -5.000e+00 5.000e+00 6.000e+00 7.000e+00 " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 4" << endl; - of << "-1.100e+01 -1.000e+01 1.000e+01 1.100e+01 1.200e+01 " << endl; - of << "" << endl; - of << "++++++++++vA+++++++++++" << endl; - of << "~~~~~~~~ field slice (0:4:1, 0:4:1) ~~~~~~~~" << endl; - of << "--------------------------------------------------J = 0" << endl; - of << "0.000e+00 1.000e+00 2.000e+00 3.000e+00 4.000e+00 " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 1" << endl; - of << "5.000e+00 6.000e+00 7.000e+00 8.000e+00 9.000e+00 " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 2" << endl; - of << "1.000e+01 1.100e+01 1.200e+01 1.300e+01 1.400e+01 " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 3" << endl; - of << "1.500e+01 1.600e+01 1.700e+01 1.800e+01 1.900e+01 " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 4" << endl; - of << "0.000e+00 1.000e+00 2.000e+00 3.000e+00 4.000e+00 " << endl; - of << "" << endl; - of << "++++++++++vB+++++++++++" << endl; - of << "~~~~~~~~ field slice (0:4:1, 0:4:1) ~~~~~~~~" << endl; - of << "--------------------------------------------------J = 0" << endl; - of << "-1.200e+01 -1.100e+01 1.000e+01 1.100e+01 1.200e+01 " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 1" << endl; - of << "-1.700e+01 -1.600e+01 1.500e+01 1.600e+01 1.700e+01 " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 2" << endl; - of << "-2.000e+00 -1.000e+00 0.000e+00 1.000e+00 2.000e+00 " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 3" << endl; - of << "-7.000e+00 -6.000e+00 5.000e+00 6.000e+00 7.000e+00 " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 4" << endl; - of << "-1.200e+01 -1.100e+01 1.000e+01 1.100e+01 1.200e+01 " << endl; - of << "" << endl; - of << "++++++++++vcA+++++++++++" << endl; - of << "~~~~~~~~ field slice (0:4:1, 0:4:1) ~~~~~~~~" << endl; - of << "--------------------------------------------------J = 0" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( 1.00e+00 , 1.00e+00 )" << endl; - of << "( 2.00e+00 , 2.00e+00 ) ( 3.00e+00 , 3.00e+00 )" << endl; - of << "( 4.00e+00 , 4.00e+00 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 1" << endl; - of << "( 5.00e+00 , 5.00e+00 ) ( 6.00e+00 , 6.00e+00 )" << endl; - of << "( 7.00e+00 , 7.00e+00 ) ( 8.00e+00 , 8.00e+00 )" << endl; - of << "( 9.00e+00 , 9.00e+00 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 2" << endl; - of << "( 1.00e+01 , 1.00e+01 ) ( 1.10e+01 , 1.10e+01 )" << endl; - of << "( 1.20e+01 , 1.20e+01 ) ( 1.30e+01 , 1.30e+01 )" << endl; - of << "( 1.40e+01 , 1.40e+01 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 3" << endl; - of << "( 1.50e+01 , 1.50e+01 ) ( 1.60e+01 , 1.60e+01 )" << endl; - of << "( 1.70e+01 , 1.70e+01 ) ( 1.80e+01 , 1.80e+01 )" << endl; - of << "( 1.90e+01 , 1.90e+01 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 4" << endl; - of << "( 2.00e+01 , 2.00e+01 ) ( 2.10e+01 , 2.10e+01 )" << endl; - of << "( 2.20e+01 , 2.20e+01 ) ( 2.30e+01 , 2.30e+01 )" << endl; - of << "( 2.40e+01 , 2.40e+01 ) " << endl; - of << "" << endl; - of << "++++++++++vcB+++++++++++" << endl; - of << "~~~~~~~~ field slice (0:4:1, 0:4:1) ~~~~~~~~" << endl; - of << "--------------------------------------------------J = 0" << endl; - of << "( -1.00e+00 , 1.00e+00 ) ( 0.00e+00 , 0.00e+00 )" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( 1.00e+00 , 1.00e+00 )" << endl; - of << "( 2.00e+00 , 2.00e+00 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 1" << endl; - of << "( -6.00e+00 , 6.00e+00 ) ( -5.00e+00 , 5.00e+00 )" << endl; - of << "( 5.00e+00 , 5.00e+00 ) ( 6.00e+00 , 6.00e+00 )" << endl; - of << "( 7.00e+00 , 7.00e+00 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 2" << endl; - of << "( -1.10e+01 , 1.10e+01 ) ( -1.00e+01 , 1.00e+01 )" << endl; - of << "( 1.00e+01 , 1.00e+01 ) ( 1.10e+01 , 1.10e+01 )" << endl; - of << "( 1.20e+01 , 1.20e+01 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 3" << endl; - of << "( -1.60e+01 , 1.60e+01 ) ( -1.50e+01 , 1.50e+01 )" << endl; - of << "( 1.50e+01 , 1.50e+01 ) ( 1.60e+01 , 1.60e+01 )" << endl; - of << "( 1.70e+01 , 1.70e+01 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 4" << endl; - of << "( -2.10e+01 , 2.10e+01 ) ( -2.00e+01 , 2.00e+01 )" << endl; - of << "( 2.00e+01 , 2.00e+01 ) ( 2.10e+01 , 2.10e+01 )" << endl; - of << "( 2.20e+01 , 2.20e+01 ) " << endl; - of << "" << endl; - /* tjw: omit this test until componentwise ParallelPeriodicFace bug is fixed: - of << "++++++++++vfA+++++++++++" << endl; - of << "~~~~~~~~ field slice (0:4:1, 0:4:1) ~~~~~~~~" << endl; - of << "--------------------------------------------------J = 0" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( 1.00e+00 , 1.00e+00 )" << endl; - of << "( 2.00e+00 , 2.00e+00 ) ( 3.00e+00 , 3.00e+00 )" << endl; - of << "( 4.00e+00 , 3.00e+00 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 1" << endl; - of << "( 5.00e+00 , 5.00e+00 ) ( 6.00e+00 , 6.00e+00 )" << endl; - of << "( 7.00e+00 , 7.00e+00 ) ( 8.00e+00 , 8.00e+00 )" << endl; - of << "( 9.00e+00 , 8.00e+00 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 2" << endl; - of << "( 1.00e+01 , 1.00e+01 ) ( 1.10e+01 , 1.10e+01 )" << endl; - of << "( 1.20e+01 , 1.20e+01 ) ( 1.30e+01 , 1.30e+01 )" << endl; - of << "( 1.40e+01 , 1.30e+01 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 3" << endl; - of << "( 1.50e+01 , 1.50e+01 ) ( 1.60e+01 , 1.60e+01 )" << endl; - of << "( 1.70e+01 , 1.70e+01 ) ( 1.80e+01 , 1.80e+01 )" << endl; - of << "( 1.90e+01 , 1.80e+01 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 4" << endl; - of << "( 9.99e+00 , 0.00e+00 ) ( 9.99e+00 , 1.00e+00 )" << endl; - of << "( 9.99e+00 , 2.00e+00 ) ( 9.99e+00 , 3.00e+00 )" << endl; - of << "( 9.99e+00 , 3.00e+00 ) " << endl; - of << "" << endl; - of << "++++++++++vfB+++++++++++" << endl; - of << "~~~~~~~~ field slice (0:4:1, 0:4:1) ~~~~~~~~" << endl; - of << "--------------------------------------------------J = 0" << endl; - of << "( -2.00e+00 , 1.00e+00 ) ( -1.00e+00 , 0.00e+00 )" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( 1.00e+00 , 1.00e+00 )" << endl; - of << "( 2.00e+00 , 2.00e+00 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 1" << endl; - of << "( -7.00e+00 , 6.00e+00 ) ( -6.00e+00 , 5.00e+00 )" << endl; - of << "( 5.00e+00 , 5.00e+00 ) ( 6.00e+00 , 6.00e+00 )" << endl; - of << "( 7.00e+00 , 7.00e+00 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 2" << endl; - of << "( -1.20e+01 , 1.10e+01 ) ( -1.10e+01 , 1.00e+01 )" << endl; - of << "( 1.00e+01 , 1.00e+01 ) ( 1.10e+01 , 1.10e+01 )" << endl; - of << "( 1.20e+01 , 1.20e+01 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 3" << endl; - of << "( -1.70e+01 , 1.60e+01 ) ( -1.60e+01 , 1.50e+01 )" << endl; - of << "( 1.50e+01 , 1.50e+01 ) ( 1.60e+01 , 1.60e+01 )" << endl; - of << "( 1.70e+01 , 1.70e+01 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 4" << endl; - of << "( -9.99e+00 , 1.00e+00 ) ( -9.99e+00 , 0.00e+00 )" << endl; - of << "( 9.99e+00 , 0.00e+00 ) ( 9.99e+00 , 1.00e+00 )" << endl; - of << "( 9.99e+00 , 2.00e+00 ) " << endl; - of << "" << endl; - tjw: omit this test until componentwise ParallelPeriodicFace bug is fixed. */ - of << "++++++++++sA+++++++++++" << endl; - of << "~~~~~~~~ field slice (0:4:1, 0:4:1, 0:4:1) ~~~~~~~~" << endl; - of << "==================================================K = 0" << endl; - of << "--------------------------------------------------J = 0" << endl; - of << "(0.00e+00 , 0.00e+00 , 0.00e+00)"; - of << "(0.00e+00 , 0.00e+00 , 0.00e+00)"; - of << "(0.00e+00 , 0.00e+00 , 0.00e+00)" << endl; - of << "(1.00e+00 , 1.00e+00 , 1.00e+00)"; - of << "(1.00e+00 , 1.00e+00 , 1.00e+00)"; - of << "(1.00e+00 , 1.00e+00 , 1.00e+00)" << endl; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)" << endl; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 1" << endl; - of << "(1.00e+00 , 1.00e+00 , 1.00e+00)"; - of << "(1.00e+00 , 1.00e+00 , 1.00e+00)"; - of << "(1.00e+00 , 1.00e+00 , 1.00e+00)" << endl; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)" << endl; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 2" << endl; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)" << endl; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 3" << endl; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 4" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "==================================================K = 1" << endl; - of << "--------------------------------------------------J = 0" << endl; - of << "(1.00e+00 , 1.00e+00 , 1.00e+00)"; - of << "(1.00e+00 , 1.00e+00 , 1.00e+00)"; - of << "(1.00e+00 , 1.00e+00 , 1.00e+00)" << endl; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)" << endl; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 1" << endl; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)" << endl; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 2" << endl; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 3" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 4" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << endl; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "==================================================K = 2" << endl; - of << "--------------------------------------------------J = 0" << endl; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)" << endl; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 1" << endl; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 2" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 3" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << endl; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 4" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << endl; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)" << endl; - of << "(1.00e+01 , 1.00e+01 , 1.00e+01)"; - of << "(1.00e+01 , 1.00e+01 , 1.00e+01)"; - of << "(1.00e+01 , 1.00e+01 , 1.00e+01)" << endl; - of << "" << endl; - of << "" << endl; - of << "==================================================K = 3" << endl; - of << "--------------------------------------------------J = 0" << endl; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 1" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 2" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << endl; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 3" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << endl; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)" << endl; - of << "(1.00e+01 , 1.00e+01 , 1.00e+01)"; - of << "(1.00e+01 , 1.00e+01 , 1.00e+01)"; - of << "(1.00e+01 , 1.00e+01 , 1.00e+01)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 4" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << endl; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)" << endl; - of << "(1.00e+01 , 1.00e+01 , 1.00e+01)"; - of << "(1.00e+01 , 1.00e+01 , 1.00e+01)"; - of << "(1.00e+01 , 1.00e+01 , 1.00e+01)" << endl; - of << "(1.10e+01 , 1.10e+01 , 1.10e+01)"; - of << "(1.10e+01 , 1.10e+01 , 1.10e+01)"; - of << "(1.10e+01 , 1.10e+01 , 1.10e+01)" << endl; - of << "" << endl; - of << "" << endl; - of << "==================================================K = 4" << endl; - of << "--------------------------------------------------J = 0" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 1" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << endl; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 2" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << endl; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)" << endl; - of << "(1.00e+01 , 1.00e+01 , 1.00e+01)"; - of << "(1.00e+01 , 1.00e+01 , 1.00e+01)"; - of << "(1.00e+01 , 1.00e+01 , 1.00e+01)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 3" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << endl; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)" << endl; - of << "(1.00e+01 , 1.00e+01 , 1.00e+01)"; - of << "(1.00e+01 , 1.00e+01 , 1.00e+01)"; - of << "(1.00e+01 , 1.00e+01 , 1.00e+01)" << endl; - of << "(1.10e+01 , 1.10e+01 , 1.10e+01)"; - of << "(1.10e+01 , 1.10e+01 , 1.10e+01)"; - of << "(1.10e+01 , 1.10e+01 , 1.10e+01)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 4" << endl; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << endl; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)" << endl; - of << "(1.00e+01 , 1.00e+01 , 1.00e+01)"; - of << "(1.00e+01 , 1.00e+01 , 1.00e+01)"; - of << "(1.00e+01 , 1.00e+01 , 1.00e+01)" << endl; - of << "(1.10e+01 , 1.10e+01 , 1.10e+01)"; - of << "(1.10e+01 , 1.10e+01 , 1.10e+01)"; - of << "(1.10e+01 , 1.10e+01 , 1.10e+01)" << endl; - of << "(1.20e+01 , 1.20e+01 , 1.20e+01)"; - of << "(1.20e+01 , 1.20e+01 , 1.20e+01)"; - of << "(1.20e+01 , 1.20e+01 , 1.20e+01)" << endl; - of << "" << endl; - of << "" << endl; - of << "++++++++++sB+++++++++++" << endl; - of << "~~~~~~~~ field slice (0:4:1, 0:4:1, 0:4:1) ~~~~~~~~" << endl; - of << "==================================================K = 0" << endl; - of << "--------------------------------------------------J = 0" << endl; - of << "(1.00e+00 , -1.00e+00 , -1.00e+00)"; - of << "(-1.00e+00 , 1.00e+00 , -1.00e+00)"; - of << "(-1.00e+00 , -1.00e+00 , 1.00e+00)" << endl; - of << "(0.00e+00 , 0.00e+00 , 0.00e+00)"; - of << "(0.00e+00 , 0.00e+00 , 0.00e+00)"; - of << "(0.00e+00 , 0.00e+00 , 0.00e+00)" << endl; - of << "(0.00e+00 , 0.00e+00 , 0.00e+00)"; - of << "(0.00e+00 , 0.00e+00 , 0.00e+00)"; - of << "(0.00e+00 , 0.00e+00 , 0.00e+00)" << endl; - of << "(1.00e+00 , 1.00e+00 , 1.00e+00)"; - of << "(1.00e+00 , 1.00e+00 , 1.00e+00)"; - of << "(1.00e+00 , 1.00e+00 , 1.00e+00)" << endl; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 1" << endl; - of << "(2.00e+00 , -2.00e+00 , -2.00e+00)"; - of << "(-2.00e+00 , 2.00e+00 , -2.00e+00)"; - of << "(-2.00e+00 , -2.00e+00 , 2.00e+00)" << endl; - of << "(1.00e+00 , -1.00e+00 , -1.00e+00)"; - of << "(-1.00e+00 , 1.00e+00 , -1.00e+00)"; - of << "(-1.00e+00 , -1.00e+00 , 1.00e+00)" << endl; - of << "(1.00e+00 , 1.00e+00 , 1.00e+00)"; - of << "(1.00e+00 , 1.00e+00 , 1.00e+00)"; - of << "(1.00e+00 , 1.00e+00 , 1.00e+00)" << endl; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)" << endl; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 2" << endl; - of << "(3.00e+00 , -3.00e+00 , -3.00e+00)"; - of << "(-3.00e+00 , 3.00e+00 , -3.00e+00)"; - of << "(-3.00e+00 , -3.00e+00 , 3.00e+00)" << endl; - of << "(2.00e+00 , -2.00e+00 , -2.00e+00)"; - of << "(-2.00e+00 , 2.00e+00 , -2.00e+00)"; - of << "(-2.00e+00 , -2.00e+00 , 2.00e+00)" << endl; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)" << endl; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 3" << endl; - of << "(4.00e+00 , -4.00e+00 , -4.00e+00)"; - of << "(-4.00e+00 , 4.00e+00 , -4.00e+00)"; - of << "(-4.00e+00 , -4.00e+00 , 4.00e+00)" << endl; - of << "(3.00e+00 , -3.00e+00 , -3.00e+00)"; - of << "(-3.00e+00 , 3.00e+00 , -3.00e+00)"; - of << "(-3.00e+00 , -3.00e+00 , 3.00e+00)" << endl; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 4" << endl; - of << "(5.00e+00 , -5.00e+00 , -5.00e+00)"; - of << "(-5.00e+00 , 5.00e+00 , -5.00e+00)"; - of << "(-5.00e+00 , -5.00e+00 , 5.00e+00)" << endl; - of << "(4.00e+00 , -4.00e+00 , -4.00e+00)"; - of << "(-4.00e+00 , 4.00e+00 , -4.00e+00)"; - of << "(-4.00e+00 , -4.00e+00 , 4.00e+00)" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "==================================================K = 1" << endl; - of << "--------------------------------------------------J = 0" << endl; - of << "(2.00e+00 , -2.00e+00 , -2.00e+00)"; - of << "(-2.00e+00 , 2.00e+00 , -2.00e+00)"; - of << "(-2.00e+00 , -2.00e+00 , 2.00e+00)" << endl; - of << "(1.00e+00 , -1.00e+00 , -1.00e+00)"; - of << "(-1.00e+00 , 1.00e+00 , -1.00e+00)"; - of << "(-1.00e+00 , -1.00e+00 , 1.00e+00)" << endl; - of << "(1.00e+00 , 1.00e+00 , 1.00e+00)"; - of << "(1.00e+00 , 1.00e+00 , 1.00e+00)"; - of << "(1.00e+00 , 1.00e+00 , 1.00e+00)" << endl; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)" << endl; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 1" << endl; - of << "(3.00e+00 , -3.00e+00 , -3.00e+00)"; - of << "(-3.00e+00 , 3.00e+00 , -3.00e+00)"; - of << "(-3.00e+00 , -3.00e+00 , 3.00e+00)" << endl; - of << "(2.00e+00 , -2.00e+00 , -2.00e+00)"; - of << "(-2.00e+00 , 2.00e+00 , -2.00e+00)"; - of << "(-2.00e+00 , -2.00e+00 , 2.00e+00)" << endl; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)" << endl; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 2" << endl; - of << "(4.00e+00 , -4.00e+00 , -4.00e+00)"; - of << "(-4.00e+00 , 4.00e+00 , -4.00e+00)"; - of << "(-4.00e+00 , -4.00e+00 , 4.00e+00)" << endl; - of << "(3.00e+00 , -3.00e+00 , -3.00e+00)"; - of << "(-3.00e+00 , 3.00e+00 , -3.00e+00)"; - of << "(-3.00e+00 , -3.00e+00 , 3.00e+00)" << endl; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 3" << endl; - of << "(5.00e+00 , -5.00e+00 , -5.00e+00)"; - of << "(-5.00e+00 , 5.00e+00 , -5.00e+00)"; - of << "(-5.00e+00 , -5.00e+00 , 5.00e+00)" << endl; - of << "(4.00e+00 , -4.00e+00 , -4.00e+00)"; - of << "(-4.00e+00 , 4.00e+00 , -4.00e+00)"; - of << "(-4.00e+00 , -4.00e+00 , 4.00e+00)" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 4" << endl; - of << "(6.00e+00 , -6.00e+00 , -6.00e+00)"; - of << "(-6.00e+00 , 6.00e+00 , -6.00e+00)"; - of << "(-6.00e+00 , -6.00e+00 , 6.00e+00)" << endl; - of << "(5.00e+00 , -5.00e+00 , -5.00e+00)"; - of << "(-5.00e+00 , 5.00e+00 , -5.00e+00)"; - of << "(-5.00e+00 , -5.00e+00 , 5.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "==================================================K = 2" << endl; - of << "--------------------------------------------------J = 0" << endl; - of << "(3.00e+00 , -3.00e+00 , -3.00e+00)"; - of << "(-3.00e+00 , 3.00e+00 , -3.00e+00)"; - of << "(-3.00e+00 , -3.00e+00 , 3.00e+00)" << endl; - of << "(2.00e+00 , -2.00e+00 , -2.00e+00)"; - of << "(-2.00e+00 , 2.00e+00 , -2.00e+00)"; - of << "(-2.00e+00 , -2.00e+00 , 2.00e+00)" << endl; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; - of << "(2.00e+00 , 2.00e+00 , 2.00e+00)" << endl; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 1" << endl; - of << "(4.00e+00 , -4.00e+00 , -4.00e+00)"; - of << "(-4.00e+00 , 4.00e+00 , -4.00e+00)"; - of << "(-4.00e+00 , -4.00e+00 , 4.00e+00)" << endl; - of << "(3.00e+00 , -3.00e+00 , -3.00e+00)"; - of << "(-3.00e+00 , 3.00e+00 , -3.00e+00)"; - of << "(-3.00e+00 , -3.00e+00 , 3.00e+00)" << endl; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 2" << endl; - of << "(5.00e+00 , -5.00e+00 , -5.00e+00)"; - of << "(-5.00e+00 , 5.00e+00 , -5.00e+00)"; - of << "(-5.00e+00 , -5.00e+00 , 5.00e+00)" << endl; - of << "(4.00e+00 , -4.00e+00 , -4.00e+00)"; - of << "(-4.00e+00 , 4.00e+00 , -4.00e+00)"; - of << "(-4.00e+00 , -4.00e+00 , 4.00e+00)" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 3" << endl; - of << "(6.00e+00 , -6.00e+00 , -6.00e+00)"; - of << "(-6.00e+00 , 6.00e+00 , -6.00e+00)"; - of << "(-6.00e+00 , -6.00e+00 , 6.00e+00)" << endl; - of << "(5.00e+00 , -5.00e+00 , -5.00e+00)"; - of << "(-5.00e+00 , 5.00e+00 , -5.00e+00)"; - of << "(-5.00e+00 , -5.00e+00 , 5.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 4" << endl; - of << "(7.00e+00 , -7.00e+00 , -7.00e+00)"; - of << "(-7.00e+00 , 7.00e+00 , -7.00e+00)"; - of << "(-7.00e+00 , -7.00e+00 , 7.00e+00)" << endl; - of << "(6.00e+00 , -6.00e+00 , -6.00e+00)"; - of << "(-6.00e+00 , 6.00e+00 , -6.00e+00)"; - of << "(-6.00e+00 , -6.00e+00 , 6.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "==================================================K = 3" << endl; - of << "--------------------------------------------------J = 0" << endl; - of << "(4.00e+00 , -4.00e+00 , -4.00e+00)"; - of << "(-4.00e+00 , 4.00e+00 , -4.00e+00)"; - of << "(-4.00e+00 , -4.00e+00 , 4.00e+00)" << endl; - of << "(3.00e+00 , -3.00e+00 , -3.00e+00)"; - of << "(-3.00e+00 , 3.00e+00 , -3.00e+00)"; - of << "(-3.00e+00 , -3.00e+00 , 3.00e+00)" << endl; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; - of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 1" << endl; - of << "(5.00e+00 , -5.00e+00 , -5.00e+00)"; - of << "(-5.00e+00 , 5.00e+00 , -5.00e+00)"; - of << "(-5.00e+00 , -5.00e+00 , 5.00e+00)" << endl; - of << "(4.00e+00 , -4.00e+00 , -4.00e+00)"; - of << "(-4.00e+00 , 4.00e+00 , -4.00e+00)"; - of << "(-4.00e+00 , -4.00e+00 , 4.00e+00)" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 2" << endl; - of << "(6.00e+00 , -6.00e+00 , -6.00e+00)"; - of << "(-6.00e+00 , 6.00e+00 , -6.00e+00)"; - of << "(-6.00e+00 , -6.00e+00 , 6.00e+00)" << endl; - of << "(5.00e+00 , -5.00e+00 , -5.00e+00)"; - of << "(-5.00e+00 , 5.00e+00 , -5.00e+00)"; - of << "(-5.00e+00 , -5.00e+00 , 5.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 3" << endl; - of << "(7.00e+00 , -7.00e+00 , -7.00e+00)"; - of << "(-7.00e+00 , 7.00e+00 , -7.00e+00)"; - of << "(-7.00e+00 , -7.00e+00 , 7.00e+00)" << endl; - of << "(6.00e+00 , -6.00e+00 , -6.00e+00)"; - of << "(-6.00e+00 , 6.00e+00 , -6.00e+00)"; - of << "(-6.00e+00 , -6.00e+00 , 6.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 4" << endl; - of << "(8.00e+00 , -8.00e+00 , -8.00e+00)"; - of << "(-8.00e+00 , 8.00e+00 , -8.00e+00)"; - of << "(-8.00e+00 , -8.00e+00 , 8.00e+00)" << endl; - of << "(7.00e+00 , -7.00e+00 , -7.00e+00)"; - of << "(-7.00e+00 , 7.00e+00 , -7.00e+00)"; - of << "(-7.00e+00 , -7.00e+00 , 7.00e+00)" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << endl; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "==================================================K = 4" << endl; - of << "--------------------------------------------------J = 0" << endl; - of << "(5.00e+00 , -5.00e+00 , -5.00e+00)"; - of << "(-5.00e+00 , 5.00e+00 , -5.00e+00)"; - of << "(-5.00e+00 , -5.00e+00 , 5.00e+00)" << endl; - of << "(4.00e+00 , -4.00e+00 , -4.00e+00)"; - of << "(-4.00e+00 , 4.00e+00 , -4.00e+00)"; - of << "(-4.00e+00 , -4.00e+00 , 4.00e+00)" << endl; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; - of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 1" << endl; - of << "(6.00e+00 , -6.00e+00 , -6.00e+00)"; - of << "(-6.00e+00 , 6.00e+00 , -6.00e+00)"; - of << "(-6.00e+00 , -6.00e+00 , 6.00e+00)" << endl; - of << "(5.00e+00 , -5.00e+00 , -5.00e+00)"; - of << "(-5.00e+00 , 5.00e+00 , -5.00e+00)"; - of << "(-5.00e+00 , -5.00e+00 , 5.00e+00)" << endl; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; - of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 2" << endl; - of << "(7.00e+00 , -7.00e+00 , -7.00e+00)"; - of << "(-7.00e+00 , 7.00e+00 , -7.00e+00)"; - of << "(-7.00e+00 , -7.00e+00 , 7.00e+00)" << endl; - of << "(6.00e+00 , -6.00e+00 , -6.00e+00)"; - of << "(-6.00e+00 , 6.00e+00 , -6.00e+00)"; - of << "(-6.00e+00 , -6.00e+00 , 6.00e+00)" << endl; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; - of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 3" << endl; - of << "(8.00e+00 , -8.00e+00 , -8.00e+00)"; - of << "(-8.00e+00 , 8.00e+00 , -8.00e+00)"; - of << "(-8.00e+00 , -8.00e+00 , 8.00e+00)" << endl; - of << "(7.00e+00 , -7.00e+00 , -7.00e+00)"; - of << "(-7.00e+00 , 7.00e+00 , -7.00e+00)"; - of << "(-7.00e+00 , -7.00e+00 , 7.00e+00)" << endl; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; - of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << endl; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << endl; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)" << endl; - of << "" << endl; - of << "" << endl; - of << "--------------------------------------------------J = 4" << endl; - of << "(9.00e+00 , -9.00e+00 , -9.00e+00)"; - of << "(-9.00e+00 , 9.00e+00 , -9.00e+00)"; - of << "(-9.00e+00 , -9.00e+00 , 9.00e+00)" << endl; - of << "(8.00e+00 , -8.00e+00 , -8.00e+00)"; - of << "(-8.00e+00 , 8.00e+00 , -8.00e+00)"; - of << "(-8.00e+00 , -8.00e+00 , 8.00e+00)" << endl; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; - of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << endl; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; - of << "(9.00e+00 , 9.00e+00 , 9.00e+00)" << endl; - of << "(1.00e+01 , 1.00e+01 , 1.00e+01)"; - of << "(1.00e+01 , 1.00e+01 , 1.00e+01)"; - of << "(1.00e+01 , 1.00e+01 , 1.00e+01)" << endl; - of << "" << endl; - of << "" << endl; - of << "++++++++++vfzA+++++++++++" << endl; - of << "~~~~~~~~ field slice (0:4:1, 0:4:1) ~~~~~~~~" << endl; - of << "--------------------------------------------------J = 0" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( 1.00e+00 , 0.00e+00 )" << endl; - of << "( 2.00e+00 , 0.00e+00 ) ( 3.00e+00 , 0.00e+00 )" << endl; - of << "( 0.00e+00 , 0.00e+00 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 1" << endl; - of << "( 0.00e+00 , 5.00e+00 ) ( 6.00e+00 , 6.00e+00 )" << endl; - of << "( 7.00e+00 , 7.00e+00 ) ( 8.00e+00 , 8.00e+00 )" << endl; - of << "( 0.00e+00 , 8.00e+00 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 2" << endl; - of << "( 0.00e+00 , 1.00e+01 ) ( 1.10e+01 , 1.10e+01 )" << endl; - of << "( 1.20e+01 , 1.20e+01 ) ( 1.30e+01 , 1.30e+01 )" << endl; - of << "( 0.00e+00 , 1.30e+01 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 3" << endl; - of << "( 0.00e+00 , 1.50e+01 ) ( 1.60e+01 , 1.60e+01 )" << endl; - of << "( 1.70e+01 , 1.70e+01 ) ( 1.80e+01 , 1.80e+01 )" << endl; - of << "( 0.00e+00 , 1.80e+01 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 4" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( 1.60e+01 , 0.00e+00 )" << endl; - of << "( 1.70e+01 , 0.00e+00 ) ( 1.80e+01 , 0.00e+00 )" << endl; - of << "( 0.00e+00 , 0.00e+00 ) " << endl; - of << "" << endl; - of << "++++++++++vfzB+++++++++++" << endl; - of << "~~~~~~~~ field slice (0:4:1, 0:4:1) ~~~~~~~~" << endl; - of << "--------------------------------------------------J = 0" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( -1.00e+00 , 0.00e+00 )" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( 1.00e+00 , 0.00e+00 )" << endl; - of << "( 0.00e+00 , 0.00e+00 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 1" << endl; - of << "( 0.00e+00 , 6.00e+00 ) ( -6.00e+00 , 5.00e+00 )" << endl; - of << "( 0.00e+00 , 5.00e+00 ) ( 6.00e+00 , 6.00e+00 )" << endl; - of << "( 0.00e+00 , 6.00e+00 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 2" << endl; - of << "( 0.00e+00 , 1.10e+01 ) ( -1.10e+01 , 1.00e+01 )" << endl; - of << "( 0.00e+00 , 1.00e+01 ) ( 1.10e+01 , 1.10e+01 )" << endl; - of << "( 0.00e+00 , 1.10e+01 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 3" << endl; - of << "( 0.00e+00 , 1.60e+01 ) ( -1.60e+01 , 1.50e+01 )" << endl; - of << "( 0.00e+00 , 1.50e+01 ) ( 1.60e+01 , 1.60e+01 )" << endl; - of << "( 0.00e+00 , 1.60e+01 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 4" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( -1.60e+01 , 0.00e+00 )" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( 1.60e+01 , 0.00e+00 )" << endl; - of << "( 0.00e+00 , 0.00e+00 ) " << endl; - of << "" << endl; - of << "++++++++++vfzC+++++++++++" << endl; - of << "~~~~~~~~ field slice (0:4:1, 0:4:1) ~~~~~~~~" << endl; - of << "--------------------------------------------------J = 0" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( -6.00e+00 , 0.00e+00 )" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( 6.00e+00 , 0.00e+00 )" << endl; - of << "( 0.00e+00 , 0.00e+00 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 1" << endl; - of << "( 0.00e+00 , -6.00e+00 ) ( -1.00e+00 , -5.00e+00 )" << endl; - of << "( 0.00e+00 , -5.00e+00 ) ( 1.00e+00 , -6.00e+00 )" << endl; - of << "( 0.00e+00 , -6.00e+00 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 2" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( -1.00e+00 , 0.00e+00 )" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( 1.00e+00 , 0.00e+00 )" << endl; - of << "( 0.00e+00 , 0.00e+00 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 3" << endl; - of << "( 0.00e+00 , 6.00e+00 ) ( -6.00e+00 , 5.00e+00 )" << endl; - of << "( 0.00e+00 , 5.00e+00 ) ( 6.00e+00 , 6.00e+00 )" << endl; - of << "( 0.00e+00 , 6.00e+00 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 4" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( -6.00e+00 , 0.00e+00 )" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( 6.00e+00 , 0.00e+00 )" << endl; - of << "( 0.00e+00 , 0.00e+00 ) " << endl; - of << "" << endl; - of << "++++++++++vzA+++++++++++" << endl; - of << "~~~~~~~~ field slice (0:4:1, 0:4:1) ~~~~~~~~" << endl; - of << "--------------------------------------------------J = 0" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( 1.00e+00 , 0.00e+00 )" << endl; - of << "( 2.00e+00 , 0.00e+00 ) ( 3.00e+00 , 0.00e+00 )" << endl; - of << "( 0.00e+00 , 0.00e+00 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 1" << endl; - of << "( 0.00e+00 , 5.00e+00 ) ( 6.00e+00 , 6.00e+00 )" << endl; - of << "( 7.00e+00 , 7.00e+00 ) ( 8.00e+00 , 8.00e+00 )" << endl; - of << "( 0.00e+00 , 9.00e+00 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 2" << endl; - of << "( 0.00e+00 , 1.00e+01 ) ( 1.10e+01 , 1.10e+01 )" << endl; - of << "( 1.20e+01 , 1.20e+01 ) ( 1.30e+01 , 1.30e+01 )" << endl; - of << "( 0.00e+00 , 1.40e+01 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 3" << endl; - of << "( 0.00e+00 , 1.50e+01 ) ( 1.60e+01 , 1.60e+01 )" << endl; - of << "( 1.70e+01 , 1.70e+01 ) ( 1.80e+01 , 1.80e+01 )" << endl; - of << "( 0.00e+00 , 1.90e+01 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 4" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( 2.10e+01 , 0.00e+00 )" << endl; - of << "( 2.20e+01 , 0.00e+00 ) ( 2.30e+01 , 0.00e+00 )" << endl; - of << "( 0.00e+00 , 0.00e+00 ) " << endl; - of << "" << endl; - of << "++++++++++vzB+++++++++++" << endl; - of << "~~~~~~~~ field slice (0:4:1, 0:4:1) ~~~~~~~~" << endl; - of << "--------------------------------------------------J = 0" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( -1.00e+00 , 0.00e+00 )" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( 1.00e+00 , 0.00e+00 )" << endl; - of << "( 0.00e+00 , 0.00e+00 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 1" << endl; - of << "( 0.00e+00 , 7.00e+00 ) ( -6.00e+00 , 6.00e+00 )" << endl; - of << "( 0.00e+00 , 5.00e+00 ) ( 6.00e+00 , 6.00e+00 )" << endl; - of << "( 0.00e+00 , 7.00e+00 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 2" << endl; - of << "( 0.00e+00 , 1.20e+01 ) ( -1.10e+01 , 1.10e+01 )" << endl; - of << "( 0.00e+00 , 1.00e+01 ) ( 1.10e+01 , 1.10e+01 )" << endl; - of << "( 0.00e+00 , 1.20e+01 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 3" << endl; - of << "( 0.00e+00 , 1.70e+01 ) ( -1.60e+01 , 1.60e+01 )" << endl; - of << "( 0.00e+00 , 1.50e+01 ) ( 1.60e+01 , 1.60e+01 )" << endl; - of << "( 0.00e+00 , 1.70e+01 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 4" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( -2.10e+01 , 0.00e+00 )" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( 2.10e+01 , 0.00e+00 )" << endl; - of << "( 0.00e+00 , 0.00e+00 ) " << endl; - of << "" << endl; - of << "++++++++++vzC+++++++++++" << endl; - of << "~~~~~~~~ field slice (0:4:1, 0:4:1) ~~~~~~~~" << endl; - of << "--------------------------------------------------J = 0" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( -1.10e+01 , 0.00e+00 )" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( 1.10e+01 , 0.00e+00 )" << endl; - of << "( 0.00e+00 , 0.00e+00 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 1" << endl; - of << "( 0.00e+00 , -7.00e+00 ) ( -6.00e+00 , -6.00e+00 )" << endl; - of << "( 0.00e+00 , -5.00e+00 ) ( 6.00e+00 , -6.00e+00 )" << endl; - of << "( 0.00e+00 , -7.00e+00 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 2" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( -1.00e+00 , 0.00e+00 )" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( 1.00e+00 , 0.00e+00 )" << endl; - of << "( 0.00e+00 , 0.00e+00 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 3" << endl; - of << "( 0.00e+00 , 7.00e+00 ) ( -6.00e+00 , 6.00e+00 )" << endl; - of << "( 0.00e+00 , 5.00e+00 ) ( 6.00e+00 , 6.00e+00 )" << endl; - of << "( 0.00e+00 , 7.00e+00 ) " << endl; - of << "" << endl; - of << "--------------------------------------------------J = 4" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( -1.10e+01 , 0.00e+00 )" << endl; - of << "( 0.00e+00 , 0.00e+00 ) ( 1.10e+01 , 0.00e+00 )" << endl; - of << "( 0.00e+00 , 0.00e+00 ) " << endl; - of << "" << endl; - of << "" << endl;; - - of.close(); - return; -} -#endif // __MWERKS__ - -/*************************************************************************** - * $RCSfile: TestBC.cpp,v $ $Author: adelmann $ - * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:38 $ - * IPPL_VERSION_ID: $Id: TestBC.cpp,v 1.1.1.1 2003/01/23 07:40:38 adelmann Exp $ - ***************************************************************************/ diff --git a/ippl/test/simple/TestCartesianCentering.cpp b/ippl/test/simple/TestCartesianCentering.cpp deleted file mode 100644 index 3a1a2529adecb0c254c1940096a141bce59b3752..0000000000000000000000000000000000000000 --- a/ippl/test/simple/TestCartesianCentering.cpp +++ /dev/null @@ -1,207 +0,0 @@ -// -*- C++ -*- -/*************************************************************************** - * - * The IPPL Framework - * - * This program was prepared by PSI. - * All rights in the program are reserved by PSI. - * Neither PSI nor the author(s) - * makes any warranty, express or implied, or assumes any liability or - * responsibility for the use of this software - * - * Visit http://www.acl.lanl.gov/POOMS for more details - * - ***************************************************************************/ - -// -*- C++ -*- -/*************************************************************************** - * - * The IPPL Framework - * - * - * Visit http://people.web.psi.ch/adelmann/ for more details - * - ***************************************************************************/ - -// TestCartesianCentering.cpp -// Various tests of CartesianCentering classes. - -// include files -#include "Utility/IpplInfo.h" -#include "Utility/Inform.h" -#include "Index/NDIndex.h" -#include "FieldLayout/CenteredFieldLayout.h" -#include "Field/Field.h" -#include "Meshes/UniformCartesian.h" -#include "Meshes/CartesianCentering.h" -#include "AppTypes/Vektor.h" - -#ifdef IPPL_USE_STANDARD_HEADERS -#include <fstream> -using namespace std; -#else -#include <fstream> -#endif - -// forward declarations -void hardCodedOutput(char* filename); // Prototype of function defined below. -bool thediff(char* filename1, char* filename2); -extern const CenteringEnum zz[2] = {CELL, VERTEX}; - - -int main(int argc, char *argv[]) -{ - Ippl ippl(argc,argv); - Inform testmsg(argv[0]); - bool passed = true; // Pass/fail test - - // For writing file output to compare against hardcoded correct file output: - Inform fdi(NULL,"text.test.TestCartesianCentering",Inform::OVERWRITE,0); - - const unsigned nx=4, ny=4, nz=4; - Index I(nx), J(ny), K(nz); - - const unsigned ND3 = 3; - typedef UniformCartesian<ND3> M3; - M3 m3(I,J,K); - - const unsigned ND2 = 2; - typedef UniformCartesian<ND2> M2; - M2 m2(I,J); - -#ifdef __MWERKS__ - // Work around CW4 default-template-parameter bug - typedef CommonCartesianCenterings<ND2,1U,0U>::allCell CA; -#else - typedef CommonCartesianCenterings<ND2,1U>::allCell CA; -#endif // __MWERKS__ - CenteredFieldLayout<ND2,M2,CA> clA(m2); - Field<double, ND2, M2, CA > A(clA); - A.print_Centerings(fdi.getStream()); - - typedef CartesianCentering<zz,ND2,1U> CB; - CenteredFieldLayout<ND2,M2,CB> clB(m2); - Field<double, ND2, M2, CB > B(clB); - B.print_Centerings(fdi.getStream()); - - typedef CommonCartesianCenterings<ND3,1U,1U>::allFace CC; - CenteredFieldLayout<ND3,M3,CC> clC(m3); - Field<double, ND3, M3, CC> C(clC); - C.print_Centerings(fdi.getStream()); - -#ifdef __MWERKS__ - // Work around CW4 default-template-parameter bug - typedef CommonCartesianCenterings<ND3,3U,0U>::allVertex CD; -#else - typedef CommonCartesianCenterings<ND3,3U>::allVertex CD; -#endif // __MWERKS__ - CenteredFieldLayout<ND3,M3,CD> clD(m3); - Field<Vektor<double,ND3>, ND3, M3, CD> D(clD); - D.print_Centerings(fdi.getStream()); - -#ifdef __MWERKS__ - // Work around CW4 default-template-parameter bug - typedef CommonCartesianCenterings<ND3,3U,0U>::vectorFace CE; -#else - typedef CommonCartesianCenterings<ND3,3U>::vectorFace CE; -#endif // __MWERKS__ - CenteredFieldLayout<ND3,M3,CE> clE(m3); - Field<Vektor<double,ND3>, ND3, M3, CE> E(clE); - E.print_Centerings(fdi.getStream()); - - fdi << endl ; // Needed to flush output to file - - // Write out "by hand" into another file what the previous field-printing - // functions should have produced; this will be compared with what they - // actually did produce: - hardCodedOutput("text.correct.TestCartesianCentering"); - - // Compare the two files by mocking up the Unix "diff" command: - passed = thediff("text.test.TestCartesianCentering", - "text.correct.TestCartesianCentering"); - - testmsg << ( (passed) ? "PASSED" : "FAILED" ) << endl; - return 0; -} - -//----------------------------------------------------------------------------- -// Mock up the Unix "diff" utility to compare two files: -//----------------------------------------------------------------------------- -bool thediff(char* filename1, char* filename2) -{ - bool same = true; - char ch1, ch2; - ifstream file1(filename1); - ifstream file2(filename2); - while (file1.get(ch1)) { // Read file 1 char-by-char until eof - if (file2.get(ch2)) { // Read equivalent char from file 2 - if (ch1 != ch2) same = false; // If they're different,files are different - } - else { - same = false; // If file 2 ends before file 1, different - } - } - return same; -} - -//----------------------------------------------------------------------------- -void hardCodedOutput(char* filename) -{ - ofstream of(filename); -#ifdef __MWERKS__ - of -#else - of << "CartesianCentering: no specialized name (yet) for this case" << endl -#endif - << "Dim = 2 ; NComponents = 1" << endl - << "centering[dim=0][component=0] = CELL " << endl - << "centering[dim=1][component=0] = CELL " << endl -#ifndef __MWERKS__ - << "CartesianCentering: no specialized name (yet) for this case" << endl -#endif // __MWERKS__ - << "Dim = 2 ; NComponents = 1" << endl - << "centering[dim=0][component=0] = CELL " << endl - << "centering[dim=1][component=0] = VERTEX" << endl -#ifndef __MWERKS__ - << "CartesianCentering: no specialized name (yet) for this case" << endl -#endif // __MWERKS__ - << "Dim = 3 ; NComponents = 1" << endl - << "centering[dim=0][component=0] = CELL " << endl - << "centering[dim=1][component=0] = VERTEX" << endl - << "centering[dim=2][component=0] = CELL " << endl -#ifndef __MWERKS__ - << "CartesianCentering: no specialized name (yet) for this case" << endl -#endif // __MWERKS__ - << "Dim = 3 ; NComponents = 3" << endl - << "centering[dim=0][component=0] = VERTEX" << endl - << "centering[dim=0][component=1] = VERTEX" << endl - << "centering[dim=0][component=2] = VERTEX" << endl - << "centering[dim=1][component=0] = VERTEX" << endl - << "centering[dim=1][component=1] = VERTEX" << endl - << "centering[dim=1][component=2] = VERTEX" << endl - << "centering[dim=2][component=0] = VERTEX" << endl - << "centering[dim=2][component=1] = VERTEX" << endl - << "centering[dim=2][component=2] = VERTEX" << endl -#ifndef __MWERKS__ - << "CartesianCentering: no specialized name (yet) for this case" << endl -#endif // __MWERKS__ - << "Dim = 3 ; NComponents = 3" << endl - << "centering[dim=0][component=0] = VERTEX" << endl - << "centering[dim=0][component=1] = CELL " << endl - << "centering[dim=0][component=2] = CELL " << endl - << "centering[dim=1][component=0] = CELL " << endl - << "centering[dim=1][component=1] = VERTEX" << endl - << "centering[dim=1][component=2] = CELL " << endl - << "centering[dim=2][component=0] = CELL " << endl - << "centering[dim=2][component=1] = CELL " << endl - << "centering[dim=2][component=2] = VERTEX" << endl - << endl; - of.close(); - return; -} - -/*************************************************************************** - * $RCSfile: TestCartesianCentering.cpp,v $ $Author: adelmann $ - * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:38 $ - * IPPL_VERSION_ID: $Id: TestCartesianCentering.cpp,v 1.1.1.1 2003/01/23 07:40:38 adelmann Exp $ - ***************************************************************************/ diff --git a/ippl/test/simple/TestEureka.cpp b/ippl/test/simple/TestEureka.cpp deleted file mode 100644 index b88170d6fe7835c90cfeaf6df086bb085b09f42d..0000000000000000000000000000000000000000 --- a/ippl/test/simple/TestEureka.cpp +++ /dev/null @@ -1,153 +0,0 @@ -// -*- C++ -*- -/*************************************************************************** - * - * The IPPL Framework - * - * This program was prepared by PSI. - * All rights in the program are reserved by PSI. - * Neither PSI nor the author(s) - * makes any warranty, express or implied, or assumes any liability or - * responsibility for the use of this software - * - * Visit http://www.acl.lanl.gov/POOMS for more details - * - ***************************************************************************/ - -// -*- C++ -*- -// ---------------------------------------------------------------------------- -// The IPPL Framework - Visit http://people.web.psi.ch/adelmann/ for more details -// -// This program was prepared by the Regents of the University of California at -// TestEureka.cpp -// Test Eureka boundary condition - -// include files -#include "Utility/IpplInfo.h" -#include "Utility/Inform.h" -#include "Index/NDIndex.h" -#include "FieldLayout/FieldLayout.h" -#include "Field/Field.h" -#include "Field/BCond.h" -#include "Meshes/UniformCartesian.h" -#include "Meshes/CartesianCentering.h" -#include "AppTypes/Vektor.h" - -#include <stdio.h> - -// define some helper functions for printing out a Field - -template <class M, class C> -void print(Field<double,2,M,C>& f) -{ - NDIndex<2> domain = f.getDomain(); - for (int j=domain[1].max(); j>=domain[1].min(); --j) - { - for (int i=domain[0].min(); i<=domain[0].max(); ++i) - printf("%6.0f ",f[i][j].get()); - printf("\n"); - } - return; -} - -template <class M, class C> -void print(Field<Vektor<double,2>,2,M,C>& f) -{ - NDIndex<2> domain = f.getDomain(); - for (int j=domain[1].max(); j>=domain[1].min(); --j) - { - for (int i=domain[0].min(); i<=domain[0].max(); ++i) - { - Vektor<double,2> x = f[i][j].get(); - printf("(%2.0f,%2.0f)",x[0],x[1]); - } - printf("\n"); - } - return; -} - - -int main(int argc, char *argv[]) -{ - Ippl ippl(argc,argv); - Inform out(argv[0]); - const int N = 6; - Index I(1,N), J(1,N); - Index I0(-1,N+2), J0(-1,N+2); - Index I1(2,N-1),J1(2,N-1); - - FieldLayout<2> layout(I,J); - FieldLayout<2> layout0(I0,J0); - GuardCellSizes<2> gc(2); - - // Test all cell centering. - BConds<double,2> bc1; - bc1[1] = new EurekaFace<double,2>(0); - bc1[2] = new EurekaFace<double,2>(1); - bc1[3] = new EurekaFace<double,2>(2); - bc1[4] = new EurekaFace<double,2>(3); - - Field<double,2> A1(layout,gc,bc1), A0(layout0); - - A1[I][J] = 10.0*I + 100.0*J; - //cout << "A1:" << endl; - //print(A1); - - // Assign the full domain to A0. - A0[I0][J0] = A1[I0][J0]; - - // See if we got the right answer. - // s1 should be zero. - A0[I1][J1] -= 10.0*I1 + 100.0*J1; - - double s1 = sum(A0*A0); - /* - // Do pass/fail test below - if ( s1 == 0 ) - out << "PASSED" << endl; - else - out << "FAILED" << endl; - */ - - // Test mixed centering. - typedef Vektor<double,2> T; - typedef UniformCartesian<2> M; - typedef CartesianCentering<CCCEnums<2,2,0>::vectorFace,2,2> C; - BConds<T,2,M,C> bc2; - bc2[0] = new EurekaFace<T,2,M,C>(0,0); - bc2[1] = new EurekaFace<T,2,M,C>(1,0); - bc2[2] = new EurekaFace<T,2,M,C>(2,0); - bc2[3] = new EurekaFace<T,2,M,C>(3,0); - bc2[4] = new EurekaFace<T,2,M,C>(0,1); - bc2[5] = new EurekaFace<T,2,M,C>(1,1); - bc2[6] = new EurekaFace<T,2,M,C>(2,1); - bc2[7] = new EurekaFace<T,2,M,C>(3,1); - - Field<T,2,M,C> B1(layout,gc,bc2), B0(layout0); - - // Fill with nontrivial data. - B1[I][J] = T(1,1)*(I + 10.0*J); - - // Pull it out into a field that shows the guard layers. - B0[I0][J0] = B1[I0][J0]; - - // See if we got the right answer. - B0[I1][J1] -= T(1,1)*(I1+10.0*J1); - B0[1][J1] -= T(0,1)*(1+10.0*J1); - B0[N][J1] -= T(0,1)*(N+10.0*J1); - B0[I1][1] -= T(1,0)*(I1+10.0); - B0[I1][N] -= T(1,0)*(I1+10.0*N); - - Vektor<T,2> s2 = sum(B0*B0); - if ( s1 == 0 && s2 == Vektor<T,2>(0,0) ) - out << "PASSED" << endl; - else - out << "FAILED" << endl; - - return 0; -} - -/*************************************************************************** - * $RCSfile: TestEureka.cpp,v $ $Author: adelmann $ - * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:38 $ - * IPPL_VERSION_ID: $Id: TestEureka.cpp,v 1.1.1.1 2003/01/23 07:40:38 adelmann Exp $ - ***************************************************************************/ diff --git a/ippl/test/simple/TestFieldDebug.cpp b/ippl/test/simple/TestFieldDebug.cpp deleted file mode 100644 index 6dfb8a0a1557df5fd6ff0f1363affa2136adabac..0000000000000000000000000000000000000000 --- a/ippl/test/simple/TestFieldDebug.cpp +++ /dev/null @@ -1,505 +0,0 @@ -// -*- C++ -*- -/*************************************************************************** - * - * The IPPL Framework - * - * This program was prepared by PSI. - * All rights in the program are reserved by PSI. - * Neither PSI nor the author(s) - * makes any warranty, express or implied, or assumes any liability or - * responsibility for the use of this software - * - * Visit http://www.acl.lanl.gov/POOMS for more details - * - ***************************************************************************/ - -// -*- C++ -*- -/*************************************************************************** - * - * The IPPL Framework - * - * - * Visit http://people.web.psi.ch/adelmann/ for more details - * - ***************************************************************************/ - -// TestFieldDebug.cpp , Tim Williams 10/21/1996 -// This tests the functions [e,s]fp[1,2,3]() and the function setFormat() from -// Utility/FieldDebug.[h,cpp] . These are meant to be called from the debugger, -// but this function tests whether they work (for a couple of possible calls) -// within a program. It also includes specialized function definitions like the -// user of FieldDebug must have in his own source code in order to be able to -// access callable functions from the debugger, as an example for users. This -// function also tests the setInform() function, to specify the Inform object -// used internally by FieldDebug functions. Constructing an Inform object that -// writes into a file makes it easy to do the comparson with correct output. - -// include files -#include "Utility/IpplInfo.h" -#include "Utility/Inform.h" -#include "Index/NDIndex.h" -#include "FieldLayout/FieldLayout.h" -#include "Field/Field.h" -#include "Field/BCond.h" -#include "Field/GuardCellSizes.h" -#include "AppTypes/Vektor.h" -#include "Utility/FieldDebug.h" - -#ifdef IPPL_USE_STANDARD_HEADERS -#include <fstream> -using namespace std; -#else -#include <fstream> -#endif - -//----------------------------------------------------------------------------- -// User-inserted prototypes to get debugger access (examples for user ref.): -// Scalar (double): -void dfp3(BareField<double,3U> f) {fp3(f);} -void defp3(BareField<double,3U> f, int i, int j, int k) {efp3(f,i,j,k);} -void dsfp3(BareField<double,3U>& f, - int base1, int bound1, int stride1, - int base2, int bound2, int stride2, - int base3, int bound3, int stride3) { - sfp3(f,base1,bound1,stride1,base2,bound2,stride2,base3,bound3,stride3);} -// Vektor (double): -void vdfp3(BareField<Vektor<double,3U>,3U> f) {fp3(f);} -void vdefp3(BareField<Vektor<double,3U>,3U> f, int i, int j, int k) { - efp3(f,i,j,k);} -void vdsfp3(BareField<Vektor<double,3U>,3U>& f, - int base1, int bound1, int stride1, - int base2, int bound2, int stride2, - int base3, int bound3, int stride3) { - sfp3(f,base1,bound1,stride1,base2,bound2,stride2,base3,bound3,stride3);} -//----------------------------------------------------------------------------- - -// forward declarations -void hardCodedOutput(char* filename); // Prototype of function defined below. -bool thediff(char* filename1, char* filename2); - - -int main(int argc, char *argv[]) -{ - Ippl ippl(argc,argv); - Inform testmsg(argv[0]); - bool passed = true; // Pass/fail test - - bool docomm = true; // Should try the test both ways, really.... - - const unsigned Dim3=3; - - int nCells[Dim3]; // Number of grid cells in each direction - unsigned nVNodes[Dim3]; // Number of vnodes (subdomains) in each direction. - - // Hardwired values for automated test, as in regression testing: - for (int d=0; d<Dim3; d++) nCells[d] = 4; - for (int d=0; d<Dim3; d++) nVNodes[d] = 2; - -#ifdef TESTFIELDDEBUG_MANUAL_TEST // Set this flag for non-automated test - - // Read in the command-line arguments, appropriate number for Dim: - int argcForDim = 1 + 2*Dim3 + 1; - if (argc != argcForDim) { - testmsg << "Usage: " << argv[0] - << " <nx> [<ny> [<nz>]]" - << " <vnodesX> [<vnodesY> [<vnodesZ>]]" - << " <docomm (1=true,0=false)>" << endl; - exit(1); - } - int av = 0; - for (int d=0; d<Dim3; d++) nCells[d] = atoi(argv[++av]); - for (int d=0; d<Dim3; d++) nVNodes[d] = atoi(argv[++av]); - int docommInt = atoi(argv[++av]); - if (docommInt == 1) { - docomm = true; - } else { - docomm = false; - } - -#endif // TESTFIELDDEBUG_MANUAL_TEST - - int nx, ny, nz; - nx = nCells[0]; ny = nCells[1]; nz = nCells[2]; - - Index I(nx); Index J(ny); Index K(nz); - // Specify multipple vnodes (8) to make sure this works right: - // FieldLayout<Dim3> layout3(I,J,K,PARALLEL,PARALLEL,PARALLEL,8); - NDIndex<Dim3> ndi; ndi[0] = I; ndi[1] = J; ndi[2] = K; - e_dim_tag serialParallelSpec[Dim3]; - for (int d=0; d<Dim3; d++) serialParallelSpec[d] = PARALLEL; - FieldLayout<Dim3> layout3(ndi, serialParallelSpec, nVNodes); - - // New Inform-based version (tjw): - Inform* fdip = - new Inform(NULL,"text.test.TestFieldDebug",Inform::OVERWRITE,0); - Inform& fdi = *fdip; - setInform(fdi); - - // Put guard cells and red-flag (value = -999) boundary conditions on - // Fields, to make sure nothing funny is happening: - GuardCellSizes<Dim3> gc(2); - BConds<double,Dim3> sbc; - for (int face=0; face < 2*Dim3; face++) { - sbc[face] = new ConstantFace<double,Dim3>(face,-999.0); - } - BConds<Vektor<double,Dim3>,Dim3> vbc; - for (int face=0; face < 2*Dim3; face++) { - vbc[face] = new ConstantFace<Vektor<double,Dim3>,Dim3>(face,-999.0); - } - - // Scalar Field ------------------------------------------------------------- - Field<double,Dim3> A3(layout3,sbc,gc); - assign(A3[I][J][K], I + J + K); - - fdi << endl << "--------fp3(A3)-------" << endl; - fp3(A3,docomm); - - fdi << endl << "--------sfp3(A3,nx-1,1,0,ny-1,1,0,nz-1,1)-------" << endl; - sfp3(A3,0,nx-1,1,0,ny-1,1,0,nz-1,1,docomm); - - fdi << endl << "--------sfp3(A3,nx-1,1,0,ny-1,2,0,nz-1,2)-------" << endl; - sfp3(A3,0,nx-1,1,0,ny-1,1,0,nz-1,1,docomm); - - - // Vector Field-------------------------------------------------------------- - Field<Vektor<double,Dim3>,Dim3> B3(layout3,vbc,gc); - Vektor<double, Dim3 > Vinit3(1.0,2.0,3.0); - assign(B3,Vinit3); - - fdi << endl << "--------setFormat(1,8)-------" << endl; - setFormat(1,8); - - fdi << endl << "--------fp3(B3)-------" << endl; - fp3(B3,docomm); - - // Write out "by hand" into another file what the previous field-printing - // functions should have produced; this will be compared with what they - // actually did produce: - hardCodedOutput("text.correct.TestFieldDebug"); - - // Compare the two files by mocking up the Unix "diff" command: - delete fdip; - passed = thediff("text.test.TestFieldDebug","text.correct.TestFieldDebug"); - - testmsg << ( (passed) ? "PASSED" : "FAILED" ) << endl; - return 0; -} - -//----------------------------------------------------------------------------- -// Mock up the Unix "diff" utility to compare two files: -//----------------------------------------------------------------------------- -bool thediff(char* filename1, char* filename2) -{ - bool same = true; - char ch1, ch2; - ifstream file1(filename1); - ifstream file2(filename2); - while (file1.get(ch1)) { // Read file 1 char-by-char until eof - if (file2.get(ch2)) { // Read equivalent char from file 2 - if (ch1 != ch2) same = false; // If they're different,files are different - } else { - same = false; // If file 2 ends before file 1, different - } - } - return(same); -} - -//----------------------------------------------------------------------------- -void hardCodedOutput(char* filename) -{ - ofstream of(filename); - of << endl - << "--------fp3(A3)-------" << endl - << "~~~~~~~~ field slice (0:3:1, 0:3:1, 0:3:1) ~~~~~~~~" << endl - << "==================================================K = 0" << endl - << "--------------------------------------------------J = 0" << endl - << "0.000e+00 1.000e+00 2.000e+00 3.000e+00 " << endl - << "" << endl - << "--------------------------------------------------J = 1" << endl - << "1.000e+00 2.000e+00 3.000e+00 4.000e+00 " << endl - << "" << endl - << "--------------------------------------------------J = 2" << endl - << "2.000e+00 3.000e+00 4.000e+00 5.000e+00 " << endl - << "" << endl - << "--------------------------------------------------J = 3" << endl - << "3.000e+00 4.000e+00 5.000e+00 6.000e+00 " << endl - << "" << endl - << "==================================================K = 1" << endl - << "--------------------------------------------------J = 0" << endl - << "1.000e+00 2.000e+00 3.000e+00 4.000e+00 " << endl - << "" << endl - << "--------------------------------------------------J = 1" << endl - << "2.000e+00 3.000e+00 4.000e+00 5.000e+00 " << endl - << "" << endl - << "--------------------------------------------------J = 2" << endl - << "3.000e+00 4.000e+00 5.000e+00 6.000e+00 " << endl - << "" << endl - << "--------------------------------------------------J = 3" << endl - << "4.000e+00 5.000e+00 6.000e+00 7.000e+00 " << endl - << "" << endl - << "==================================================K = 2" << endl - << "--------------------------------------------------J = 0" << endl - << "2.000e+00 3.000e+00 4.000e+00 5.000e+00 " << endl - << "" << endl - << "--------------------------------------------------J = 1" << endl - << "3.000e+00 4.000e+00 5.000e+00 6.000e+00 " << endl - << "" << endl - << "--------------------------------------------------J = 2" << endl - << "4.000e+00 5.000e+00 6.000e+00 7.000e+00 " << endl - << "" << endl - << "--------------------------------------------------J = 3" << endl - << "5.000e+00 6.000e+00 7.000e+00 8.000e+00 " << endl - << "" << endl - << "==================================================K = 3" << endl - << "--------------------------------------------------J = 0" << endl - << "3.000e+00 4.000e+00 5.000e+00 6.000e+00 " << endl - << "" << endl - << "--------------------------------------------------J = 1" << endl - << "4.000e+00 5.000e+00 6.000e+00 7.000e+00 " << endl - << "" << endl - << "--------------------------------------------------J = 2" << endl - << "5.000e+00 6.000e+00 7.000e+00 8.000e+00 " << endl - << "" << endl - << "--------------------------------------------------J = 3" << endl - << "6.000e+00 7.000e+00 8.000e+00 9.000e+00 " << endl - << "" << endl - << "" << endl - << "--------sfp3(A3,nx-1,1,0,ny-1,1,0,nz-1,1)-------" << endl - << "~~~~~~~~ field slice (0:3:1, 0:3:1, 0:3:1) ~~~~~~~~" << endl - << "==================================================K = 0" << endl - << "--------------------------------------------------J = 0" << endl - << "0.000e+00 1.000e+00 2.000e+00 3.000e+00 " << endl - << "" << endl - << "--------------------------------------------------J = 1" << endl - << "1.000e+00 2.000e+00 3.000e+00 4.000e+00 " << endl - << "" << endl - << "--------------------------------------------------J = 2" << endl - << "2.000e+00 3.000e+00 4.000e+00 5.000e+00 " << endl - << "" << endl - << "--------------------------------------------------J = 3" << endl - << "3.000e+00 4.000e+00 5.000e+00 6.000e+00 " << endl - << "" << endl - << "==================================================K = 1" << endl - << "--------------------------------------------------J = 0" << endl - << "1.000e+00 2.000e+00 3.000e+00 4.000e+00 " << endl - << "" << endl - << "--------------------------------------------------J = 1" << endl - << "2.000e+00 3.000e+00 4.000e+00 5.000e+00 " << endl - << "" << endl - << "--------------------------------------------------J = 2" << endl - << "3.000e+00 4.000e+00 5.000e+00 6.000e+00 " << endl - << "" << endl - << "--------------------------------------------------J = 3" << endl - << "4.000e+00 5.000e+00 6.000e+00 7.000e+00 " << endl - << "" << endl - << "==================================================K = 2" << endl - << "--------------------------------------------------J = 0" << endl - << "2.000e+00 3.000e+00 4.000e+00 5.000e+00 " << endl - << "" << endl - << "--------------------------------------------------J = 1" << endl - << "3.000e+00 4.000e+00 5.000e+00 6.000e+00 " << endl - << "" << endl - << "--------------------------------------------------J = 2" << endl - << "4.000e+00 5.000e+00 6.000e+00 7.000e+00 " << endl - << "" << endl - << "--------------------------------------------------J = 3" << endl - << "5.000e+00 6.000e+00 7.000e+00 8.000e+00 " << endl - << "" << endl - << "==================================================K = 3" << endl - << "--------------------------------------------------J = 0" << endl - << "3.000e+00 4.000e+00 5.000e+00 6.000e+00 " << endl - << "" << endl - << "--------------------------------------------------J = 1" << endl - << "4.000e+00 5.000e+00 6.000e+00 7.000e+00 " << endl - << "" << endl - << "--------------------------------------------------J = 2" << endl - << "5.000e+00 6.000e+00 7.000e+00 8.000e+00 " << endl - << "" << endl - << "--------------------------------------------------J = 3" << endl - << "6.000e+00 7.000e+00 8.000e+00 9.000e+00 " << endl - << "" << endl - << "" << endl - << "--------sfp3(A3,nx-1,1,0,ny-1,2,0,nz-1,2)-------" << endl - << "~~~~~~~~ field slice (0:3:1, 0:3:1, 0:3:1) ~~~~~~~~" << endl - << "==================================================K = 0" << endl - << "--------------------------------------------------J = 0" << endl - << "0.000e+00 1.000e+00 2.000e+00 3.000e+00 " << endl - << "" << endl - << "--------------------------------------------------J = 1" << endl - << "1.000e+00 2.000e+00 3.000e+00 4.000e+00 " << endl - << "" << endl - << "--------------------------------------------------J = 2" << endl - << "2.000e+00 3.000e+00 4.000e+00 5.000e+00 " << endl - << "" << endl - << "--------------------------------------------------J = 3" << endl - << "3.000e+00 4.000e+00 5.000e+00 6.000e+00 " << endl - << "" << endl - << "==================================================K = 1" << endl - << "--------------------------------------------------J = 0" << endl - << "1.000e+00 2.000e+00 3.000e+00 4.000e+00 " << endl - << "" << endl - << "--------------------------------------------------J = 1" << endl - << "2.000e+00 3.000e+00 4.000e+00 5.000e+00 " << endl - << "" << endl - << "--------------------------------------------------J = 2" << endl - << "3.000e+00 4.000e+00 5.000e+00 6.000e+00 " << endl - << "" << endl - << "--------------------------------------------------J = 3" << endl - << "4.000e+00 5.000e+00 6.000e+00 7.000e+00 " << endl - << "" << endl - << "==================================================K = 2" << endl - << "--------------------------------------------------J = 0" << endl - << "2.000e+00 3.000e+00 4.000e+00 5.000e+00 " << endl - << "" << endl - << "--------------------------------------------------J = 1" << endl - << "3.000e+00 4.000e+00 5.000e+00 6.000e+00 " << endl - << "" << endl - << "--------------------------------------------------J = 2" << endl - << "4.000e+00 5.000e+00 6.000e+00 7.000e+00 " << endl - << "" << endl - << "--------------------------------------------------J = 3" << endl - << "5.000e+00 6.000e+00 7.000e+00 8.000e+00 " << endl - << "" << endl - << "==================================================K = 3" << endl - << "--------------------------------------------------J = 0" << endl - << "3.000e+00 4.000e+00 5.000e+00 6.000e+00 " << endl - << "" << endl - << "--------------------------------------------------J = 1" << endl - << "4.000e+00 5.000e+00 6.000e+00 7.000e+00 " << endl - << "" << endl - << "--------------------------------------------------J = 2" << endl - << "5.000e+00 6.000e+00 7.000e+00 8.000e+00 " << endl - << "" << endl - << "--------------------------------------------------J = 3" << endl - << "6.000e+00 7.000e+00 8.000e+00 9.000e+00 " << endl - << "" << endl - << "" << endl - << "--------setFormat(1,8)-------" << endl - << "" << endl - << "--------fp3(B3)-------" << endl - << "~~~~~~~~ field slice (0:3:1, 0:3:1, 0:3:1) ~~~~~~~~" << endl - << "==================================================K = 0" << endl - << "--------------------------------------------------J = 0" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "" << endl - << "" << endl - << "--------------------------------------------------J = 1" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "" << endl - << "" << endl - << "--------------------------------------------------J = 2" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "" << endl - << "" << endl - << "--------------------------------------------------J = 3" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "" << endl - << "" << endl - << "==================================================K = 1" << endl - << "--------------------------------------------------J = 0" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "" << endl - << "" << endl - << "--------------------------------------------------J = 1" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "" << endl - << "" << endl - << "--------------------------------------------------J = 2" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "" << endl - << "" << endl - << "--------------------------------------------------J = 3" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "" << endl - << "" << endl - << "==================================================K = 2" << endl - << "--------------------------------------------------J = 0" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "" << endl - << "" << endl - << "--------------------------------------------------J = 1" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "" << endl - << "" << endl - << "--------------------------------------------------J = 2" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "" << endl - << "" << endl - << "--------------------------------------------------J = 3" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "" << endl - << "" << endl - << "==================================================K = 3" << endl - << "--------------------------------------------------J = 0" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "" << endl - << "" << endl - << "--------------------------------------------------J = 1" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "" << endl - << "" << endl - << "--------------------------------------------------J = 2" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "" << endl - << "" << endl - << "--------------------------------------------------J = 3" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << endl - << "" << endl - << "" << endl; - of.close(); - return; -} - -/*************************************************************************** - * $RCSfile: TestFieldDebug.cpp,v $ $Author: adelmann $ - * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:38 $ - * IPPL_VERSION_ID: $Id: TestFieldDebug.cpp,v 1.1.1.1 2003/01/23 07:40:38 adelmann Exp $ - ***************************************************************************/ diff --git a/ippl/test/simple/TestScalarIndexing.cpp b/ippl/test/simple/TestScalarIndexing.cpp deleted file mode 100644 index 33ae49a93e858955f145d8328f3451d4db0145c8..0000000000000000000000000000000000000000 --- a/ippl/test/simple/TestScalarIndexing.cpp +++ /dev/null @@ -1,96 +0,0 @@ -// -*- C++ -*- -/*************************************************************************** - * - * The IPPL Framework - * - * This program was prepared by PSI. - * All rights in the program are reserved by PSI. - * Neither PSI nor the author(s) - * makes any warranty, express or implied, or assumes any liability or - * responsibility for the use of this software - * - * Visit http://www.acl.lanl.gov/POOMS for more details - * - ***************************************************************************/ - -// -*- C++ -*- -/*************************************************************************** - * - * The IPPL Framework - * - * - * Visit http://people.web.psi.ch/adelmann/ for more details - * - ***************************************************************************/ - -// TestScalarIndexing.cpp , Tim Williams 10/23/1996 -// This tests indexing Field objects with scalar index values. - -// include files -#include "Utility/IpplInfo.h" -#include "Utility/Inform.h" -#include "Index/Index.h" -#include "FieldLayout/FieldLayout.h" -#include "Field/Field.h" -#include "Meshes/UniformCartesian.h" -#include "AppTypes/Vektor.h" -#include "AppTypes/Tenzor.h" -#include "AppTypes/SymTenzor.h" - -// set dimensionality and problem size -const unsigned Dim=3; -const unsigned nx = 4, ny = 4, nz = 4; - - -int main(int argc, char *argv[]) -{ - Ippl ippl(argc,argv); - Inform testmsg(argv[0]); - - Index I(nx), J(ny), K(nz); - FieldLayout<Dim> layout(I,J,K); - - // Instantiate and initialize scalar, vector, tensor fields: - Field<double,Dim> scalarFld(layout); - double scalar = 1.0; - scalarFld << scalar; - Field<Vektor<double,Dim>,Dim> vectorFld(layout); - Vektor<double, Dim> vector(1.0,2.0,3.0); - vectorFld << vector; - Field<Tenzor<double,Dim>,Dim,UniformCartesian<Dim> > tensorFld(layout); - Tenzor<double, Dim> tensor(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); - tensorFld << tensor; - Field<SymTenzor<double,Dim>,Dim,UniformCartesian<Dim> > symTensorFld(layout); - SymTenzor<double, Dim> symTensor(1.0, 2.0, 3.0, 4.0, 5.0, 6.0); - symTensorFld << symTensor; - - // Now try the scalar indexing: - double scalar1 = 0.0; - Vektor<double, Dim> vector1(0.0, 0.0, 0.0); - Tenzor<double, Dim> tensor1(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); - SymTenzor<double, Dim> symTensor1(0.0, 0.0, 0.0, 0.0, 0.0, 0.0); - scalar1 = scalarFld[1][1][1].get(); - vector1 = vectorFld[1][1][1].get(); - tensor1 = tensorFld[1][1][1].get(); - symTensor1 = symTensorFld[1][1][1].get(); - - bool works = true; - if (scalar1 != scalar) works = false; - if (vector1 != vector) works = false; - if (tensor1 != tensor) works = false; - if (symTensor1 != symTensor) works = false; - - if (works) { - testmsg << "PASSED!" << endl; - } - else { - testmsg << "FAILED!" << endl; - } - return 0; -} - -/*************************************************************************** - * $RCSfile: TestScalarIndexing.cpp,v $ $Author: adelmann $ - * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:39 $ - * IPPL_VERSION_ID: $Id: TestScalarIndexing.cpp,v 1.1.1.1 2003/01/23 07:40:39 adelmann Exp $ - ***************************************************************************/ diff --git a/ippl/test/simple/TestTensorUnaryOps.cpp b/ippl/test/simple/TestTensorUnaryOps.cpp deleted file mode 100644 index 920fb0e56aad1f536214b3aacd89280fa80bef6f..0000000000000000000000000000000000000000 --- a/ippl/test/simple/TestTensorUnaryOps.cpp +++ /dev/null @@ -1,369 +0,0 @@ -// -*- C++ -*- -/*************************************************************************** - * - * The IPPL Framework - * - * This program was prepared by PSI. - * All rights in the program are reserved by PSI. - * Neither PSI nor the author(s) - * makes any warranty, express or implied, or assumes any liability or - * responsibility for the use of this software - * - * Visit http://www.acl.lanl.gov/POOMS for more details - * - ***************************************************************************/ - -// -*- C++ -*- -/*************************************************************************** - * - * The IPPL Framework - * - * - * Visit http://people.web.psi.ch/adelmann/ for more details - * - ***************************************************************************/ - -// TestTensorUnaryOps.cpp , Tim Williams 10/19/1999 -// Tests trace(), det(), transpose(), cofactors() with Tenzor, SymTenzor, -// AntiSymTenzor operands. - -// include files -#include "Utility/IpplInfo.h" -#include "Utility/Inform.h" -#include "Index/NDIndex.h" -#include "FieldLayout/FieldLayout.h" -#include "Field/Field.h" -#include "Meshes/UniformCartesian.h" -#include "AppTypes/Vektor.h" -#include "AppTypes/Tenzor.h" -#include "AppTypes/SymTenzor.h" -#include "AppTypes/AntiSymTenzor.h" - -// define helper class for performing tests in 1D, 2D, and 3D -template <int Dim> -class testTensorUnaryOps -{ -public: - static bool apply(Inform& testmsg) - { - bool passedAllTests = true; - - NDIndex<Dim> domain; - int nCellsTot = 1; - for (int d = 0; d < Dim; d++) { - domain[d] = Index(5); - nCellsTot *= 5; - } - FieldLayout<Dim> layout(domain); - typedef UniformCartesian<Dim> Mesh; - typedef Tenzor<double,Dim> FT_t; - typedef AntiSymTenzor<double,Dim> AT_t; - typedef SymTenzor<double,Dim> ST_t; - Field<FT_t,Dim,Mesh> tff(layout); - Field<AT_t,Dim,Mesh> tfa(layout); - Field<ST_t,Dim,Mesh> tfs(layout); - - // Assign values: - Tenzor<double,Dim> tf, tfTranspose; - AntiSymTenzor<double,Dim> ta, taTranspose; - SymTenzor<double,Dim> ts, tsTranspose; - double fullSymTrace = 0.0; - for (int i = 0; i < Dim; i++) { - for (int j = 0; j < Dim; j++) { - tf(i,j) = (i+1)*(i+1) + (j+1)*(j+1) + (i+4)*(j+4) + i; - if (i == j) fullSymTrace += tf(i,j); - tfTranspose(j,i) = tf(i,j); - } - } - ta = tf; - ts = tf; - tff = tf; - tfa = ta; - tfs = ts; - for (int i = 0; i < Dim; i++) { - for (int j = 0; j < Dim; j++) { - taTranspose(j,i) = ta(i,j); - tsTranspose(j,i) = ts(i,j); - } - } - - // Test determinant of Tenzor: - PInsist(Dim<4, "[Sym]Tenzor det() function not implemented for Dim>3!"); - double detValue = sum(det(tff)); - // testmsg << "detValue = " << detValue << endl; - switch (Dim) { - case 1: - if (detValue != 18*nCellsTot) { - passedAllTests = false; - testmsg << Dim << "D, sum(det(tff)) = " << detValue - << " != 18*nCellsTot = " << 18*nCellsTot << endl; - } - break; - case 2: - if (detValue != -38*nCellsTot) { - passedAllTests = false; - testmsg << Dim << "D, sum(det(tff)) = " << detValue - << " != -38*nCellsTot = " << -38*nCellsTot << endl; - } - break; - case 3: - if (detValue != -4*nCellsTot) { - passedAllTests = false; - testmsg << Dim << "D, sum(det(tff)) = " << detValue - << " != -4*nCellsTot = " << -4*nCellsTot << endl; - } - break; - default: - ERRORMSG("Attempting to call det() for tensor greater than 3D" << endl); - break; - } - - // Test determinant of AntiSymTenzor - double detValueA = sum(det(tfa)); - // testmsg << "detValueA = " << detValueA << endl; - switch (Dim) { - case 1: - if (detValueA != 0) { - passedAllTests = false; - testmsg << Dim << "D, sum(det(tfa)) = " << detValueA << " != 0." - << endl; - } - break; - case 2: - if (detValueA != -ta(1,0)*ta(0,1)*nCellsTot) { - passedAllTests = false; - testmsg << Dim << "D, sum(det(tfa)) = " << detValueA - << " != -ta(1,0)*ta(0,1)*nCellsTot = " - << -ta(1,0)*ta(0,1)*nCellsTot << endl; - } - break; - case 3: - if (detValueA != 0) { - passedAllTests = false; - testmsg << Dim << "D, sum(det(tfa)) = " << detValueA << " != 0." - << endl; - } - break; - default: - ERRORMSG("Attempting to call det() for tensor greater than 3D" << endl); - break; - } - - // Test determinant of SymTenzor - double detValueS = sum(det(tfs)); - switch (Dim) { - case 1: - if (detValueS != 18*nCellsTot) { - passedAllTests = false; - testmsg << Dim << "D, sum(det(tfs)) = " << detValueS - << " != 18*nCellsTot = " << 18*nCellsTot << endl; - } - break; - case 2: - if (detValueS != -38.25*nCellsTot) { - passedAllTests = false; - testmsg << Dim << "D, sum(det(tfs)) = " << detValueS - << " != -38.25*nCellsTot = " << -38.25*nCellsTot << endl; - } - break; - case 3: - if (detValueS != -4*nCellsTot) { - passedAllTests = false; - testmsg << Dim << "D, sum(det(tfs)) = " << detValueS - << " != -4*nCellsTot = " << -4*nCellsTot << endl; - } - break; - default: - ERRORMSG("Attempting to call det() for tensor greater than 3D" << endl); - break; - } - - // Test trace of Tenzor: - double traceValue; - traceValue = sum(trace(tff)); - if (traceValue != fullSymTrace*nCellsTot) { - passedAllTests = false; - testmsg << Dim << "D, sum(trace(tff) = " << traceValue - << " != fullSymTrace*nCellsTot = " << fullSymTrace*nCellsTot - << endl; - } - - // Test trace of AntiSymTenzor: - traceValue = sum(trace(tfa)); - if (traceValue != 0) { - passedAllTests = false; - testmsg << Dim << "D, sum(trace(tfa) = " << traceValue - << " != 0." << endl; - } - - // Test trace of SymTenzor: - traceValue = sum(trace(tfs)); - if (traceValue != fullSymTrace*nCellsTot) { - passedAllTests = false; - testmsg << Dim << "D, sum(trace(tfs) = " << traceValue - << " != fullSymTrace*nCellsTot = " << fullSymTrace*nCellsTot - << endl; - } - - // Test transpose of Tenzor: - Tenzor<double,Dim> transposeValue; - transposeValue = sum(transpose(tff)); - if (transposeValue != tfTranspose*nCellsTot) { - passedAllTests = false; - testmsg << Dim << "D, sum(transpose(tff) = " << transposeValue - << " != tfTranspose*nCellsTot = " << tfTranspose*nCellsTot - << endl; - } - - // Test transpose of AntiSymTenzor: - AntiSymTenzor<double,Dim> transposeValueA; - transposeValueA = sum(transpose(tfa)); - if (transposeValueA != taTranspose*nCellsTot) { - passedAllTests = false; - testmsg << Dim << "D, sum(transpose(tfa) = " << transposeValueA - << " != taTranspose*nCellsTot = " << taTranspose*nCellsTot - << endl; - } - - // Test transpose of SymTenzor: - SymTenzor<double,Dim> transposeValueS; - transposeValueS = sum(transpose(tfs)); - if (transposeValueS != tsTranspose*nCellsTot) { - passedAllTests = false; - testmsg << Dim << "D, sum(transpose(tfs) = " << transposeValueS - << " != tsTranspose*nCellsTot = " << tsTranspose*nCellsTot - << endl; - } - - // Test cofactors of Tenzor: - Tenzor<double,Dim> cofactorsValue; - cofactorsValue = sum(cofactors(tff))/nCellsTot; - // Check results by computing det using all possible Laplace expansions, - // and comparing to directly-computed det value: - Tenzor<double,Dim> sumValue; - sumValue = sum(tff); - double altDetValue; - // Laplace expansions using rows: - for (int i = 0; i < Dim; i++) { - altDetValue = 0.0; - for (int j = 0; j < Dim; j++) { - altDetValue += sumValue(i,j)*cofactorsValue(i,j); - } - if (altDetValue != detValue) { - passedAllTests = false; - testmsg << Dim << "D, i=" << i << ", sum(cofactors(tff) = " - << cofactorsValue << " ; Laplace expansion det = " - << altDetValue << " != det = " << detValue << endl; - } - } - // Laplace expansions using columns: - for (int j = 0; j < Dim; j++) { - altDetValue = 0.0; - for (int i = 0; i < Dim; i++) { - altDetValue += sumValue(i,j)*cofactorsValue(i,j); - } - if (altDetValue != detValue) { - passedAllTests = false; - testmsg << Dim << "D, j=" << j << ", sum(cofactors(tff) = " - << cofactorsValue << " ; Laplace expansion det = " - << altDetValue << " != det = " << detValue << endl; - } - } - - // Test cofactors of AntiSymTenzor: - cofactorsValue = sum(cofactors(tfa))/nCellsTot; - // Check results by computing det using all possible Laplace expansions, - // and comparing to directly-computed det value: - sumValue = sum(tfa); - // Laplace expansions using rows: - for (int i = 0; i < Dim; i++) { - altDetValue = 0.0; - for (int j = 0; j < Dim; j++) { - altDetValue += sumValue(i,j)*cofactorsValue(i,j); - } - if (altDetValue != detValueA) { - passedAllTests = false; - testmsg << Dim << "D, i=" << i << ", sum(cofactors(tfa) = " - << cofactorsValue << " ; Laplace expansion det = " - << altDetValue << " != det = " << detValueA << endl; - } - } - // Laplace expansions using columns: - for (int j = 0; j < Dim; j++) { - altDetValue = 0.0; - for (int i = 0; i < Dim; i++) { - altDetValue += sumValue(i,j)*cofactorsValue(i,j); - } - if (altDetValue != detValueA) { - passedAllTests = false; - testmsg << Dim << "D, j=" << j << ", sum(cofactors(tfa) = " - << cofactorsValue << " ; Laplace expansion det = " - << altDetValue << " != det = " << detValueA << endl; - } - } - - // Test cofactors of SymTenzor: - cofactorsValue = sum(cofactors(tfs))/nCellsTot; - // Check results by computing det using all possible Laplace expansions, - // and comparing to directly-computed det value: - sumValue = sum(tfs); - // Laplace expansions using rows: - for (int i = 0; i < Dim; i++) { - altDetValue = 0.0; - for (int j = 0; j < Dim; j++) { - altDetValue += sumValue(i,j)*cofactorsValue(i,j); - } - if (altDetValue != detValueS) { - passedAllTests = false; - testmsg << Dim << "D, i=" << i << ", sum(cofactors(tfs) = " - << cofactorsValue << " ; Laplace expansion det = " - << altDetValue << " != det = " << detValueS << endl; - } - } - // Laplace expansions using columns: - for (int j = 0; j < Dim; j++) { - altDetValue = 0.0; - for (int i = 0; i < Dim; i++) { - altDetValue += sumValue(i,j)*cofactorsValue(i,j); - } - if (altDetValue != detValueS) { - passedAllTests = false; - testmsg << Dim << "D, j=" << j << ", sum(cofactors(tfs) = " - << cofactorsValue << " ; Laplace expansion det = " - << altDetValue << " != det = " << detValueS << endl; - } - } - - return passedAllTests; - } -}; - - -int main(int argc, char *argv[]) -{ - Ippl ippl(argc,argv); - Inform testmsg(argv[0]); - - bool passed = true; - if (!(testTensorUnaryOps<1>::apply(testmsg))) { - passed = false; - testmsg << "problem in 1D run" << endl; - } - if (!(testTensorUnaryOps<2>::apply(testmsg))) { - passed = false; - testmsg << "problem in 2D run" << endl; - } - if (!(testTensorUnaryOps<3>::apply(testmsg))) { - passed = false; - testmsg << "problem in 3D run" << endl; - } - - testmsg << ( passed ? "PASSED" : "FAILED" ) << endl; - return 0; -} - -/*************************************************************************** - * $RCSfile: TestTensorUnaryOps.cpp,v $ $Author: adelmann $ - * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:39 $ - * IPPL_VERSION_ID: $Id: TestTensorUnaryOps.cpp,v 1.1.1.1 2003/01/23 07:40:39 adelmann Exp $ - ***************************************************************************/ diff --git a/ippl/test/simple/balance.cpp b/ippl/test/simple/balance.cpp deleted file mode 100644 index 1877f13689a3d1eeebed9cffccc371a42d7faf31..0000000000000000000000000000000000000000 --- a/ippl/test/simple/balance.cpp +++ /dev/null @@ -1,100 +0,0 @@ -// -*- C++ -*- -/*************************************************************************** - * - * The IPPL Framework - * - * This program was prepared by PSI. - * All rights in the program are reserved by PSI. - * Neither PSI nor the author(s) - * makes any warranty, express or implied, or assumes any liability or - * responsibility for the use of this software - * - * Visit http://www.acl.lanl.gov/POOMS for more details - * - ***************************************************************************/ - -// -*- C++ -*- -/*************************************************************************** - * - * The IPPL Framework - * - * - * Visit http://people.web.psi.ch/adelmann/ for more details - * - ***************************************************************************/ - -// include files -#include "Utility/IpplInfo.h" -#include "Utility/Inform.h" -#include "Index/Index.h" -#include "FieldLayout/FieldLayout.h" -#include "Field/Field.h" -#include "Field/LField.h" - -#define PRINT_DETAILS - -#ifdef PRINT_DETAILS -// define helper print function -void print_field(Inform& out, Field<int,2>& f) -{ - for (Field<int,2>::iterator_if lf_i=f.begin_if(); lf_i!=f.end_if(); ++lf_i) - { - LField<int,2> &lf = *(*lf_i).second; - for (LField<int,2>::iterator p = lf.begin(); p!=lf.end(); ++p) - out << " " << *p ; - out << endl; - } - out << endl; -} -#endif - - -int main(int argc, char *argv[]) -{ - Ippl ippl(argc, argv); - Inform out(argv[0]); -#ifdef PRINT_DETAILS - out.setPrintNode(); -#endif - - const unsigned Dim=2; - const int N=10; - Index I(N); - Index J(N); - FieldLayout<Dim> layout1(I,J,PARALLEL,SERIAL,4); - FieldLayout<Dim> layout2(I,J,SERIAL,PARALLEL,8); - Field<int,Dim> A1(layout1),A2(layout2); - - A1 = 0; - A1[I][J] += I + 10*J; - A2 = A1; -#ifdef PRINT_DETAILS - print_field(out,A1); - print_field(out,A2); -#endif - - A2[I][J] -= I + 10*J; - A2 *= A2; - int s = sum(A2); - if ( s==0 ) - out << "PASSED" << endl; - else - out << "FAILED" << endl; - -#ifdef PRINT_DETAILS - print_field(out,A2); -#endif - - return 0; -} - -/*************************************************************************** - * $RCSfile: balance.cpp,v $ $Author: adelmann $ - * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:39 $ - * IPPL_VERSION_ID: $Id: balance.cpp,v 1.1.1.1 2003/01/23 07:40:39 adelmann Exp $ - ***************************************************************************/ - - - - - diff --git a/ippl/test/simple/bc_convert.cpp b/ippl/test/simple/bc_convert.cpp deleted file mode 100644 index 1d75175fdb87535094a1e5e69c0178cbcf1a3de8..0000000000000000000000000000000000000000 --- a/ippl/test/simple/bc_convert.cpp +++ /dev/null @@ -1,110 +0,0 @@ -// -*- C++ -*- -/*************************************************************************** - * - * The IPPL Framework - * - * This program was prepared by PSI. - * All rights in the program are reserved by PSI. - * Neither PSI nor the author(s) - * makes any warranty, express or implied, or assumes any liability or - * responsibility for the use of this software - * - * Visit http://www.acl.lanl.gov/POOMS for more details - * - ***************************************************************************/ - -// -*- C++ -*- -/*************************************************************************** - * - * The IPPL Framework - * - * - * Visit http://people.web.psi.ch/adelmann/ for more details - * - ***************************************************************************/ - -// -// NOTE: This test no longer compiles because the "convert_type()" method -// for BConds objects has been disabled. -// - -// include files -#include "Utility/IpplInfo.h" -#include "Utility/Inform.h" -#include "Index/NDIndex.h" -#include "FieldLayout/FieldLayout.h" -#include "Field/Field.h" -#include "Field/GuardCellSizes.h" -#include "Field/BCond.h" -#include "Meshes/UniformCartesian.h" - - -int main(int argc, char *argv[]) -{ - Ippl(argc,argv); - Inform testmsg(argv[0]); - const unsigned Dim=2; - Index I(5); - Index J(5); - NDIndex<Dim> domain; - domain[0] = I; - domain[1] = J; - FieldLayout<Dim> layout(domain); - typedef UniformCartesian<Dim> Mesh; - - // Set initial boundary conditions. - BConds<double,Dim,Mesh> Abc; - Abc[0] = new PeriodicFace<double,Dim>(2); - Abc[1] = new PeriodicFace<double,Dim>(3); - Abc[2] = new PosReflectFace<double,Dim>(0); - Abc[3] = new ZeroFace<double,Dim>(1); - // An array for the base. - Field<double,Dim,Mesh> A(layout,GuardCellSizes<Dim>(2),Abc); - - // An array that gets its configuration from A. - BConds<int,Dim,Mesh> *Bbc = - (BConds<int,Dim,Mesh>*)A.getBConds().convert_type(int()); - Field<int,Dim,Mesh> B(A.getLayout(),A.getGuardCellSizes(),*Bbc); - - BConds<double,Dim,Mesh>::iterator pd; - BConds<int,Dim,Mesh>::iterator pi; - for (pd=Abc.begin(); pd!=Abc.end(); ++pd) - testmsg << "A:" << (*pd).second[0] << endl; - for (pi=Bbc->begin(); pi!=Bbc->end(); ++pi) - testmsg << "B:" << (*pi).second[0] << endl; - - delete Bbc; - -#ifdef IPPL_USE_MEMBER_TEMPLATES - A[I][J] = I*10 + J ; - B=A; - - A[I][J]= - A[I+1][J+1]+100.*A[I-1][J-1]+10000.*A[I-1][J+1]+1000000.*A[I+1][J-1]; - B[I][J]= - B[I+1][J+1]+100*B[I-1][J-1]+10000*B[I-1][J+1]+1000000*B[I+1][J-1]; -#else - A[I][J] << I*10 + J ; - B << A; - - A[I][J]<< - A[I+1][J+1]+100.*A[I-1][J-1]+10000.*A[I-1][J+1]+1000000.*A[I+1][J-1]; - B[I][J]<< - B[I+1][J+1]+100*B[I-1][J-1]+10000*B[I-1][J+1]+1000000*B[I+1][J-1]; -#endif - - testmsg << "A:" << A << endl; - testmsg << "B:" << B << endl; - A -= B; - A *= A; - double s = sum(A); - testmsg << (s==0 ? "PASSED" : "FAILED") << endl; - - return 0; -} - -/*************************************************************************** - * $RCSfile: bc_convert.cpp,v $ $Author: adelmann $ - * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:39 $ - * IPPL_VERSION_ID: $Id: bc_convert.cpp,v 1.1.1.1 2003/01/23 07:40:39 adelmann Exp $ - ***************************************************************************/ diff --git a/ippl/test/simple/component.cpp b/ippl/test/simple/component.cpp deleted file mode 100644 index 177bab79fdd0dd08afbed9a873f25500dbabba26..0000000000000000000000000000000000000000 --- a/ippl/test/simple/component.cpp +++ /dev/null @@ -1,123 +0,0 @@ -// -*- C++ -*- -/*************************************************************************** - * - * The IPPL Framework - * - * This program was prepared by PSI. - * All rights in the program are reserved by PSI. - * Neither PSI nor the author(s) - * makes any warranty, express or implied, or assumes any liability or - * responsibility for the use of this software - * - * Visit http://www.acl.lanl.gov/POOMS for more details - * - ***************************************************************************/ - -// -*- C++ -*- -/*************************************************************************** - * - * The IPPL Framework - * - * - * Visit http://people.web.psi.ch/adelmann/ for more details - * - ***************************************************************************/ - -// include files -#include "Utility/IpplInfo.h" -#include "Utility/Inform.h" -#include "Index/Index.h" -#include "FieldLayout/FieldLayout.h" -#include "Field/Field.h" -#include "Meshes/UniformCartesian.h" -#include "AppTypes/Vektor.h" - - -int main(int argc, char *argv[]) -{ - Ippl ippl(argc,argv); - Inform testmsg(argv[0]); - const unsigned Dim=2; - Index I(5),J(5); - FieldLayout<Dim> layout(I,J); - typedef UniformCartesian<Dim,double> Mesh; -#ifdef __MWERKS__ - // Is this a serious bug in Metrowerks CodeWarrior 4? --tjw - Field<double,Dim,Mesh,Mesh::DefaultCentering> S1(layout),S2(layout), - S3(layout); - Field<Vektor<double,Dim>,Dim,Mesh,Mesh::DefaultCentering> V1(layout); -#else - Field<double,Dim,Mesh> S1(layout),S2(layout),S3(layout); - Field<Vektor<double,Dim>,Dim,Mesh> V1(layout); -#endif // __MWERKS__ - - S1[I][J] = I+10*J ; - S2[I][J] = -I-10*J ; -#ifdef __MWERKS__ - // Note: operator=() doesn't work for either MWERKS or SGI here - assign(V1[I][J](0), S1[I][J]); - assign(V1[I][J](1), S2[I][J]*10.0) ; -#else - V1[I][J](0) << S1[I][J] ; - V1[I][J](1) << S2[I][J]*10.0 ; -#endif // __MWERKS__ - S1[I][J] = V1[I][J](0) - (I+10*J); - S2[I][J] = V1[I][J](1)/10.0 + (I+10*J); - S1 *= S1; - S2 *= S2; - double s1 = sum(S1); - double s2 = sum(S2); - testmsg << ( (s1<1e-10) ? "PASSED" : "FAILED" ) << endl; - testmsg << ( (s2<1e-10) ? "PASSED" : "FAILED" ) << endl; - -#ifdef __MWERKS__ - // Note: operator=() doesn't work for either MWERKS or SGI here - assign(V1[I][J](0), I); - assign(V1[I][J](1), 27.5); -#else - V1[I][J](0) << I ; - V1[I][J](1) << 27.5 ; -#endif // __MWERKS__ - S1[I][J] = V1[I][J](0) - I; - S2[I][J] = V1[I][J](1) - 27.5; - S1 *= S1; - S2 *= S2; - s1 = sum(S1); - s2 = sum(S2); - testmsg << ( (s1<1e-10) ? "PASSED" : "FAILED" ) << endl; - testmsg << ( (s2<1e-10) ? "PASSED" : "FAILED" ) << endl; - - S1[I][J] = I+10*J ; - S2[I][J] = -I-10*J ; - V1 = Vektor<double,2>(0,0); - V1[I][J](0) += S1[I][J] ; - V1[I][J](1) += S2[I][J]*10.0 ; - S1[I][J] = V1[I][J](0) - (I+10*J); - S2[I][J] = V1[I][J](1)/10.0 + (I+10*J); - S1 *= S1; - S2 *= S2; - s1 = sum(S1); - s2 = sum(S2); - testmsg << ( (s1<1e-10) ? "PASSED" : "FAILED" ) << endl; - testmsg << ( (s2<1e-10) ? "PASSED" : "FAILED" ) << endl; - - V1 = Vektor<double,2>(0,0); - V1[I][J](0) += I ; - V1[I][J](1) += 27.5 ; - S1[I][J] = V1[I][J](0) - I; - S2[I][J] = V1[I][J](1) + (-27.5); - S1 *= S1; - S2 *= S2; - s1 = sum(S1); - s2 = sum(S2); - testmsg << ( (s1<1e-10) ? "PASSED" : "FAILED" ) << endl; - testmsg << ( (s2<1e-10) ? "PASSED" : "FAILED" ) << endl; - - return 0; -} - -/*************************************************************************** - * $RCSfile: component.cpp,v $ $Author: adelmann $ - * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:39 $ - * IPPL_VERSION_ID: $Id: component.cpp,v 1.1.1.1 2003/01/23 07:40:39 adelmann Exp $ - ***************************************************************************/ diff --git a/ippl/test/simple/compressed.cpp b/ippl/test/simple/compressed.cpp deleted file mode 100644 index d853c52fa2adf8132ef117767c586859e3476d9e..0000000000000000000000000000000000000000 --- a/ippl/test/simple/compressed.cpp +++ /dev/null @@ -1,453 +0,0 @@ -// -*- C++ -*- -/*************************************************************************** - * - * The IPPL Framework - * - * This program was prepared by PSI. - * All rights in the program are reserved by PSI. - * Neither PSI nor the author(s) - * makes any warranty, express or implied, or assumes any liability or - * responsibility for the use of this software - * - * Visit http://www.acl.lanl.gov/POOMS for more details - * - ***************************************************************************/ - -// -*- C++ -*- -/*************************************************************************** - * - * The IPPL Framework - * - * - * Visit http://people.web.psi.ch/adelmann/ for more details - * - ***************************************************************************/ - -// include files -#include "Utility/IpplInfo.h" -#include "Utility/Inform.h" -#include "Utility/PAssert.h" -#include "Index/Index.h" -#include "FieldLayout/FieldLayout.h" -#include "Field/BareField.h" -#include "Field/GuardCellSizes.h" - - -int main(int argc, char *argv[]) -{ - Ippl ippl(argc,argv); - Inform testmsg; - // testmsg.setPrintNode(); - - const int Dim=2; - Index I(10),J(10); - FieldLayout<Dim> layout(I,J,PARALLEL,PARALLEL,4); - GuardCellSizes<Dim> gc(1); - typedef BareField<int,Dim> F; - F A(layout,gc); - - // A should be constructed compressed. - bool passed_this; - F::iterator_if lf; - int count; - - ////////////////////////////////////////////////////////////////////// - // Test if it is constructed compressed - // (or uncompressed, if --nofieldcompression) - ////////////////////////////////////////////////////////////////////// - passed_this = true; - - if (IpplInfo::noFieldCompression) { - for (lf=A.begin_if(), count=0; lf!=A.end_if(); ++lf, ++count) - { - passed_this = passed_this && !(*lf).second->IsCompressed(); - if ( (*lf).second->IsCompressed() ) - testmsg << "FAILED: An LField is compressed," << count << endl; - } - if ( passed_this ) - testmsg << "PASSED: Field is constructed uncompressed, " << count - << endl; - } - else { - for (lf=A.begin_if(), count=0; lf!=A.end_if(); ++lf, ++count) - { - passed_this = passed_this && (*lf).second->IsCompressed(); - if ( ! (*lf).second->IsCompressed() ) - testmsg << "FAILED: An LField is uncompressed," << count << endl; - } - if ( passed_this ) - testmsg << "PASSED: Field is constructed compressed, " << count << endl; - } - testmsg << " compressed fraction=" << A.CompressedFraction() << endl; - - ////////////////////////////////////////////////////////////////////// - // Test whether fillGuardCells destroys the compression. - ////////////////////////////////////////////////////////////////////// - passed_this = true; - A.fillGuardCells(); - if (IpplInfo::noFieldCompression) { - for (lf=A.begin_if(), count=0; lf!=A.end_if(); ++lf, ++count) - { - passed_this = passed_this && !(*lf).second->IsCompressed(); - if ( (*lf).second->IsCompressed() ) - testmsg << "FAILED: Compressed after fillGuardCells, " << count - << endl; - } - if ( passed_this ) - testmsg << "PASSED: Uncompressed after fillGuardCells, " << count - << endl; - } - else { - for (lf=A.begin_if(), count=0; lf!=A.end_if(); ++lf, ++count) - { - passed_this = passed_this && (*lf).second->IsCompressed(); - if ( ! (*lf).second->IsCompressed() ) - testmsg << "FAILED: Uncompressed after fillGuardCells, " << count - << endl; - } - if ( passed_this ) - testmsg << "PASSED: Compressed after fillGuardCells, " << count << endl; - } - testmsg << " compressed fraction=" << A.CompressedFraction() << endl; - - ////////////////////////////////////////////////////////////////////// - // Test whether assigning an index uncompresses. - ////////////////////////////////////////////////////////////////////// - passed_this = true; - assign(A[I][J] , I + 10*J); - for (lf=A.begin_if(), count=0; lf!=A.end_if(); ++lf, ++count) - { - passed_this = passed_this && !(*lf).second->IsCompressed(); - if ( (*lf).second->IsCompressed() ) - testmsg << "FAILED: Compressed after assigning Index, " << count - << endl; - } - if ( passed_this ) - testmsg << "PASSED: Uncompressed after assigning Index, " << count - << endl; - if (IpplInfo::noFieldCompression) { - { - int s = sum(A); - int il = I.length(); - int jl = J.length(); - int ss = jl*il*(il-1)/2 + il*jl*(jl-1)*5; - if ( s != ss ) - { - testmsg << "FAILED: incorrect sum." << endl; - testmsg << "A=" << A << endl; - testmsg << "sum(A) = " << s << endl; - testmsg << "calc = " << ss << endl; - } - else - testmsg << "PASSED: correct sum." << endl; - } - } - else { - { - int s = sum(A); - int il = I.length(); - int jl = J.length(); - int ss = jl*il*(il-1)/2 + il*jl*(jl-1)*5; - if ( s != ss ) - { - testmsg << "FAILED: incorrect sum." << endl; - testmsg << "A=" << A << endl; - testmsg << "sum(A) = " << s << endl; - testmsg << "calc = " << ss << endl; - } - else - testmsg << "PASSED: correct sum." << endl; - } - } - testmsg << " compressed fraction=" << A.CompressedFraction() << endl; - - ////////////////////////////////////////////////////////////////////// - // Test whether assigning a constant compresses. - ////////////////////////////////////////////////////////////////////// - passed_this = true; - A = 1; - if (IpplInfo::noFieldCompression) { - for (lf=A.begin_if(), count=0; lf!=A.end_if(); ++lf, ++count) { - passed_this = passed_this && !(*lf).second->IsCompressed(); - if ( (*lf).second->IsCompressed() ) - testmsg << "FAILED: Compressed after assigning constant, " << count - << endl; - } - if ( passed_this ) - testmsg << "PASSED: Uncompressed after assigning constant, " << count - << endl; - } - else { - for (lf=A.begin_if(), count=0; lf!=A.end_if(); ++lf, ++count) { - passed_this = passed_this && (*lf).second->IsCompressed(); - if ( !(*lf).second->IsCompressed() ) - testmsg << "FAILED: Uncompressed after assigning constant, " << count - << endl; - } - if ( passed_this ) - testmsg << "PASSED: Compressed after assigning constant, " << count - << endl; - } - { - int s = sum(A); - if ( s != I.length()*J.length() ) - testmsg << "FAILED: incorrect sum." << endl; - else - testmsg << "PASSED: correct sum." << endl; - } - testmsg << " compressed fraction=" << A.CompressedFraction() << endl; - - ////////////////////////////////////////////////////////////////////// - // Test whether assigning a constant with indexes compresses. - ////////////////////////////////////////////////////////////////////// - passed_this = true; - // First uncompress it. - assign(A[I][J] , I+10*J); - // Then compress it. - assign(A[I][J] , 1 ); - if (IpplInfo::noFieldCompression) { - for (lf=A.begin_if(), count=0; lf!=A.end_if(); ++lf, ++count) - { - passed_this = passed_this && !(*lf).second->IsCompressed(); - if ( (*lf).second->IsCompressed() ) - testmsg << "FAILED: Compressed after I-assigning constant, " - << count << endl; - } - if ( passed_this ) - testmsg << "PASSED: Unompressed after I-assigning constant, " << count - << endl; - } - else { - for (lf=A.begin_if(), count=0; lf!=A.end_if(); ++lf, ++count) - { - passed_this = passed_this && (*lf).second->IsCompressed(); - if ( !(*lf).second->IsCompressed() ) - testmsg << "FAILED: Uncompressed after I-assigning constant, " - << count << endl; - } - if ( passed_this ) - testmsg << "PASSED: Compressed after I-assigning constant, " << count - << endl; - } - { - int s = sum(A); - if ( s != I.length()*J.length() ) - testmsg << "FAILED: incorrect sum." << endl; - else - testmsg << "PASSED: correct sum." << endl; - } - testmsg << " compressed fraction=" << A.CompressedFraction() << endl; - - ////////////////////////////////////////////////////////////////////// - // Test whether assigning a subrange uncompresses. - ////////////////////////////////////////////////////////////////////// - passed_this = true; - Index I1( I.min()+1 , I.max()-1 ); - Index J1( J.min()+1 , J.max()-1 ); - A=0; - assign(A[I1][J1] , 1 ); - for (lf=A.begin_if(), count=0; lf!=A.end_if(); ++lf, ++count) - { - passed_this = passed_this && !(*lf).second->IsCompressed(); - if ( (*lf).second->IsCompressed() ) - testmsg << "FAILED: Compressed after assigning subrange, " << count - << endl; - } - if ( passed_this ) - testmsg << "PASSED: Uncompressed after assigning subrange, " << count - << endl; - { - int s = sum(A); - if ( s != I1.length()*J1.length() ) - testmsg << "FAILED: incorrect sum." << endl; - else - testmsg << "PASSED: correct sum." << endl; - } - testmsg << " compressed fraction=" << A.CompressedFraction() << endl; - - ////////////////////////////////////////////////////////////////////// - // Test whether assigning a single element uncompresses one. - ////////////////////////////////////////////////////////////////////// - A = 0; - if (!IpplInfo::noFieldCompression) { - for (lf=A.begin_if(); lf!=A.end_if(); ++lf) - PAssert( (*lf).second->IsCompressed() ); - } - assign(A[3][3] , 1 ); - count = 0; - int reduced_count = 0; - if (IpplInfo::noFieldCompression) { - if (A.CompressedFraction() != 0) { - testmsg << "FAILED: Compressed somewhere after assigning single" - << endl; - } - else { - testmsg << "PASSED: Still uncompressed after assigning single" << endl; - } - } - else { - for (lf=A.begin_if(); lf!=A.end_if(); ++lf) - { - if ( (*lf).second->IsCompressed() ) - ++count; - } - reduced_count = 0; - reduce(&count,&count+1,&reduced_count,OpAddAssign()); - if ( reduced_count == 3 ) - testmsg << "PASSED: Uncompressed one after assigning single" << endl; - else - testmsg << "FAILED: " << count << " compressed after assigning single." - << endl; - } - { - int s = sum(A); - if ( s != 1 ) - testmsg << "FAILED: incorrect sum." << endl; - else - testmsg << "PASSED: correct sum." << endl; - } - testmsg << " compressed fraction=" << A.CompressedFraction() << endl; - - ////////////////////////////////////////////////////////////////////// - // Test whether assigning a single element uncompresses one. - ////////////////////////////////////////////////////////////////////// - A = 0; - if (!IpplInfo::noFieldCompression) { - for (lf=A.begin_if(); lf!=A.end_if(); ++lf) - PAssert( (*lf).second->IsCompressed() ); - } - assign(A[4][3] , 1 ); - count = 0; - if (IpplInfo::noFieldCompression) { - if (A.CompressedFraction() != 0) { - testmsg << "FAILED: Compressed somewhere after assigning single" - << endl; - } - else { - testmsg << "PASSED: Still uncompressed after assigning single" << endl; - } - } - else { - for (lf=A.begin_if(); lf!=A.end_if(); ++lf) - { - if ( (*lf).second->IsCompressed() ) - ++count; - } - reduced_count = 0; - reduce(&count,&count+1,&reduced_count,OpAddAssign()); - if (Ippl::deferGuardCellFills) { - if ( reduced_count == 3 ) - testmsg << "PASSED: Uncompressed one after assigning in guard cell" - << endl; - else - testmsg << "FAILED: " << count - << " compressed after assigning in guard cell." << endl; - } - else { - if ( reduced_count == 2 ) - testmsg << "PASSED: Uncompressed two after assigning in guard cell" - << endl; - else - testmsg << "FAILED: " << count - << " compressed after assigning in guard cell." << endl; - } - } - { - int s = sum(A); - if ( s != 1 ) - testmsg << "FAILED: incorrect sum." << endl; - else - testmsg << "PASSED: correct sum." << endl; - } - testmsg << " compressed fraction=" << A.CompressedFraction() << endl; - - ////////////////////////////////////////////////////////////////////// - // Test whether an operation on that array leaves it correct. - ////////////////////////////////////////////////////////////////////// - A *= A; - count = 0; - if (IpplInfo::noFieldCompression) { - if (A.CompressedFraction() != 0) { - testmsg << "FAILED: Compressed somewhere after squaring" << endl; - } - else { - testmsg << "PASSED: Still uncompressed after squaring" << endl; - } - } - else { - for (lf=A.begin_if(); lf!=A.end_if(); ++lf) - { - if ( (*lf).second->IsCompressed() ) - ++count; - } - reduced_count = 0; - reduce(&count,&count+1,&reduced_count,OpAddAssign()); - if (Ippl::deferGuardCellFills) { - if ( reduced_count == 3 ) - testmsg << "PASSED: Uncompressed one after squaring" - << endl; - else - testmsg << "FAILED: " << count - << " compressed after squaring." << endl; - } - else { - if ( reduced_count == 2 ) - testmsg << "PASSED: Uncompressed two after squaring" - << endl; - else - testmsg << "FAILED: " << count - << " compressed after squaring." << endl; - } - } - { - int s = sum(A); - if ( s != 1 ) - testmsg << "FAILED: incorrect sum." << endl; - else - testmsg << "PASSED: correct sum." << endl; - } - testmsg << " compressed fraction=" << A.CompressedFraction() << endl; - - ////////////////////////////////////////////////////////////////////// - // Make sure we can construct a Field of Maps. - ////////////////////////////////////////////////////////////////////// - BareField< map<int,double> , Dim > B(layout); - BareField< map<int,double> , Dim >::iterator_if lb; - map<int,double> m; - m[1] = cos(1.0); - m[2] = cos(2.0); - B[2][2] = m; - count = 0; - if (IpplInfo::noFieldCompression) { - if (B.CompressedFraction() != 0) { - testmsg << "FAILED: Compressed somewhere in Field of maps" << endl; - } - else { - testmsg << "PASSED: Still uncompressed Field of maps" << endl; - } - } - else { - for (lb=B.begin_if(); lb!=B.end_if(); ++lb) - { - if ( (*lb).second->IsCompressed() ) - ++count; - } - reduced_count = 0; - reduce(&count,&count+1,&reduced_count,OpAddAssign()); - if ( reduced_count == 3 ) - testmsg << "PASSED: Uncompressed one in Field of maps" << endl; - else - testmsg << "FAILED: " << count - << " compressed after in Field of maps." << endl; - } - testmsg << " compressed fraction=" << B.CompressedFraction() << endl; - - return 0; -} - -/*************************************************************************** - * $RCSfile: compressed.cpp,v $ $Author: adelmann $ - * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:39 $ - * IPPL_VERSION_ID: $Id: compressed.cpp,v 1.1.1.1 2003/01/23 07:40:39 adelmann Exp $ - ***************************************************************************/ - diff --git a/ippl/test/simple/doof2d_a.cpp b/ippl/test/simple/doof2d_a.cpp deleted file mode 100644 index 82eda5732ea0378956fd63c9fe0a11993c3a4d67..0000000000000000000000000000000000000000 --- a/ippl/test/simple/doof2d_a.cpp +++ /dev/null @@ -1,69 +0,0 @@ -// -*- C++ -*- -/*************************************************************************** - * - * The IPPL Framework - * - * This program was prepared by PSI. - * All rights in the program are reserved by PSI. - * Neither PSI nor the author(s) - * makes any warranty, express or implied, or assumes any liability or - * responsibility for the use of this software - * - * Visit http://www.acl.lanl.gov/POOMS for more details - * - ***************************************************************************/ - -/*************************************************************************** - * - * The IPPL Framework - * - * This program was prepared by the Regents of the University of - * Visit http://people.web.psi.ch/adelmann/ for more details - * - ***************************************************************************/ - -#include <iostream> -#include "Ippl.h" - -int main(int argc, char *argv[]) -{ - Ippl ippl(argc,argv); - - cout << "input the number of vnodes" << endl; - int vnodes; - cin >> vnodes; - int sizeX; - cout << "input sizeX" << endl; - cin >> sizeX; - int sizeY; - cout << "input sizeY" << endl; - cin >> sizeY; - const unsigned Dim=2; - Index I(sizeX); - Index J(sizeY); - FieldLayout<Dim> layout(I,J,PARALLEL,PARALLEL, vnodes); - Field<double,Dim> A(layout); - FieldBlock<double,Dim> io("atest",layout); - FieldView<double,Dim> plotA(A); - - int iter; - do { - cout << "input iter" << endl; - cin >> iter; - if( iter < 0 ) break; - if( iter < io.get_NumRecords() ) { - io.read(A,0,iter); - plotA.view(); - } - } while(iter >= 0 ); - - cout << "enter to continue" << endl; - int in; - cin >> in; - return 0; -} -/*************************************************************************** - * $RCSfile: doof2d_a.cpp,v $ $Author: adelmann $ - * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:39 $ - * IPPL_VERSION_ID: $Id: doof2d_a.cpp,v 1.1.1.1 2003/01/23 07:40:39 adelmann Exp $ - ***************************************************************************/ diff --git a/ippl/test/simple/itercompress.cpp b/ippl/test/simple/itercompress.cpp deleted file mode 100644 index 102d4c2e0bd5e97ce3dc4c367061b1ee90fd50ca..0000000000000000000000000000000000000000 --- a/ippl/test/simple/itercompress.cpp +++ /dev/null @@ -1,116 +0,0 @@ -// -*- C++ -*- -/*************************************************************************** - * - * The IPPL Framework - * - * This program was prepared by PSI. - * All rights in the program are reserved by PSI. - * Neither PSI nor the author(s) - * makes any warranty, express or implied, or assumes any liability or - * responsibility for the use of this software - * - * Visit http://www.acl.lanl.gov/POOMS for more details - * - ***************************************************************************/ - -/**************************************************************************** - * - * The IPPL Framework - * - * This program was prepared by the Regents of the University of - * Visit http://people.web.psi.ch/adelmann/ for more details - * - ***************************************************************************/ - -// -// NOTE: This test will print FAILED now for some tests, since it -// tests a capability of IPPL that has been removed. THe capability -// was "automatic compression via iterators" for Barefield. This was -// removed because it caused poor performance in many situations. -// DO NOT use this test code for regression tests, etc. -// - -#include "Ippl.h" - -int main(int argc, char* argv[]) { - - Ippl ippl(argc,argv); - - Index I(10), J(10); - FieldLayout<2> FL(I,J,PARALLEL,PARALLEL,4); - Field<double,2> A(FL), B(FL); - if (Ippl::noFieldCompression) { - if (A.CompressedFraction() == 0.0) - cout << "PASSED: Constructed without compression." << endl; - else - cout << "FAILED: Constructed without compression." << endl; - if (B.CompressedFraction() == 0.0) - cout << "PASSED: Constructed without compression." << endl; - else - cout << "FAILED: Constructed without compression." << endl; - } - else { - if (A.CompressedFraction() == 1.0) - cout << "PASSED: Constructed with compression." << endl; - else - cout << "FAILED: Constructed with compression." << endl; - if (B.CompressedFraction() == 1.0) - cout << "PASSED: Constructed with compression." << endl; - else - cout << "FAILED: Constructed with compression." << endl; - } - - A.Uncompress(); - { - Field<double,2>::iterator Ait = A.begin(), Bit = B.begin(); - for (int i = 0; i < 5; ++i, ++Ait, ++Bit) { - *Ait = 3.0; - *Bit = 3.0; - } - } - A.Compress(); - - cout << "A = " << A << endl; - cout << "B = " << B << endl; - - double sumA = sum(A); - double sumB = sum(B); - - if (sumA == 15) - cout << "PASSED: Iterator assignment" << endl; - else - cout << "FAILED: Iterator assignment" << endl; - if (sumB == 15) - cout << "PASSED: Automatic uncompression." << endl; - else - cout << "FAILED: Automatic uncompression." << endl; - - if (Ippl::noFieldCompression) { - if (A.CompressedFraction() == 0.0) - cout << "PASSED: No compression." << endl; - else - cout << "FAILED: No compression." << endl; - if (B.CompressedFraction() == 0.0) - cout << "PASSED: No compression." << endl; - else - cout << "FAILED: No compression." << endl; - } - else { - if (A.CompressedFraction() == 0.75) - cout << "PASSED: Manual compression." << endl; - else - cout << "FAILED: Manual compression." << endl; - if (B.CompressedFraction() == 0.75) - cout << "PASSED: Automatic compression." << endl; - else - cout << "FAILED: Automatic compression." << endl; - } - - return 0; -} - -/*************************************************************************** - * $RCSfile: itercompress.cpp,v $ $Author: adelmann $ - * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:39 $ - * IPPL_VERSION_ID: $Id: itercompress.cpp,v 1.1.1.1 2003/01/23 07:40:39 adelmann Exp $ - ***************************************************************************/ diff --git a/ippl/test/simple/patches.cpp b/ippl/test/simple/patches.cpp deleted file mode 100644 index 16e1f9cf221036d16c666624f2eda56bec040080..0000000000000000000000000000000000000000 --- a/ippl/test/simple/patches.cpp +++ /dev/null @@ -1,289 +0,0 @@ -// -*- C++ -*- -/*************************************************************************** - * - * The IPPL Framework - * - * This program was prepared by PSI. - * All rights in the program are reserved by PSI. - * Neither PSI nor the author(s) - * makes any warranty, express or implied, or assumes any liability or - * responsibility for the use of this software - * - * Visit http://www.acl.lanl.gov/POOMS for more details - * - ***************************************************************************/ - -/*************************************************************************** - * - * The IPPL Framework - * - * This program was prepared by the Regents of the University of - * Visit http://people.web.psi.ch/adelmann/ for more details - * - ***************************************************************************/ - -// include files - -#include "Utility/IpplInfo.h" -#include "Utility/Inform.h" -#include "Index/NDIndex.h" -#include "FieldLayout/FieldLayout.h" -#include "Field/Field.h" -#include "Field/GuardCellSizes.h" -#include "Field/BCond.h" - -int main(int argc, char *argv[]) -{ - Ippl ippl(argc,argv); - Inform testmsg(argv[0]); - - const int N=5; - Index I(N), J(N); - BConds<double,2> bc; - if (Ippl::getNodes() == 1) { - bc[0] = new PeriodicFace<double,2>(0); - bc[1] = new PeriodicFace<double,2>(1); - bc[2] = new PeriodicFace<double,2>(2); - bc[3] = new PeriodicFace<double,2>(3); - } - else { - bc[0] = new ParallelPeriodicFace<double,2>(0); - bc[1] = new ParallelPeriodicFace<double,2>(1); - bc[2] = new ParallelPeriodicFace<double,2>(2); - bc[3] = new ParallelPeriodicFace<double,2>(3); - } - - FieldLayout<1> layout1(I); - FieldLayout<2> layout2(I,J); - Field<double,2> B(layout2); - Field<double,1> C(layout1); - Field<double,2> T2(layout2); - Field<double,1> T1(layout1); - - int Guards = 0; - int i,j; - - { - Field<double,2> A(layout2,GuardCellSizes<2>(Guards),bc); - - //---------------------------------------- - - assign(A[I][J] , I+J*10); - T2 = A; - for (i=0;i<N;++i) - for (j=0;j<N;++j) { - T2[i][j] -= i+j*10.0; - } - T2 *= T2; - if ( sum(T2) != 0 ) - testmsg << "Failed"; - else - testmsg << "PASSED"; - testmsg << " initializing A" << endl; - - //---------------------------------------- - - B = -1.0; - B[I][J] = A[J][I]; - T2 = B; - for (i=0;i<N;++i) - for (j=0;j<N;++j) { - T2[j][i] -= i+j*10.0; - } - T2 *= T2; - if ( sum(T2) != 0 ) - testmsg << "Failed"; - else - testmsg << "PASSED"; - testmsg << " transposing A" << endl; - - //---------------------------------------- - - B = -1.0; - B[I][J] = A[I+1][J+1]; - T2 = B; - for (i=0;i<N;++i) - for (j=0;j<N;++j) { - if ( (i<N-1)&&(j<N-1) ) - T2[i][j] -= (i+1)+(j+1)*10.0; - else - T2[i][j] += 1.0; - } - T2 *= T2; - if ( sum(T2) != 0 ) - testmsg << "Failed"; - else - testmsg << "PASSED"; - testmsg << " shifting A" << endl; - - //---------------------------------------- - - B = -1.0; - B[4][J] = A[J][4]; - T2 = B; - for (i=0;i<N;++i) { - for (j=0;j<N;++j) { - if ( i==4 ) - T2[i][j] -= j+40.0; - else - T2[i][j] += 1.0; - } - } - T2 *= T2; - if ( sum(T2) != 0 ) - testmsg << "Failed"; - else - testmsg << "PASSED"; - testmsg << " copying a slice" << endl; - - //---------------------------------------- - - C[I] = 0.1*I; - B = -1.0; - B[I][4] = C[I] ; - T2 = B; - for (i=0;i<N;++i) { - for (j=0;j<N;++j) { - if ( j==4 ) - T2[i][j] -= i*0.1; - else - T2[i][j] += 1.0; - } - } - T2 *= T2; - if ( sum(T2) != 0 ) - testmsg << "Failed"; - else - testmsg << "PASSED"; - testmsg << " inserting a slice" << endl; - - //---------------------------------------- - - C[I] = A[2][I] ; - for (i=0; i<N; ++i) - C[i] -= 2.0 + i*10.0; - C *= C; - if ( sum(C) != 0 ) - testmsg << "Failed"; - else - testmsg << "PASSED"; - testmsg << " extracting a slice" << endl; - - } - - // Now the same tests with 1 layer of guard cells and periodic bc. - // The answers for shifting are slightly different. - Guards = 1; - - { - Field<double,2> A(layout2,GuardCellSizes<2>(Guards),bc); - - //---------------------------------------- - - A[I][J] = I+J*10 ; - T2 = A; - for (i=0;i<N;++i) - for (j=0;j<N;++j) { - T2[i][j] -= i+j*10.0; - } - T2 *= T2; - if ( sum(T2) != 0 ) - testmsg << "Failed"; - else - testmsg << "PASSED"; - testmsg << " initializing guarded A" << endl; - - //---------------------------------------- - - B = -1.0; - B[I][J] = A[J][I]; - T2 = B; - for (i=0;i<N;++i) - for (j=0;j<N;++j) { - T2[j][i] -= i+j*10.0; - } - T2 *= T2; - if ( sum(T2) != 0 ) - testmsg << "Failed"; - else - testmsg << "PASSED"; - testmsg << " transposing A" << endl; - - //---------------------------------------- - - B = -1.0; - B[I][J] = A[I+1][J+1]; - T2 = B; - for (i=0;i<N;++i) - for (j=0;j<N;++j) { - int ii = (i+1)%N; - int jj = (j+1)%N; - T2[i][j] -= ii+jj*10.0; - } - T2 *= T2; - if ( sum(T2) != 0 ) - testmsg << "Failed"; - else - testmsg << "PASSED"; - testmsg << " shifting A" << endl; - - //---------------------------------------- - - B = -1.0; - B[4][J] = A[J][4]; - T2 = B; - for (i=0;i<N;++i) { - for (j=0;j<N;++j) { - if ( i==4 ) - T2[i][j] -= j+40.0; - else - T2[i][j] += 1.0; - } - } - T2 *= T2; - if ( sum(T2) != 0 ) - testmsg << "Failed"; - else - testmsg << "PASSED"; - testmsg << " copying a slice" << endl; - - //---------------------------------------- - - C[I] = 0.1*I; - B = -1.0; - B[I][4] = C[I] ; - T2 = B; - for (i=0;i<N;++i) { - for (j=0;j<N;++j) { - if ( j==4 ) - T2[i][j] -= i*0.1; - else - T2[i][j] += 1.0; - } - } - T2 *= T2; - if ( sum(T2) != 0 ) - testmsg << "Failed"; - else - testmsg << "PASSED"; - testmsg << " inserting a slice" << endl; - - //---------------------------------------- - - C[I] = A[2][I] ; - for (i=0; i<N; ++i) - C[i] -= 2.0 + i*10.0; - C *= C; - if ( sum(C) != 0 ) - testmsg << "Failed"; - else - testmsg << "PASSED"; - testmsg << " extracting a slice" << endl; - - } -} -/*************************************************************************** - * $RCSfile: patches.cpp,v $ $Author: adelmann $ - * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:39 $ - * IPPL_VERSION_ID: $Id: patches.cpp,v 1.1.1.1 2003/01/23 07:40:39 adelmann Exp $ - ***************************************************************************/ diff --git a/ippl/test/simple/reduceloc.cpp b/ippl/test/simple/reduceloc.cpp deleted file mode 100644 index dec6a01e9c4567111463a81ca6dff56eb1fb48ab..0000000000000000000000000000000000000000 --- a/ippl/test/simple/reduceloc.cpp +++ /dev/null @@ -1,68 +0,0 @@ -// -*- C++ -*- -/*************************************************************************** - * - * The IPPL Framework - * - * This program was prepared by PSI. - * All rights in the program are reserved by PSI. - * Neither PSI nor the author(s) - * makes any warranty, express or implied, or assumes any liability or - * responsibility for the use of this software - * - * Visit http://www.acl.lanl.gov/POOMS for more details - * - ***************************************************************************/ - -/*************************************************************************** - * - * The IPPL Framework - * - * This program was prepared by the Regents of the University of - * Visit http://people.web.psi.ch/adelmann/ for more details - * - ***************************************************************************/ - -#include <iostream> -#include <math.h> -#include "Ippl.h" - -int main(int argc, char *argv[]) -{ - Ippl ippl(argc, argv); - Inform testmsg(argv[0]); - - const unsigned Dim=2; - Index I(5); - Index J(5); - NDIndex<Dim> domain; - domain[0] = I; - domain[1] = J; - FieldLayout<Dim> layout(I,J); - Field<double,Dim> A(layout); - Field<double,Dim> B(layout); - Field<double,Dim> C(layout); - - A[I][J] << (I-1)*(I-1)+(J-1)*(J-1) + 1; - NDIndex<Dim> maxloc,minloc; - double maxval = max(A,maxloc); - double minval = min(A,minloc); - - double known_max = 19; - double known_min = 1; - NDIndex<Dim> known_minloc(Index(1,1),Index(1,1)); - NDIndex<Dim> known_maxloc(Index(4,4),Index(4,4)); - bool test = true; - test = test && (maxval == known_max); - test = test && (minval == known_min); - test = test && (maxloc == known_maxloc); - test = test && (minloc == known_minloc); - if ( test ) - testmsg << "PASSED" << endl; - else - testmsg << "FAILED" << endl; -} -/*************************************************************************** - * $RCSfile: reduceloc.cpp,v $ $Author: adelmann $ - * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:39 $ - * IPPL_VERSION_ID: $Id: reduceloc.cpp,v 1.1.1.1 2003/01/23 07:40:39 adelmann Exp $ - ***************************************************************************/ diff --git a/ippl/test/simple/slices.cpp b/ippl/test/simple/slices.cpp deleted file mode 100644 index b983a6840828265970bb7cc5221394c0cd9071ef..0000000000000000000000000000000000000000 --- a/ippl/test/simple/slices.cpp +++ /dev/null @@ -1,150 +0,0 @@ -// -*- C++ -*- -/*************************************************************************** - * - * The IPPL Framework - * - * This program was prepared by PSI. - * All rights in the program are reserved by PSI. - * Neither PSI nor the author(s) - * makes any warranty, express or implied, or assumes any liability or - * responsibility for the use of this software - * - * Visit http://www.acl.lanl.gov/POOMS for more details - * - ***************************************************************************/ - -/*************************************************************************** - * - * The IPPL Framework - * - * This program was prepared by the Regents of the University of - * Visit http://people.web.psi.ch/adelmann/ for more details - * - ***************************************************************************/ - -#include "Utility/IpplInfo.h" -#include "Utility/Inform.h" -#include "Index/NDIndex.h" -#include "FieldLayout/FieldLayout.h" -#include "Field/Field.h" - -// const unsigned D1 = 1; -const unsigned D2 = 2; -const unsigned D3 = 3; -const unsigned D4 = 4; -// const unsigned D5 = 5; -// const unsigned D6 = 6; -Inform testmsg; - -int main(int argc, char *argv[]) -{ - Ippl ippl(argc, argv); - testmsg.setPrintNode(-1); - - const int N=10; - - Index I(N),J(N),K(N),L(N); - NDIndex<D2> IJ(I,J); - NDIndex<D3> IJK(IJ,K); - NDIndex<D4> IJKL(IJK,L); - e_dim_tag dist[D4] = { PARALLEL,PARALLEL,SERIAL,SERIAL }; - FieldLayout<D2> layout2(IJ,dist); - FieldLayout<D3> layout3(IJK,dist); - FieldLayout<D4> layout4(IJKL,dist); - - Field<int,D2> A1(layout2),A2(layout2); - Field<int,D3> B1(layout3),B2(layout3); - Field<int,D4> C1(layout4),C2(layout4); - int ii = 1; - int jj = 10; - int kk = 100; - int ll = 1000; - int s; - - A1[I][J] = ii*I + jj*J; - A2[J][I] = A1[I][J] ; - A2[I][J] -= ii*J + jj*I ; - A2 *= A2; - s = sum(A2); - testmsg << "2D General transpose: " << (s?"FAILED":"PASSED") << endl; - - B1[I][J][K] = ii*I + jj*J + kk*K; - B2[I][J][K] = B1[I][K][J] ; - B2[I][J][K] -= ii*I + jj*K + kk*J; - B2 *= B2; - s = sum(B2); - testmsg << "3D General transpose: " << (s?"FAILED":"PASSED") << endl; - - C1[I][J][K][L] = ii*I + jj*J + kk*K + ll*L ; - C2[I][J][L][K] = C1[I][J][K][L] ; - C2[I][J][K][L] -= ii*I + jj*J + kk*L + ll*K ; - C2 *= C2; - s = sum(C2); - testmsg << "4D serial transpose: "<< (s?"FAILED":"PASSED") << endl; - - int a,b; - s = 0; - for (a=0; a<N; ++a) - { - A1[I][J] = B1[a][I][J]; - A1[I][J] -= a*ii + I*jj + J*kk; - A1 *= A1; - s += sum(A1); - } - testmsg << "General 2 from 3 " << (s ? "FAILED " : "PASSED ") << a << endl; - - s = 0; - for (a=0; a<N; ++a) - { - A1[I][J] = B1[I][a][J]; - A1[I][J] -= I*ii + a*jj + J*kk; - A1 *= A1; - s += sum(A1); - } - testmsg << "General 2 from 3 " << (s ? "FAILED " : "PASSED ") << a << endl; - - s = 0; - for (a=0; a<N; ++a) - { - A1[I][J] = B1[I][J][a]; - A1[I][J] -= I*ii + J*jj + a*kk; - A1 *= A1; - s += sum(A1); - } - testmsg << "Serial 2 from 3 " << (s ? "FAILED " : "PASSED ") << endl; - - A1[I][J] = ii*I + jj*J; - for (a=0; a<N; ++a) - B1[a][I][J] = A1[I][J] ; - B1[K][I][J] -= I*ii + J*jj; - B1 *= B1; - s = sum(B1); - testmsg << "General 3 from 2 " << (s ? "FAILED " : "PASSED ") << endl; - - for (a=0; a<N; ++a) - B1[I][a][J] = A1[I][J] ; - B1[I][K][J] -= I*ii + J*jj; - B1 *= B1; - s = sum(B1); - testmsg << "General 3 from 2 " << (s ? "FAILED " : "PASSED ") << endl; - - for (a=0; a<N; ++a) - B1[I][J][a] = A1[I][J] ; - B1[I][J][K] -= I*ii + J*jj; - B1 *= B1; - s = sum(B1); - testmsg << "Serial 3 from 2 " << (s ? "FAILED " : "PASSED ") << endl; - - for (a=0; a<N; ++a) - for (b=0; b<N; ++b) - C1[I][J][a][b] = A1[I][J] ; - C1[I][J][K][L] -= I*ii + J*jj; - C1 *= C1; - s = sum(C1); - testmsg << "Serial 4 from 2 " << (s ? "FAILED " : "PASSED ") << endl; -} -/*************************************************************************** - * $RCSfile: slices.cpp,v $ $Author: adelmann $ - * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:39 $ - * IPPL_VERSION_ID: $Id: slices.cpp,v 1.1.1.1 2003/01/23 07:40:39 adelmann Exp $ - ***************************************************************************/ diff --git a/ippl/test/simple/soffset.cpp b/ippl/test/simple/soffset.cpp deleted file mode 100644 index bccbef74539f86ac36ce0a7b181695a5d54c826c..0000000000000000000000000000000000000000 --- a/ippl/test/simple/soffset.cpp +++ /dev/null @@ -1,90 +0,0 @@ -// -*- C++ -*- -/*************************************************************************** - * - * The IPPL Framework - * - * This program was prepared by PSI. - * All rights in the program are reserved by PSI. - * Neither PSI nor the author(s) - * makes any warranty, express or implied, or assumes any liability or - * responsibility for the use of this software - * - * Visit http://www.acl.lanl.gov/POOMS for more details - * - ***************************************************************************/ - -/*************************************************************************** - * - * The IPPL Framework - * - * This program was prepared by the Regents of the University of - * Visit http://people.web.psi.ch/adelmann/ for more details - * - ***************************************************************************/ - -// test program to demonstrate use of the SOffset class -#include "Ippl.h" - - -void report(const char *str, bool result) { - Inform msg("Results"); - msg << "Test " << str << ": "; - msg << (result ? "PASSED" : "FAILED") << endl; -} - - -int main(int argc, char *argv[]) { - Ippl ippl(argc,argv); - - const unsigned Dim=2; - - // testing SOffset creation - SOffset<Dim> A(1, 2); - SOffset<Dim> B(1, 1); - report("SOffset create", - A[0] == 1 && A[1] == 2 && B[0] == 1 && B[1] == 1); - - // testing SOffset [] operator - SOffset<Dim> soLeft; - SOffset<Dim> soRight; - for (int d=0; d < Dim; d++) { - soLeft[d] = 0; - soRight[d] = (d == 1 ? 1 : 0); - } - report ("SOffset bracket create", - soLeft[0] == 0 && soLeft[1] == 0 && - soRight[0] == 0 && soRight[1] == 1); - - // testing SOffset addition, subtraction, and copy constructor - SOffset<Dim> C(A + B); - SOffset<Dim> D(A - B); - report("+", C[0] == 2 && C[1] == 3); - report("-", D[0] == 0 && D[1] == 1); - - // testing SOffset +=, -= operators - D += C; - report("+=", D[0] == 2 && D[1] == 4); - C -= D; - report("-=", C[0] == 0 && C[1] == -1); - - // testing SOffset comparisons - report("B < A", B < A); - report("B <= A", B <= A); - report("D > C", D > C); - report("D >= C", D >= C); - report("A != B", A != B); - report("B == B", B == B); - - // testing containment check - NDIndex<Dim> N1(Index(0,1), Index(0,1)); - report("A not inside 0..1,0..1 NDIndex", ! A.inside(N1)); - report("B inside 0..1,0..1 NDIndex", B.inside(N1)); - - return 0; -} - -/*************************************************************************** - * $RCSfile: soffset.cpp,v $ $Author: adelmann $ - * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:39 $ - * IPPL_VERSION_ID: $Id: soffset.cpp,v 1.1.1.1 2003/01/23 07:40:39 adelmann Exp $ - ***************************************************************************/ diff --git a/ippl/test/simple/transpose.cpp b/ippl/test/simple/transpose.cpp deleted file mode 100644 index 0ea98594ab67b20b6953391759cbf588f57a713f..0000000000000000000000000000000000000000 --- a/ippl/test/simple/transpose.cpp +++ /dev/null @@ -1,123 +0,0 @@ -// -*- C++ -*- -/*************************************************************************** - * - * The IPPL Framework - * - * This program was prepared by PSI. - * All rights in the program are reserved by PSI. - * Neither PSI nor the author(s) - * makes any warranty, express or implied, or assumes any liability or - * responsibility for the use of this software - * - * Visit http://www.acl.lanl.gov/POOMS for more details - * - ***************************************************************************/ - -/*************************************************************************** - * - * The IPPL Framework - * - * This program was prepared by the Regents of the University of - * Visit http://people.web.psi.ch/adelmann/ for more details - * - ***************************************************************************/ - -#include "Utility/IpplInfo.h" -#include "Utility/Inform.h" -#include "Index/Index.h" -#include "FieldLayout/FieldLayout.h" -#include "Field/Field.h" - -const unsigned Dim=3; -Inform testmsg; - - -void check( Field<int,Dim>& f, int s1, int s2, int s3, int test) -{ - Index I = f.getIndex(0); - Index J = f.getIndex(1); - Index K = f.getIndex(2); - f[I][J][K] -= s1*I + s2*J + s3*K; - int sum_f = sum(f); - if ( sum_f==0 ) - testmsg << "PASSED test " << test << "" << endl; - else - testmsg << "FAILED test " << test << " sum = " << sum_f << endl; -} - -int main(int argc, char *argv[]) -{ - Ippl ippl(argc, argv); - testmsg.setPrintNode(-1); - - const int N=10; - - Index I(N),J(N),K(N); - FieldLayout<Dim> layout_ppp(I,J,K,PARALLEL,PARALLEL,PARALLEL,8); - FieldLayout<Dim> layout_spp(I,J,K,SERIAL,PARALLEL,PARALLEL,8); - FieldLayout<Dim> layout_psp(I,J,K,PARALLEL,SERIAL,PARALLEL,8); - FieldLayout<Dim> layout_pps(I,J,K,PARALLEL,PARALLEL,SERIAL,8); - - Field<int,Dim> A(layout_ppp); - Field<int,Dim> B(layout_spp); - Field<int,Dim> C(layout_psp); - Field<int,Dim> D(layout_pps); - int ii = 1; - int jj = 10; - int kk = 100; - - assign( A[I][J][K] , ii*I + jj*J + kk*K ); - B = A; - C = A; - D = A; - check(B,ii,jj,kk,1); - check(C,ii,jj,kk,2); - check(D,ii,jj,kk,3); - - B[I][J][K] = A[I][J][K]; - C[I][J][K] = A[I][J][K]; - D[I][J][K] = A[I][J][K]; - check(B,ii,jj,kk,4); - check(C,ii,jj,kk,5); - check(D,ii,jj,kk,6); - - B[I][K][J] = A[I][J][K]; - C[I][K][J] = A[I][J][K]; - D[I][K][J] = A[I][J][K]; - check(B,ii,kk,jj,7); - check(C,ii,kk,jj,8); - check(D,ii,kk,jj,9); - - B[J][I][K] = A[I][J][K]; - C[J][I][K] = A[I][J][K]; - D[J][I][K] = A[I][J][K]; - check(B,jj,ii,kk,10); - check(C,jj,ii,kk,11); - check(D,jj,ii,kk,12); - - B[J][K][I] = A[I][J][K]; - C[J][K][I] = A[I][J][K]; - D[J][K][I] = A[I][J][K]; - check(B,jj,kk,ii,13); - check(C,jj,kk,ii,14); - check(D,jj,kk,ii,15); - - B[K][I][J] = A[I][J][K]; - C[K][I][J] = A[I][J][K]; - D[K][I][J] = A[I][J][K]; - check(B,kk,ii,jj,16); - check(C,kk,ii,jj,17); - check(D,kk,ii,jj,18); - - B[K][J][I] = A[I][J][K]; - C[K][J][I] = A[I][J][K]; - D[K][J][I] = A[I][J][K]; - check(B,kk,jj,ii,19); - check(C,kk,jj,ii,20); - check(D,kk,jj,ii,21); -} -/*************************************************************************** - * $RCSfile: transpose.cpp,v $ $Author: adelmann $ - * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:39 $ - * IPPL_VERSION_ID: $Id: transpose.cpp,v 1.1.1.1 2003/01/23 07:40:39 adelmann Exp $ - ***************************************************************************/ diff --git a/ippl/test/simple/tz.cpp b/ippl/test/simple/tz.cpp deleted file mode 100644 index 94282ff5865bd73a76072971d443ccd41d0efb01..0000000000000000000000000000000000000000 --- a/ippl/test/simple/tz.cpp +++ /dev/null @@ -1,190 +0,0 @@ -// -*- C++ -*- -/*************************************************************************** - * - * The IPPL Framework - * - * This program was prepared by PSI. - * All rights in the program are reserved by PSI. - * Neither PSI nor the author(s) - * makes any warranty, express or implied, or assumes any liability or - * responsibility for the use of this software - * - * Visit http://www.acl.lanl.gov/POOMS for more details - * - ***************************************************************************/ - -/*************************************************************************** - * - * The IPPL Framework - * - * This program was prepared by the Regents of the University of - * Visit http://people.web.psi.ch/adelmann/ for more details - * - ***************************************************************************/ - -#include "Utility/IpplInfo.h" -#include "Utility/Inform.h" -#include "Index/Index.h" -#include "FieldLayout/FieldLayout.h" -#include "Field/Field.h" -#include "Meshes/UniformCartesian.h" -#include "AppTypes/Vektor.h" - -const unsigned Dim = 2; -int size = 8; -typedef Vektor<double,Dim> Vek; - -Vek vabs(Vek v1) -{ - Vek v2(v1); - for (unsigned d=0; d<Dim; ++d) - if ( v2[d]<0 ) - v2[d] = -v2[d]; - return v2; -} - -Vek vmax(Vek v1, Vek v2) -{ - Vek v0; - for (unsigned d=0; d<Dim; ++d) - v0[d] = max(v1[d],v2[d]); - return v0; -} - -double cutoff; -Vek vselect1(Vek v1, Vek v2) -{ - Vek v0 = vabs(v1 - v2); - for (unsigned d=0; d<Dim; ++d) - if ( v0[d] > cutoff ) - v0[d] = v2[d]; - else - v0[d] = v1[d]; - return v0; -} - -Vek vselect2(Vek diff, Vek cutoff) -{ - Vek v0; - for (unsigned d=0; d<Dim; ++d) - if ( cutoff[d] >= fabs(diff[d]) ) - v0[d] = diff[d]; - else - v0[d] = 0.0; - return v0; -} - -double el0(Vek v1) -{ - return v1[0]; -} - -UNARY_FUNCTION(double,el0,Vek) -UNARY_FUNCTION(Vek,vabs,Vek) -BINARY_FUNCTION(Vek,vmax,Vek, Vek) -BINARY_FUNCTION(Vek,vselect1,Vek,Vek) -BINARY_FUNCTION(Vek,vselect2,Vek,Vek) - -int main(int argc, char *argv[]) -{ - // initialize Ippl, and create Inform object for output messages - Ippl ippl(argc,argv); - Inform testmsg(argv[0]); - - Index I(size), J(size); - int i,j; - FieldLayout<Dim> layout(I,J); -#ifdef __MWERKS__ - typedef Field< Vek ,Dim,UniformCartesian<Dim>, - UniformCartesian<Dim>::DefaultCentering> FV; - typedef Field< double ,Dim,UniformCartesian<Dim>, - UniformCartesian<Dim>::DefaultCentering> Fd; -#else - typedef Field< Vek ,Dim,UniformCartesian<Dim> > FV; - typedef Field< double ,Dim,UniformCartesian<Dim> > Fd; -#endif // __MWERKS__ - FV V1(layout),V2(layout),V3(layout); - Fd d1(layout),d2(layout),d3(layout); - double err; - - for (i=0; i<size; ++i) - for (j=0; j<size; ++j) { - V1[i][j] = Vek( double(i), double(j) ) ; - V2[i][j] = Vek( double(j), double(i) ) ; - } - - V3 = 0.0; - assign( V3, vabs(V2-V1)+V3+vabs(V3) ); - - err = 0; - for (i=0; i<size; ++i) - for (j=0; j<size; ++j) - { - Vek v = V3[i][j].get(); - v -= Vek( abs(j-i), abs(i-j) ); - err += fabs(v[0]); - err += fabs(v[1]); - } - if ( err==0 ) - testmsg << "PASSED UNARY" << endl; - else - testmsg << "FAILED UNARY" << endl; - - assign( V3, vmax(V2,V1) ); - err = 0; - for (i=0; i<size; ++i) - for (j=0; j<size; ++j) - { - Vek v = V3[i][j].get(); - double m = (i>j) ? i : j; - v -= Vek( m,m ); - err += fabs(v[0]); - err += fabs(v[1]); - } - if ( err==0 ) - testmsg << "PASSED BINARY" << endl; - else - testmsg << "FAILED BINARY" << endl; - - cutoff = 1.0; - assign( V3, vselect1(V1,V2) ); - err = 0; - for (i=0; i<size; ++i) - for (j=0; j<size; ++j) - { - Vek v = V3[i][j].get(); - v -= vselect1( Vek(i,j), Vek(j,i) ); - err += fabs(v[0]); - err += fabs(v[1]); - } - if ( err==0 ) - testmsg << "PASSED SELECT1" << endl; - else - testmsg << "FAILED SELECT1" << endl; - - V3 = 1.0; - V2 += vselect2(V1-V2,V3) ; - err = 0; - for (i=0; i<size; ++i) - for (j=0; j<size; ++j) - { - Vek v = V2[i][j].get(); - v -= vselect1( Vek(i,j), Vek(j,i) ); - err += fabs(v[0]); - err += fabs(v[1]); - } - if ( err==0 ) - testmsg << "PASSED SELECT2" << endl; - else - testmsg << "FAILED SELECT2" << endl; - - assign( d1, fabs(el0(V2)-el0(V1)) ); - - return 0; -} -//---------------------------------------------------------------------- -/*************************************************************************** - * $RCSfile: tz.cpp,v $ $Author: adelmann $ - * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:39 $ - * IPPL_VERSION_ID: $Id: tz.cpp,v 1.1.1.1 2003/01/23 07:40:39 adelmann Exp $ - ***************************************************************************/ diff --git a/tests/ippl_src/AppTypes/CMakeLists.txt b/tests/ippl_src/AppTypes/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..f74059e3d157f330053d91818698d67aef3a8b3a --- /dev/null +++ b/tests/ippl_src/AppTypes/CMakeLists.txt @@ -0,0 +1,19 @@ +set (_SRCS + Tensor.cpp + Vektor.cpp + VektorTz.cpp +) + +include_directories ( + ${CMAKE_CURRENT_SOURCE_DIR} +) + +add_sources(${_SRCS}) + +# vi: set et ts=4 sw=4 sts=4: + +# Local Variables: +# mode: cmake +# cmake-tab-width: 4 +# indent-tabs-mode: nil +# End: \ No newline at end of file diff --git a/tests/ippl_src/AppTypes/Tensor.cpp b/tests/ippl_src/AppTypes/Tensor.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7981acce37179235d510e23082b10186084e5bae --- /dev/null +++ b/tests/ippl_src/AppTypes/Tensor.cpp @@ -0,0 +1,217 @@ +#include "gtest/gtest.h" + +#include "Index/NDIndex.h" +#include "FieldLayout/FieldLayout.h" +#include "Field/Field.h" +#include "Meshes/UniformCartesian.h" +#include "AppTypes/Vektor.h" +#include "AppTypes/Tenzor.h" +#include "AppTypes/SymTenzor.h" +#include "AppTypes/AntiSymTenzor.h" + +constexpr double margin = 1e-7; + +template <int Dim> +class testTensorUnaryOps +{ +public: + static void apply() + { + NDIndex<Dim> domain; + int nCellsTot = 1; + for (int d = 0; d < Dim; d++) { + domain[d] = Index(5); + nCellsTot *= 5; + } + FieldLayout<Dim> layout(domain); + typedef UniformCartesian<Dim> Mesh; + typedef Tenzor<double,Dim> FT_t; + typedef AntiSymTenzor<double,Dim> AT_t; + typedef SymTenzor<double,Dim> ST_t; + Field<FT_t,Dim,Mesh> tff(layout); + Field<AT_t,Dim,Mesh> tfa(layout); + Field<ST_t,Dim,Mesh> tfs(layout); + + // Assign values: + Tenzor<double,Dim> tf, tfTranspose; + AntiSymTenzor<double,Dim> ta, taTranspose; + SymTenzor<double,Dim> ts, tsTranspose; + double fullSymTrace = 0.0; + for (int i = 0; i < Dim; i++) { + for (int j = 0; j < Dim; j++) { + tf(i,j) = (i+1)*(i+1) + (j+1)*(j+1) + (i+4)*(j+4) + i; + if (i == j) fullSymTrace += tf(i,j); + tfTranspose(j,i) = tf(i,j); + } + } + ta = tf; + ts = tf; + tff = tf; + tfa = ta; + tfs = ts; + for (int i = 0; i < Dim; i++) { + for (int j = 0; j < Dim; j++) { + taTranspose(j,i) = ta(i,j); + tsTranspose(j,i) = ts(i,j); + } + } + + // Test determinant of Tenzor: + PInsist(Dim<4, "[Sym]Tenzor det() function not implemented for Dim>3!"); + double detValue = sum(det(tff)); + // testmsg << "detValue = " << detValue << endl; + switch (Dim) { + case 1: + EXPECT_NEAR(detValue, 18*nCellsTot, margin); + break; + case 2: + EXPECT_NEAR(detValue, -38*nCellsTot, margin); + break; + case 3: + EXPECT_NEAR(detValue, -4*nCellsTot, margin); + break; + default: + ERRORMSG("Attempting to call det() for tensor greater than 3D" << endl); + break; + } + + // Test determinant of AntiSymTenzor + double detValueA = sum(det(tfa)); + // testmsg << "detValueA = " << detValueA << endl; + switch (Dim) { + case 1: + EXPECT_NEAR(detValueA, 0, margin); + break; + case 2: + EXPECT_NEAR(detValueA, -ta(1,0)*ta(0,1)*nCellsTot, margin); + break; + case 3: + EXPECT_NEAR(detValueA, 0, margin); + break; + default: + ERRORMSG("Attempting to call det() for tensor greater than 3D" << endl); + break; + } + + // Test determinant of SymTenzor + double detValueS = sum(det(tfs)); + switch (Dim) { + case 1: + EXPECT_NEAR(detValueS, 18*nCellsTot, margin); + break; + case 2: + EXPECT_NEAR(detValueS, -38.25*nCellsTot, margin); + break; + case 3: + EXPECT_NEAR(detValueS, -4*nCellsTot, margin); + break; + default: + ERRORMSG("Attempting to call det() for tensor greater than 3D" << endl); + break; + } + + // Test trace of Tenzor: + double traceValue; + traceValue = sum(trace(tff)); + EXPECT_NEAR(traceValue, fullSymTrace*nCellsTot, margin); + + // Test trace of AntiSymTenzor: + traceValue = sum(trace(tfa)); + EXPECT_NEAR(traceValue, 0, margin); + + // Test trace of SymTenzor: + traceValue = sum(trace(tfs)); + EXPECT_NEAR(traceValue, fullSymTrace*nCellsTot, margin); + + // Test transpose of Tenzor: + Tenzor<double,Dim> transposeValue; + transposeValue = sum(transpose(tff)); + EXPECT_TRUE((transposeValue == tfTranspose*nCellsTot)); + + // Test transpose of AntiSymTenzor: + AntiSymTenzor<double,Dim> transposeValueA; + transposeValueA = sum(transpose(tfa)); + EXPECT_TRUE((transposeValueA == taTranspose*nCellsTot)); + + // Test transpose of SymTenzor: + SymTenzor<double,Dim> transposeValueS; + transposeValueS = sum(transpose(tfs)); + EXPECT_TRUE((transposeValueS == tsTranspose*nCellsTot)); + + // Test cofactors of Tenzor: + Tenzor<double,Dim> cofactorsValue; + cofactorsValue = sum(cofactors(tff))/nCellsTot; + // Check results by computing det using all possible Laplace expansions, + // and comparing to directly-computed det value: + Tenzor<double,Dim> sumValue; + sumValue = sum(tff); + double altDetValue; + // Laplace expansions using rows: + for (int i = 0; i < Dim; i++) { + altDetValue = 0.0; + for (int j = 0; j < Dim; j++) { + altDetValue += sumValue(i,j)*cofactorsValue(i,j); + } + EXPECT_NEAR(altDetValue, detValue, margin); + } + // Laplace expansions using columns: + for (int j = 0; j < Dim; j++) { + altDetValue = 0.0; + for (int i = 0; i < Dim; i++) { + altDetValue += sumValue(i,j)*cofactorsValue(i,j); + } + EXPECT_NEAR(altDetValue, detValue, margin); + } + + // Test cofactors of AntiSymTenzor: + cofactorsValue = sum(cofactors(tfa))/nCellsTot; + // Check results by computing det using all possible Laplace expansions, + // and comparing to directly-computed det value: + sumValue = sum(tfa); + // Laplace expansions using rows: + for (int i = 0; i < Dim; i++) { + altDetValue = 0.0; + for (int j = 0; j < Dim; j++) { + altDetValue += sumValue(i,j)*cofactorsValue(i,j); + } + EXPECT_NEAR(altDetValue, detValueA, margin); + } + // Laplace expansions using columns: + for (int j = 0; j < Dim; j++) { + altDetValue = 0.0; + for (int i = 0; i < Dim; i++) { + altDetValue += sumValue(i,j)*cofactorsValue(i,j); + } + EXPECT_NEAR(altDetValue, detValueA, margin); + } + + // Test cofactors of SymTenzor: + cofactorsValue = sum(cofactors(tfs))/nCellsTot; + // Check results by computing det using all possible Laplace expansions, + // and comparing to directly-computed det value: + sumValue = sum(tfs); + // Laplace expansions using rows: + for (int i = 0; i < Dim; i++) { + altDetValue = 0.0; + for (int j = 0; j < Dim; j++) { + altDetValue += sumValue(i,j)*cofactorsValue(i,j); + } + EXPECT_NEAR(altDetValue, detValueS, margin); + } + // Laplace expansions using columns: + for (int j = 0; j < Dim; j++) { + altDetValue = 0.0; + for (int i = 0; i < Dim; i++) { + altDetValue += sumValue(i,j)*cofactorsValue(i,j); + } + EXPECT_NEAR(altDetValue, detValueS, margin); + } + } +}; + +TEST(Tensor, Tensor) +{ + testTensorUnaryOps<1>::apply(); + testTensorUnaryOps<2>::apply(); + testTensorUnaryOps<3>::apply(); +} \ No newline at end of file diff --git a/tests/ippl_src/AppTypes/Vektor.cpp b/tests/ippl_src/AppTypes/Vektor.cpp new file mode 100644 index 0000000000000000000000000000000000000000..cbaa0651d73cee0ed441149d053905bfe4b97ba3 --- /dev/null +++ b/tests/ippl_src/AppTypes/Vektor.cpp @@ -0,0 +1,25 @@ +#include "gtest/gtest.h" + +#include "opal_test_utilities/SilenceTest.h" + +#include "AppTypes/Vektor.h" + +constexpr unsigned int Dim = 3; +constexpr double margin = 1e-7; + +TEST(Vektor, dot) +{ + OpalTestUtilities::SilenceTest silencer; + + //Vektor<double,Dim> boxMin(-1.0,-1.0,-1.0); + Vektor<double,Dim> boxMax( 1.0, 1.0, 1.0); + + Vektor<double,Dim> p1( .5, .5, .5); + Vektor<double,Dim> p2( 1.5, 1.5, 1.5); + + EXPECT_TRUE ( dot(p1,p1) <= dot(boxMax,boxMax)); + EXPECT_FALSE( dot(p2,p2) <= dot(boxMax,boxMax)); + + EXPECT_NEAR ( dot(p1, boxMax), 1.5, margin); + EXPECT_NEAR ( dot(p2, p2), 6.75, margin); +} \ No newline at end of file diff --git a/tests/ippl_src/AppTypes/VektorTz.cpp b/tests/ippl_src/AppTypes/VektorTz.cpp new file mode 100644 index 0000000000000000000000000000000000000000..78377196bd1952c6f6bf2089418aa04800ddef97 --- /dev/null +++ b/tests/ippl_src/AppTypes/VektorTz.cpp @@ -0,0 +1,131 @@ +#include "gtest/gtest.h" + +#include "Index/Index.h" +#include "FieldLayout/FieldLayout.h" +#include "Field/Field.h" +#include "Meshes/UniformCartesian.h" +#include "AppTypes/Vektor.h" + +#include <cmath> + +const unsigned Dim = 2; +int size = 8; +constexpr double margin = 1e-7; +typedef Vektor<double,Dim> Vek; + + Vek vabs(Vek v1) + { + Vek v2(v1); + for (unsigned d=0; d<Dim; ++d) + if ( v2[d]<0 ) + v2[d] = -v2[d]; + return v2; + } + + Vek vmax(Vek v1, Vek v2) + { + Vek v0; + for (unsigned d=0; d<Dim; ++d) + v0[d] = std::max(v1[d],v2[d]); + return v0; + } + + double cutoff; + Vek vselect1(Vek v1, Vek v2) + { + Vek v0 = vabs(v1 - v2); + for (unsigned d=0; d<Dim; ++d) + if ( v0[d] > cutoff ) + v0[d] = v2[d]; + else + v0[d] = v1[d]; + return v0; + } + + Vek vselect2(Vek diff, Vek cutoff) + { + Vek v0; + for (unsigned d=0; d<Dim; ++d) + if ( cutoff[d] >= fabs(diff[d]) ) + v0[d] = diff[d]; + else + v0[d] = 0.0; + return v0; + } + + UNARY_FUNCTION(Vek,vabs,Vek) + BINARY_FUNCTION(Vek,vmax,Vek, Vek) + BINARY_FUNCTION(Vek,vselect1,Vek,Vek) + BINARY_FUNCTION(Vek,vselect2,Vek,Vek) + + +TEST(Vektor, tz) +{ + Index I(size), J(size); + int i,j; + FieldLayout<Dim> layout(I,J); + typedef Field< Vek ,Dim,UniformCartesian<Dim> > FV; + typedef Field< double ,Dim,UniformCartesian<Dim> > Fd; + FV V1(layout),V2(layout),V3(layout); + Fd d1(layout),d2(layout),d3(layout); + double err; + + for (i=0; i<size; ++i) + for (j=0; j<size; ++j) { + V1[i][j] = Vek( double(i), double(j) ) ; + V2[i][j] = Vek( double(j), double(i) ) ; + } + + V3 = 0.0; + assign( V3, vabs(V2-V1)+V3+vabs(V3) ); + + err = 0; + for (i=0; i<size; ++i) + for (j=0; j<size; ++j) + { + Vek v = V3[i][j].get(); + v -= Vek( abs(j-i), abs(i-j) ); + err += fabs(v[0]); + err += fabs(v[1]); + } + EXPECT_NEAR(err,0,margin); + + assign( V3, vmax(V2,V1) ); + err = 0; + for (i=0; i<size; ++i) + for (j=0; j<size; ++j) + { + Vek v = V3[i][j].get(); + double m = (i>j) ? i : j; + v -= Vek( m,m ); + err += fabs(v[0]); + err += fabs(v[1]); + } + EXPECT_NEAR(err,0,margin); + + cutoff = 1.0; + assign( V3, vselect1(V1,V2) ); + err = 0; + for (i=0; i<size; ++i) + for (j=0; j<size; ++j) + { + Vek v = V3[i][j].get(); + v -= vselect1( Vek(i,j), Vek(j,i) ); + err += fabs(v[0]); + err += fabs(v[1]); + } + EXPECT_NEAR(err,0,margin); + + V3 = 1.0; + V2 += vselect2(V1-V2,V3) ; + err = 0; + for (i=0; i<size; ++i) + for (j=0; j<size; ++j) + { + Vek v = V2[i][j].get(); + v -= vselect1( Vek(i,j), Vek(j,i) ); + err += fabs(v[0]); + err += fabs(v[1]); + } + EXPECT_NEAR(err,0,margin); +} \ No newline at end of file diff --git a/tests/ippl_src/CMakeLists.txt b/tests/ippl_src/CMakeLists.txt index bf22d59e31d7bacf228af0b64fcdf9b69f681b04..e69f96082e42acc3c12e684af263960fc1d49abd 100644 --- a/tests/ippl_src/CMakeLists.txt +++ b/tests/ippl_src/CMakeLists.txt @@ -1,11 +1,15 @@ +add_subdirectory (AppTypes) +add_subdirectory (Field) +add_subdirectory (Index) +add_subdirectory (Meshes) add_subdirectory (Particle) set (TEST_SRCS_LOCAL ${TEST_SRCS_LOCAL} PARENT_SCOPE) # vi: set et ts=4 sw=4 sts=4: - + # Local Variables: # mode: cmake # cmake-tab-width: 4 # indent-tabs-mode: nil -# End: +# End: \ No newline at end of file diff --git a/tests/ippl_src/Field/BCond.cpp b/tests/ippl_src/Field/BCond.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0c3f725e47e3f1f75adba9a834530e95162d5a19 --- /dev/null +++ b/tests/ippl_src/Field/BCond.cpp @@ -0,0 +1,1608 @@ +#include "gtest/gtest.h" + +#include "opal_test_utilities/SilenceTest.h" + +#include "AppTypes/Vektor.h" +#include "Field/Field.h" +#include "FieldLayout/CenteredFieldLayout.h" +#include "FieldLayout/FieldLayout.h" +#include "Meshes/UniformCartesian.h" +#include "Meshes/CartesianCentering.h" +#include "Utility/FieldDebug.h" + +#include <fstream> +#include <iostream> + +namespace { + void hardCodedOutput(char* filename); // Prototype of function defined below. + bool thediff(char* filename1, char* filename2); +} + +constexpr unsigned Dim = 2; +constexpr double roundOffError = 1e-10; + +// template definition +CenteringEnum CCCEnums<2U,2U,0U>::vectorFace[2U*2U]; + +TEST(Field, BC) +{ + // For writing file output to compare against hardcoded correct file output: + Inform fdi(NULL,"text.test.TestBC",Inform::OVERWRITE,0); + setInform(fdi); + + Index I(5); + Index J(5); + NDIndex<Dim> domain; + domain[0] = I; + domain[1] = J; + FieldLayout<Dim> layout(domain); + typedef UniformCartesian<Dim> M; + + // Set Cell-centered boundary conditions. + BConds<double,Dim,M,Cell> cbc; + cbc[0] = new NegReflectFace<double,Dim,M,Cell>(0); + cbc[1] = new ZeroFace<double,Dim,M,Cell>(1); + cbc[2] = new ParallelPeriodicFace<double,Dim,M,Cell>(2); + cbc[3] = new ParallelPeriodicFace<double,Dim,M,Cell>(3); + fdi << "++++++++BConds object cbc begin++++++++" << endl; + fdi << cbc; + fdi << "++++++++BConds object cbc end++++++++++" << endl; + + // Cell-centered test Field's: + Field<double,Dim,M,Cell> cA(layout,GuardCellSizes<Dim>(2),cbc); + Field<double,Dim,M,Cell> cB(layout); + + // Set Vert-centered boundary conditions. + BConds<double,Dim,M,Vert> vbc; + vbc[0] = new NegReflectFace<double,Dim,M,Vert>(0); + vbc[1] = new ZeroFace<double,Dim,M,Vert>(1); + vbc[2] = new ParallelPeriodicFace<double,Dim,M,Vert>(2); + vbc[3] = new ParallelPeriodicFace<double,Dim,M,Vert>(3); + // Vert-centered test Field's: + Field<double,Dim,M,Vert> vA(layout,GuardCellSizes<Dim>(2),vbc); + Field<double,Dim,M,Vert> vB(layout); + + // Assign reference values: + int i,j; + unsigned counter=0; + double value; + for (j=0; j<5; j++) { + for (i=0; i<5; i++) { + value = counter++; + assign(cA[i][j], value); + assign(vA[i][j], value); + } + } + + // Print reference values, then assign values ofsetting across boundaries + // and print results, Cell-centered case: + setFormat(5,3); + fdi << "++++++++++cA+++++++++++" << endl ; + fp2(cA); + cB[I][J] = cA[I-2][J-2]; + fdi << "++++++++++cB+++++++++++" << endl ; + fp2(cB); + + // Print reference values, then assign values ofsetting across boundaries + // and print results, Vert-centered case: + fdi << "++++++++++vA+++++++++++" << endl ; + fp2(vA); + vB[I][J] = vA[I-2][J-2]; + fdi << "++++++++++vB+++++++++++" << endl ; + fp2(vB); + + // Componentwise specification of BC's for a Field<Vektor> + // Set Cell-centered boundary conditions. + BConds<Vektor<double,Dim>,Dim,M,Cell> vcbc; + vcbc[0] = new NegReflectFace<Vektor<double,Dim>,Dim,M,Cell>(0,0); + vcbc[1] = new PosReflectFace<Vektor<double,Dim>,Dim,M,Cell>(0,1); + vcbc[2] = new NegReflectFace<Vektor<double,Dim>,Dim,M,Cell>(1,0); + vcbc[3] = new PosReflectFace<Vektor<double,Dim>,Dim,M,Cell>(1,1); + vcbc[4] = new ZeroFace<Vektor<double,Dim>,Dim,M,Cell>(2); + vcbc[5] = new ZeroFace<Vektor<double,Dim>,Dim,M,Cell>(3); + // Cell-centered test Field's: + Field<Vektor<double,Dim>,Dim,M,Cell> vcA(layout,GuardCellSizes<Dim>(2),vcbc); + Field<Vektor<double,Dim>,Dim,M,Cell> vcB(layout); + // Assign reference values: + counter=0; + value=0.0; + for (j=0; j<5; j++) { + for (i=0; i<5; i++) { + value = counter++; + assign(vcA[i][j], (Vektor<double,Dim>)value); + } + } + // Print reference values, then assign values ofsetting across boundaries + // and print results, Cell-centered case: + setFormat(2,2); + fdi << "++++++++++vcA+++++++++++" << endl ; + fp2(vcA); + vcB[I][J] = vcA[I-2][J]; + fdi << "++++++++++vcB+++++++++++" << endl ; + fp2(vcB); + + // Componentwise specification of BC's for a Field<Vektor> + // Set CartesianCentering-centered boundary conditions. + typedef CommonCartesianCenterings<Dim,2U>::vectorFace vFace; + + // For clarity, construct a mesh. Here, 5 is taken as the number of verts: + M mesh(I,J); + CenteredFieldLayout<Dim,M,vFace> layoutVFace(mesh); + + BConds<Vektor<double,Dim>,Dim,M,vFace> vfbc; + vfbc[0] = new NegReflectFace<Vektor<double,Dim>,Dim,M,vFace>(0,0); + vfbc[1] = new PosReflectFace<Vektor<double,Dim>,Dim,M,vFace>(0,1); + vfbc[2] = new NegReflectFace<Vektor<double,Dim>,Dim,M,vFace>(1,0); + vfbc[3] = new PosReflectFace<Vektor<double,Dim>,Dim,M,vFace>(1,1); + if (Ippl::getNodes() == 1) { + vfbc[4] = new PeriodicFace<Vektor<double,Dim>,Dim,M,vFace>(2,0); + vfbc[5] = new PeriodicFace<Vektor<double,Dim>,Dim,M,vFace>(2,1); + vfbc[6] = new PeriodicFace<Vektor<double,Dim>,Dim,M,vFace>(3,0); + vfbc[7] = new PeriodicFace<Vektor<double,Dim>,Dim,M,vFace>(3,1); + } + else { + vfbc[4] = new ParallelPeriodicFace<Vektor<double,Dim>,Dim,M,vFace>(2,0); + vfbc[5] = new ParallelPeriodicFace<Vektor<double,Dim>,Dim,M,vFace>(2,1); + vfbc[6] = new ParallelPeriodicFace<Vektor<double,Dim>,Dim,M,vFace>(3,0); + vfbc[7] = new ParallelPeriodicFace<Vektor<double,Dim>,Dim,M,vFace>(3,1); + } + // vFace-centered test Field's: + Field<Vektor<double,Dim>,Dim,M,vFace> + vfA(layoutVFace,GuardCellSizes<Dim>(2),vfbc); + Field<Vektor<double,Dim>,Dim,M,vFace> vfB(layoutVFace); + // Assign red-flag values for to make inaccessible vector components visible: + vfA = 9.99; + vfB = 9.99; + // Assign reference values: + counter=0; + value=0.0; + Index Iverts(5); + Index Jverts(5); + Index Icells(4); + Index Jcells(4); + assign(vfA[Iverts][Jcells](0), Iverts + Jcells*5.0); + assign(vfA[Icells][Jverts](1), Icells + Jverts*5.0); + // Print reference values, then assign values ofsetting across boundaries + // and print results, vFace-centered case: + setFormat(2,2); + + // Set up for 3D Field's: + const unsigned Dim3 = 3; + Index K(5); + FieldLayout<Dim3> layout3(I,J,K); + typedef UniformCartesian<Dim3> M3; + // Componentwise specification of BC's for a Cell-centered Field<SymTenzor> + // Set boundary conditions, positive reflecting on diagonal, negative + // reflecting on off-diagonal: + typedef SymTenzor<double,Dim3> ST; + BConds<ST,Dim3,M3,Cell> tcc; + // Face 0 + tcc[0] = new PosReflectFace<ST,Dim3,M3,Cell>(0,0,0); + tcc[1] = new PosReflectFace<ST,Dim3,M3,Cell>(0,1,1); + tcc[2] = new PosReflectFace<ST,Dim3,M3,Cell>(0,2,2); + tcc[3] = new NegReflectFace<ST,Dim3,M3,Cell>(0,1,0); + tcc[4] = new NegReflectFace<ST,Dim3,M3,Cell>(0,2,0); + tcc[5] = new NegReflectFace<ST,Dim3,M3,Cell>(0,2,1); + // Face 1 + tcc[6] = new PosReflectFace<ST,Dim3,M3,Cell>(1,0,0); + tcc[7] = new PosReflectFace<ST,Dim3,M3,Cell>(1,1,1); + tcc[8] = new PosReflectFace<ST,Dim3,M3,Cell>(1,2,2); + tcc[9] = new NegReflectFace<ST,Dim3,M3,Cell>(1,1,0); + tcc[10] = new NegReflectFace<ST,Dim3,M3,Cell>(1,2,0); + tcc[11] = new NegReflectFace<ST,Dim3,M3,Cell>(1,2,1); + // Face 2 + tcc[12] = new PosReflectFace<ST,Dim3,M3,Cell>(2,0,0); + tcc[13] = new PosReflectFace<ST,Dim3,M3,Cell>(2,1,1); + tcc[14] = new PosReflectFace<ST,Dim3,M3,Cell>(2,2,2); + tcc[15] = new NegReflectFace<ST,Dim3,M3,Cell>(2,1,0); + tcc[16] = new NegReflectFace<ST,Dim3,M3,Cell>(2,2,0); + tcc[17] = new NegReflectFace<ST,Dim3,M3,Cell>(2,2,1); + // Face 3 + tcc[18] = new PosReflectFace<ST,Dim3,M3,Cell>(3,0,0); + tcc[19] = new PosReflectFace<ST,Dim3,M3,Cell>(3,1,1); + tcc[20] = new PosReflectFace<ST,Dim3,M3,Cell>(3,2,2); + tcc[21] = new NegReflectFace<ST,Dim3,M3,Cell>(3,1,0); + tcc[22] = new NegReflectFace<ST,Dim3,M3,Cell>(3,2,0); + tcc[24] = new NegReflectFace<ST,Dim3,M3,Cell>(3,2,1); + + // Cell-centered test Field's: + Field<ST,Dim3,M3,Cell> sA(layout3,GuardCellSizes<Dim3>(2),tcc); + Field<ST,Dim3,M3,Cell> sB(layout3); + // Assign reference values: + sA[I][J][K] = (I + J + K); + // Print reference values, then assign values ofsetting across boundaries + // and print results, Cell-centered case: + setFormat(1,2); + fdi << "++++++++++sA+++++++++++" << endl ; + fp3(sA); + sB[I][J][K] = sA[I-2][J][K]; + fdi << "++++++++++sB+++++++++++" << endl ; + fp3(sB); + + // Componentwise specification of BC's for a Field<Vektor> Set + // CartesianCenting-centered boundary conditions. + // TJW 12/16/97: this differs from earlier one in that it uses + // NegFeflectZeroFace instead of NegReflectFace. This tests the new + // NegReflectZeroFace BC, which sets last *physical* layers of vert-centered + // quantities/components to zero. Another difference from the earlier one: I + // put in GC and BC on the "B" and (new) "C" Field's, so that BC are applied + // to the results of the stencil ops. + BConds<Vektor<double,Dim>,Dim,M,vFace> vfbcz; + vfbcz[0] = new NegReflectAndZeroFace<Vektor<double,Dim>,Dim,M,vFace>(0,0); + vfbcz[1] = new PosReflectFace<Vektor<double,Dim>,Dim,M,vFace>(0,1); + vfbcz[2] = new NegReflectAndZeroFace<Vektor<double,Dim>,Dim,M,vFace>(1,0); + vfbcz[3] = new PosReflectFace<Vektor<double,Dim>,Dim,M,vFace>(1,1); + vfbcz[4] = new PosReflectFace<Vektor<double,Dim>,Dim,M,vFace>(2,0); + vfbcz[5] = new NegReflectAndZeroFace<Vektor<double,Dim>,Dim,M,vFace>(2,1); + vfbcz[6] = new PosReflectFace<Vektor<double,Dim>,Dim,M,vFace>(3,0); + vfbcz[7] = new NegReflectAndZeroFace<Vektor<double,Dim>,Dim,M,vFace>(3,1); + // vFace-centered test Field's: + Field<Vektor<double,Dim>,Dim,M,vFace> + vfzA(layout,GuardCellSizes<Dim>(2),vfbcz); + Field<Vektor<double,Dim>,Dim,M,vFace> + vfzB(layout,GuardCellSizes<Dim>(2),vfbcz); + Field<Vektor<double,Dim>,Dim,M,vFace> + vfzC(layout,GuardCellSizes<Dim>(2),vfbcz); + // Assign reference values: + counter=0; + value=0.0; + for (j=0; j<5; j++) { + for (i=0; i<5; i++) { + value = counter++; + assign(vfzA[i][j], (Vektor<double,Dim>)value); + } + } + // Print reference values, then assign values ofsetting across boundaries + // and print results, vfzace-centered case: + setFormat(2,2); + fdi << "++++++++++vfzA+++++++++++" << endl ; + fp2(vfzA); + vfzB[I][J] = vfzA[I-2][J]; + fdi << "++++++++++vfzB+++++++++++" << endl ; + fp2(vfzB); + vfzC[I][J] = vfzA[I-2][J-2]; + fdi << "++++++++++vfzC+++++++++++" << endl ; + fp2(vfzC); + + // Test NegReflectZeroFace BC with Vert centering (componentwise BC): + BConds<Vektor<double,Dim>,Dim,M,Vert> vbcz; + vbcz[0] = new NegReflectAndZeroFace<Vektor<double,Dim>,Dim,M,Vert>(0,0); + vbcz[1] = new PosReflectFace<Vektor<double,Dim>,Dim,M,Vert>(0,1); + vbcz[2] = new NegReflectAndZeroFace<Vektor<double,Dim>,Dim,M,Vert>(1,0); + vbcz[3] = new PosReflectFace<Vektor<double,Dim>,Dim,M,Vert>(1,1); + vbcz[4] = new PosReflectFace<Vektor<double,Dim>,Dim,M,Vert>(2,0); + vbcz[5] = new NegReflectAndZeroFace<Vektor<double,Dim>,Dim,M,Vert>(2,1); + vbcz[6] = new PosReflectFace<Vektor<double,Dim>,Dim,M,Vert>(3,0); + vbcz[7] = new NegReflectAndZeroFace<Vektor<double,Dim>,Dim,M,Vert>(3,1); + // vFace-centered test Field's: + Field<Vektor<double,Dim>,Dim,M,Vert> vzA(layout,GuardCellSizes<Dim>(2),vbcz); + Field<Vektor<double,Dim>,Dim,M,Vert> vzB(layout,GuardCellSizes<Dim>(2),vbcz); + Field<Vektor<double,Dim>,Dim,M,Vert> vzC(layout,GuardCellSizes<Dim>(2),vbcz); + // Assign reference values: + counter=0; + value=0.0; + for (j=0; j<5; j++) { + for (i=0; i<5; i++) { + value = counter++; + assign(vzA[i][j], (Vektor<double,Dim>)value); + } + } + // Print reference values, then assign values ofsetting across boundaries + // and print results, vert-centered case: + setFormat(2,2); + fdi << "++++++++++vzA+++++++++++" << endl ; + fp2(vzA); + vzB[I][J] = vzA[I-2][J]; + fdi << "++++++++++vzB+++++++++++" << endl ; + fp2(vzB); + vzC[I][J] = vzA[I-2][J-2]; + fdi << "++++++++++vzC+++++++++++" << endl ; + fp2(vzC); + + fdi << endl ; // Needed to flush output to file + + // Write out "by hand" into another file what the previous field-printing + // functions should have produced; this will be compared with what they + // actually did produce: + hardCodedOutput("text.correct.TestBC"); + + // Compare the two files by mocking up the Unix "diff" command: + bool passed = thediff("text.test.TestBC", + "text.correct.TestBC"); + + EXPECT_TRUE(passed); +} + +namespace { +//----------------------------------------------------------------------------- +// Mock up the Unix "diff" utility to compare two files: +//----------------------------------------------------------------------------- +bool thediff(char* filename1, char* filename2) +{ + bool same = true; + char ch1, ch2; + std::ifstream file1(filename1); + std::ifstream file2(filename2); + while (file1.get(ch1)) { // Read file 1 char-by-char until eof + if (file2.get(ch2)) { // Read equivalent char from file 2 + if (ch1 != ch2) same = false; // If they're different,files are different + } + else { + same = false; // If file 2 ends before file 1, different + } + } + return same; +} + +//----------------------------------------------------------------------------- +void hardCodedOutput(char* filename) +{ + std::ofstream of(filename); + of << "++++++++BConds object cbc begin++++++++" << std::endl; + of << "BConds:(" << std::endl; + of << "NegReflectFace, Face=0 , " << std::endl; + of << "ZeroFace, Face=1 , " << std::endl; + of << "ParallelPeriodicFace, Face=2 , " << std::endl; + of << "ParallelPeriodicFace, Face=3" << std::endl; + of << ")" << std::endl; + of << "" << std::endl; + of << "++++++++BConds object cbc end++++++++++" << std::endl; + of << "++++++++++cA+++++++++++" << std::endl; + of << "~~~~~~~~ field slice (0:4:1, 0:4:1) ~~~~~~~~" << std::endl; + of << "--------------------------------------------------J = 0" << std::endl; + of << "0.000e+00 1.000e+00 2.000e+00 3.000e+00 4.000e+00" << std::endl; + of << "" << std::endl << std::endl; + of << "--------------------------------------------------J = 1" << std::endl; + of << "5.000e+00 6.000e+00 7.000e+00 8.000e+00 9.000e+00" << std::endl; + of << "" << std::endl << std::endl; + of << "--------------------------------------------------J = 2" << std::endl; + of << "1.000e+01 1.100e+01 1.200e+01 1.300e+01 1.400e+01" << std::endl; + of << "" << std::endl << std::endl; + of << "--------------------------------------------------J = 3" << std::endl; + of << "1.500e+01 1.600e+01 1.700e+01 1.800e+01 1.900e+01" << std::endl; + of << "" << std::endl << std::endl; + of << "--------------------------------------------------J = 4" << std::endl; + of << "2.000e+01 2.100e+01 2.200e+01 2.300e+01 2.400e+01" << std::endl; + of << "" << std::endl << std::endl; + of << "++++++++++cB+++++++++++" << std::endl; + of << "~~~~~~~~ field slice (0:4:1, 0:4:1) ~~~~~~~~" << std::endl; + of << "--------------------------------------------------J = 0" << std::endl; + of << "-1.600e+01 -1.500e+01 1.500e+01 1.600e+01 1.700e+01" << std::endl; + of << "" << std::endl << std::endl; + of << "--------------------------------------------------J = 1" << std::endl; + of << "-2.100e+01 -2.000e+01 2.000e+01 2.100e+01 2.200e+01" << std::endl; + of << "" << std::endl << std::endl; + of << "--------------------------------------------------J = 2" << std::endl; + of << "-1.000e+00 0.000e+00 0.000e+00 1.000e+00 2.000e+00" << std::endl; + of << "" << std::endl << std::endl; + of << "--------------------------------------------------J = 3" << std::endl; + of << "-6.000e+00 -5.000e+00 5.000e+00 6.000e+00 7.000e+00" << std::endl; + of << "" << std::endl << std::endl; + of << "--------------------------------------------------J = 4" << std::endl; + of << "-1.100e+01 -1.000e+01 1.000e+01 1.100e+01 1.200e+01" << std::endl; + of << "" << std::endl << std::endl; + of << "++++++++++vA+++++++++++" << std::endl; + of << "~~~~~~~~ field slice (0:4:1, 0:4:1) ~~~~~~~~" << std::endl; + of << "--------------------------------------------------J = 0" << std::endl; + of << "0.000e+00 1.000e+00 2.000e+00 3.000e+00 4.000e+00" << std::endl; + of << "" << std::endl << std::endl; + of << "--------------------------------------------------J = 1" << std::endl; + of << "5.000e+00 6.000e+00 7.000e+00 8.000e+00 9.000e+00" << std::endl; + of << "" << std::endl << std::endl; + of << "--------------------------------------------------J = 2" << std::endl; + of << "1.000e+01 1.100e+01 1.200e+01 1.300e+01 1.400e+01" << std::endl; + of << "" << std::endl << std::endl; + of << "--------------------------------------------------J = 3" << std::endl; + of << "1.500e+01 1.600e+01 1.700e+01 1.800e+01 1.900e+01" << std::endl; + of << "" << std::endl << std::endl; + of << "--------------------------------------------------J = 4" << std::endl; + of << "0.000e+00 1.000e+00 2.000e+00 3.000e+00 4.000e+00" << std::endl; + of << "" << std::endl << std::endl; + of << "++++++++++vB+++++++++++" << std::endl; + of << "~~~~~~~~ field slice (0:4:1, 0:4:1) ~~~~~~~~" << std::endl; + of << "--------------------------------------------------J = 0" << std::endl; + of << "-1.200e+01 -1.100e+01 1.000e+01 1.100e+01 1.200e+01" << std::endl; + of << "" << std::endl << std::endl; + of << "--------------------------------------------------J = 1" << std::endl; + of << "-1.700e+01 -1.600e+01 1.500e+01 1.600e+01 1.700e+01" << std::endl; + of << "" << std::endl << std::endl; + of << "--------------------------------------------------J = 2" << std::endl; + of << "-2.000e+00 -1.000e+00 0.000e+00 1.000e+00 2.000e+00" << std::endl; + of << "" << std::endl << std::endl; + of << "--------------------------------------------------J = 3" << std::endl; + of << "-7.000e+00 -6.000e+00 5.000e+00 6.000e+00 7.000e+00" << std::endl; + of << "" << std::endl << std::endl; + of << "--------------------------------------------------J = 4" << std::endl; + of << "-1.200e+01 -1.100e+01 1.000e+01 1.100e+01 1.200e+01" << std::endl; + of << "" << std::endl << std::endl; + of << "++++++++++vcA+++++++++++" << std::endl; + of << "~~~~~~~~ field slice (0:4:1, 0:4:1) ~~~~~~~~" << std::endl; + of << "--------------------------------------------------J = 0" << std::endl; + of << "( 0.00e+00 , 0.00e+00 ) ( 1.00e+00 , 1.00e+00 )" << std::endl; + of << "( 2.00e+00 , 2.00e+00 ) ( 3.00e+00 , 3.00e+00 )" << std::endl; + of << "( 4.00e+00 , 4.00e+00 ) " << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 1" << std::endl; + of << "( 5.00e+00 , 5.00e+00 ) ( 6.00e+00 , 6.00e+00 )" << std::endl; + of << "( 7.00e+00 , 7.00e+00 ) ( 8.00e+00 , 8.00e+00 )" << std::endl; + of << "( 9.00e+00 , 9.00e+00 ) " << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 2" << std::endl; + of << "( 1.00e+01 , 1.00e+01 ) ( 1.10e+01 , 1.10e+01 )" << std::endl; + of << "( 1.20e+01 , 1.20e+01 ) ( 1.30e+01 , 1.30e+01 )" << std::endl; + of << "( 1.40e+01 , 1.40e+01 ) " << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 3" << std::endl; + of << "( 1.50e+01 , 1.50e+01 ) ( 1.60e+01 , 1.60e+01 )" << std::endl; + of << "( 1.70e+01 , 1.70e+01 ) ( 1.80e+01 , 1.80e+01 )" << std::endl; + of << "( 1.90e+01 , 1.90e+01 ) " << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 4" << std::endl; + of << "( 2.00e+01 , 2.00e+01 ) ( 2.10e+01 , 2.10e+01 )" << std::endl; + of << "( 2.20e+01 , 2.20e+01 ) ( 2.30e+01 , 2.30e+01 )" << std::endl; + of << "( 2.40e+01 , 2.40e+01 ) " << std::endl; + of << "" << std::endl; + of << "++++++++++vcB+++++++++++" << std::endl; + of << "~~~~~~~~ field slice (0:4:1, 0:4:1) ~~~~~~~~" << std::endl; + of << "--------------------------------------------------J = 0" << std::endl; + of << "( -1.00e+00 , 1.00e+00 ) ( 0.00e+00 , 0.00e+00 )" << std::endl; + of << "( 0.00e+00 , 0.00e+00 ) ( 1.00e+00 , 1.00e+00 )" << std::endl; + of << "( 2.00e+00 , 2.00e+00 ) " << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 1" << std::endl; + of << "( -6.00e+00 , 6.00e+00 ) ( -5.00e+00 , 5.00e+00 )" << std::endl; + of << "( 5.00e+00 , 5.00e+00 ) ( 6.00e+00 , 6.00e+00 )" << std::endl; + of << "( 7.00e+00 , 7.00e+00 ) " << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 2" << std::endl; + of << "( -1.10e+01 , 1.10e+01 ) ( -1.00e+01 , 1.00e+01 )" << std::endl; + of << "( 1.00e+01 , 1.00e+01 ) ( 1.10e+01 , 1.10e+01 )" << std::endl; + of << "( 1.20e+01 , 1.20e+01 ) " << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 3" << std::endl; + of << "( -1.60e+01 , 1.60e+01 ) ( -1.50e+01 , 1.50e+01 )" << std::endl; + of << "( 1.50e+01 , 1.50e+01 ) ( 1.60e+01 , 1.60e+01 )" << std::endl; + of << "( 1.70e+01 , 1.70e+01 ) " << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 4" << std::endl; + of << "( -2.10e+01 , 2.10e+01 ) ( -2.00e+01 , 2.00e+01 )" << std::endl; + of << "( 2.00e+01 , 2.00e+01 ) ( 2.10e+01 , 2.10e+01 )" << std::endl; + of << "( 2.20e+01 , 2.20e+01 ) " << std::endl; + of << "" << std::endl; + /* tjw: omit this test until componentwise ParallelPeriodicFace bug is fixed: + of << "++++++++++vfA+++++++++++" << std::endl; + of << "~~~~~~~~ field slice (0:4:1, 0:4:1) ~~~~~~~~" << std::endl; + of << "--------------------------------------------------J = 0" << std::endl; + of << "( 0.00e+00 , 0.00e+00 ) ( 1.00e+00 , 1.00e+00 )" << std::endl; + of << "( 2.00e+00 , 2.00e+00 ) ( 3.00e+00 , 3.00e+00 )" << std::endl; + of << "( 4.00e+00 , 3.00e+00 ) " << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 1" << std::endl; + of << "( 5.00e+00 , 5.00e+00 ) ( 6.00e+00 , 6.00e+00 )" << std::endl; + of << "( 7.00e+00 , 7.00e+00 ) ( 8.00e+00 , 8.00e+00 )" << std::endl; + of << "( 9.00e+00 , 8.00e+00 ) " << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 2" << std::endl; + of << "( 1.00e+01 , 1.00e+01 ) ( 1.10e+01 , 1.10e+01 )" << std::endl; + of << "( 1.20e+01 , 1.20e+01 ) ( 1.30e+01 , 1.30e+01 )" << std::endl; + of << "( 1.40e+01 , 1.30e+01 ) " << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 3" << std::endl; + of << "( 1.50e+01 , 1.50e+01 ) ( 1.60e+01 , 1.60e+01 )" << std::endl; + of << "( 1.70e+01 , 1.70e+01 ) ( 1.80e+01 , 1.80e+01 )" << std::endl; + of << "( 1.90e+01 , 1.80e+01 ) " << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 4" << std::endl; + of << "( 9.99e+00 , 0.00e+00 ) ( 9.99e+00 , 1.00e+00 )" << std::endl; + of << "( 9.99e+00 , 2.00e+00 ) ( 9.99e+00 , 3.00e+00 )" << std::endl; + of << "( 9.99e+00 , 3.00e+00 ) " << std::endl; + of << "" << std::endl; + of << "++++++++++vfB+++++++++++" << std::endl; + of << "~~~~~~~~ field slice (0:4:1, 0:4:1) ~~~~~~~~" << std::endl; + of << "--------------------------------------------------J = 0" << std::endl; + of << "( -2.00e+00 , 1.00e+00 ) ( -1.00e+00 , 0.00e+00 )" << std::endl; + of << "( 0.00e+00 , 0.00e+00 ) ( 1.00e+00 , 1.00e+00 )" << std::endl; + of << "( 2.00e+00 , 2.00e+00 ) " << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 1" << std::endl; + of << "( -7.00e+00 , 6.00e+00 ) ( -6.00e+00 , 5.00e+00 )" << std::endl; + of << "( 5.00e+00 , 5.00e+00 ) ( 6.00e+00 , 6.00e+00 )" << std::endl; + of << "( 7.00e+00 , 7.00e+00 ) " << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 2" << std::endl; + of << "( -1.20e+01 , 1.10e+01 ) ( -1.10e+01 , 1.00e+01 )" << std::endl; + of << "( 1.00e+01 , 1.00e+01 ) ( 1.10e+01 , 1.10e+01 )" << std::endl; + of << "( 1.20e+01 , 1.20e+01 ) " << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 3" << std::endl; + of << "( -1.70e+01 , 1.60e+01 ) ( -1.60e+01 , 1.50e+01 )" << std::endl; + of << "( 1.50e+01 , 1.50e+01 ) ( 1.60e+01 , 1.60e+01 )" << std::endl; + of << "( 1.70e+01 , 1.70e+01 ) " << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 4" << std::endl; + of << "( -9.99e+00 , 1.00e+00 ) ( -9.99e+00 , 0.00e+00 )" << std::endl; + of << "( 9.99e+00 , 0.00e+00 ) ( 9.99e+00 , 1.00e+00 )" << std::endl; + of << "( 9.99e+00 , 2.00e+00 ) " << std::endl; + of << "" << std::endl; + tjw: omit this test until componentwise ParallelPeriodicFace bug is fixed. */ + of << "++++++++++sA+++++++++++" << std::endl; + of << "~~~~~~~~ field slice (0:4:1, 0:4:1, 0:4:1) ~~~~~~~~" << std::endl; + of << "==================================================K = 0" << std::endl; + of << "--------------------------------------------------J = 0" << std::endl; + of << "(0.00e+00 , 0.00e+00 , 0.00e+00)"; + of << "(0.00e+00 , 0.00e+00 , 0.00e+00)"; + of << "(0.00e+00 , 0.00e+00 , 0.00e+00)" << std::endl; + of << "(1.00e+00 , 1.00e+00 , 1.00e+00)"; + of << "(1.00e+00 , 1.00e+00 , 1.00e+00)"; + of << "(1.00e+00 , 1.00e+00 , 1.00e+00)" << std::endl; + of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; + of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; + of << "(2.00e+00 , 2.00e+00 , 2.00e+00)" << std::endl; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << std::endl; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << std::endl; + of << "" << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 1" << std::endl; + of << "(1.00e+00 , 1.00e+00 , 1.00e+00)"; + of << "(1.00e+00 , 1.00e+00 , 1.00e+00)"; + of << "(1.00e+00 , 1.00e+00 , 1.00e+00)" << std::endl; + of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; + of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; + of << "(2.00e+00 , 2.00e+00 , 2.00e+00)" << std::endl; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << std::endl; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << std::endl; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << std::endl; + of << "" << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 2" << std::endl; + of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; + of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; + of << "(2.00e+00 , 2.00e+00 , 2.00e+00)" << std::endl; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << std::endl; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << std::endl; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << std::endl; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << std::endl; + of << "" << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 3" << std::endl; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << std::endl; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << std::endl; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << std::endl; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << std::endl; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << std::endl; + of << "" << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 4" << std::endl; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << std::endl; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << std::endl; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << std::endl; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << std::endl; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << std::endl; + of << "" << std::endl; + of << "" << std::endl; + of << "==================================================K = 1" << std::endl; + of << "--------------------------------------------------J = 0" << std::endl; + of << "(1.00e+00 , 1.00e+00 , 1.00e+00)"; + of << "(1.00e+00 , 1.00e+00 , 1.00e+00)"; + of << "(1.00e+00 , 1.00e+00 , 1.00e+00)" << std::endl; + of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; + of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; + of << "(2.00e+00 , 2.00e+00 , 2.00e+00)" << std::endl; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << std::endl; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << std::endl; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << std::endl; + of << "" << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 1" << std::endl; + of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; + of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; + of << "(2.00e+00 , 2.00e+00 , 2.00e+00)" << std::endl; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << std::endl; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << std::endl; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << std::endl; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << std::endl; + of << "" << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 2" << std::endl; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << std::endl; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << std::endl; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << std::endl; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << std::endl; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << std::endl; + of << "" << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 3" << std::endl; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << std::endl; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << std::endl; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << std::endl; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << std::endl; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << std::endl; + of << "" << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 4" << std::endl; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << std::endl; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << std::endl; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << std::endl; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << std::endl; + of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; + of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; + of << "(9.00e+00 , 9.00e+00 , 9.00e+00)" << std::endl; + of << "" << std::endl; + of << "" << std::endl; + of << "==================================================K = 2" << std::endl; + of << "--------------------------------------------------J = 0" << std::endl; + of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; + of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; + of << "(2.00e+00 , 2.00e+00 , 2.00e+00)" << std::endl; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << std::endl; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << std::endl; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << std::endl; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << std::endl; + of << "" << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 1" << std::endl; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << std::endl; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << std::endl; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << std::endl; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << std::endl; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << std::endl; + of << "" << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 2" << std::endl; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << std::endl; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << std::endl; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << std::endl; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << std::endl; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << std::endl; + of << "" << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 3" << std::endl; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << std::endl; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << std::endl; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << std::endl; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << std::endl; + of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; + of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; + of << "(9.00e+00 , 9.00e+00 , 9.00e+00)" << std::endl; + of << "" << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 4" << std::endl; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << std::endl; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << std::endl; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << std::endl; + of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; + of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; + of << "(9.00e+00 , 9.00e+00 , 9.00e+00)" << std::endl; + of << "(1.00e+01 , 1.00e+01 , 1.00e+01)"; + of << "(1.00e+01 , 1.00e+01 , 1.00e+01)"; + of << "(1.00e+01 , 1.00e+01 , 1.00e+01)" << std::endl; + of << "" << std::endl; + of << "" << std::endl; + of << "==================================================K = 3" << std::endl; + of << "--------------------------------------------------J = 0" << std::endl; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << std::endl; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << std::endl; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << std::endl; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << std::endl; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << std::endl; + of << "" << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 1" << std::endl; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << std::endl; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << std::endl; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << std::endl; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << std::endl; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << std::endl; + of << "" << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 2" << std::endl; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << std::endl; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << std::endl; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << std::endl; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << std::endl; + of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; + of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; + of << "(9.00e+00 , 9.00e+00 , 9.00e+00)" << std::endl; + of << "" << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 3" << std::endl; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << std::endl; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << std::endl; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << std::endl; + of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; + of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; + of << "(9.00e+00 , 9.00e+00 , 9.00e+00)" << std::endl; + of << "(1.00e+01 , 1.00e+01 , 1.00e+01)"; + of << "(1.00e+01 , 1.00e+01 , 1.00e+01)"; + of << "(1.00e+01 , 1.00e+01 , 1.00e+01)" << std::endl; + of << "" << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 4" << std::endl; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << std::endl; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << std::endl; + of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; + of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; + of << "(9.00e+00 , 9.00e+00 , 9.00e+00)" << std::endl; + of << "(1.00e+01 , 1.00e+01 , 1.00e+01)"; + of << "(1.00e+01 , 1.00e+01 , 1.00e+01)"; + of << "(1.00e+01 , 1.00e+01 , 1.00e+01)" << std::endl; + of << "(1.10e+01 , 1.10e+01 , 1.10e+01)"; + of << "(1.10e+01 , 1.10e+01 , 1.10e+01)"; + of << "(1.10e+01 , 1.10e+01 , 1.10e+01)" << std::endl; + of << "" << std::endl; + of << "" << std::endl; + of << "==================================================K = 4" << std::endl; + of << "--------------------------------------------------J = 0" << std::endl; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << std::endl; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << std::endl; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << std::endl; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << std::endl; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << std::endl; + of << "" << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 1" << std::endl; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << std::endl; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << std::endl; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << std::endl; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << std::endl; + of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; + of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; + of << "(9.00e+00 , 9.00e+00 , 9.00e+00)" << std::endl; + of << "" << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 2" << std::endl; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << std::endl; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << std::endl; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << std::endl; + of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; + of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; + of << "(9.00e+00 , 9.00e+00 , 9.00e+00)" << std::endl; + of << "(1.00e+01 , 1.00e+01 , 1.00e+01)"; + of << "(1.00e+01 , 1.00e+01 , 1.00e+01)"; + of << "(1.00e+01 , 1.00e+01 , 1.00e+01)" << std::endl; + of << "" << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 3" << std::endl; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << std::endl; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << std::endl; + of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; + of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; + of << "(9.00e+00 , 9.00e+00 , 9.00e+00)" << std::endl; + of << "(1.00e+01 , 1.00e+01 , 1.00e+01)"; + of << "(1.00e+01 , 1.00e+01 , 1.00e+01)"; + of << "(1.00e+01 , 1.00e+01 , 1.00e+01)" << std::endl; + of << "(1.10e+01 , 1.10e+01 , 1.10e+01)"; + of << "(1.10e+01 , 1.10e+01 , 1.10e+01)"; + of << "(1.10e+01 , 1.10e+01 , 1.10e+01)" << std::endl; + of << "" << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 4" << std::endl; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << std::endl; + of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; + of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; + of << "(9.00e+00 , 9.00e+00 , 9.00e+00)" << std::endl; + of << "(1.00e+01 , 1.00e+01 , 1.00e+01)"; + of << "(1.00e+01 , 1.00e+01 , 1.00e+01)"; + of << "(1.00e+01 , 1.00e+01 , 1.00e+01)" << std::endl; + of << "(1.10e+01 , 1.10e+01 , 1.10e+01)"; + of << "(1.10e+01 , 1.10e+01 , 1.10e+01)"; + of << "(1.10e+01 , 1.10e+01 , 1.10e+01)" << std::endl; + of << "(1.20e+01 , 1.20e+01 , 1.20e+01)"; + of << "(1.20e+01 , 1.20e+01 , 1.20e+01)"; + of << "(1.20e+01 , 1.20e+01 , 1.20e+01)" << std::endl; + of << "" << std::endl; + of << "" << std::endl; + of << "++++++++++sB+++++++++++" << std::endl; + of << "~~~~~~~~ field slice (0:4:1, 0:4:1, 0:4:1) ~~~~~~~~" << std::endl; + of << "==================================================K = 0" << std::endl; + of << "--------------------------------------------------J = 0" << std::endl; + of << "(1.00e+00 , -1.00e+00 , -1.00e+00)"; + of << "(-1.00e+00 , 1.00e+00 , -1.00e+00)"; + of << "(-1.00e+00 , -1.00e+00 , 1.00e+00)" << std::endl; + of << "(0.00e+00 , 0.00e+00 , 0.00e+00)"; + of << "(0.00e+00 , 0.00e+00 , 0.00e+00)"; + of << "(0.00e+00 , 0.00e+00 , 0.00e+00)" << std::endl; + of << "(0.00e+00 , 0.00e+00 , 0.00e+00)"; + of << "(0.00e+00 , 0.00e+00 , 0.00e+00)"; + of << "(0.00e+00 , 0.00e+00 , 0.00e+00)" << std::endl; + of << "(1.00e+00 , 1.00e+00 , 1.00e+00)"; + of << "(1.00e+00 , 1.00e+00 , 1.00e+00)"; + of << "(1.00e+00 , 1.00e+00 , 1.00e+00)" << std::endl; + of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; + of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; + of << "(2.00e+00 , 2.00e+00 , 2.00e+00)" << std::endl; + of << "" << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 1" << std::endl; + of << "(2.00e+00 , -2.00e+00 , -2.00e+00)"; + of << "(-2.00e+00 , 2.00e+00 , -2.00e+00)"; + of << "(-2.00e+00 , -2.00e+00 , 2.00e+00)" << std::endl; + of << "(1.00e+00 , -1.00e+00 , -1.00e+00)"; + of << "(-1.00e+00 , 1.00e+00 , -1.00e+00)"; + of << "(-1.00e+00 , -1.00e+00 , 1.00e+00)" << std::endl; + of << "(1.00e+00 , 1.00e+00 , 1.00e+00)"; + of << "(1.00e+00 , 1.00e+00 , 1.00e+00)"; + of << "(1.00e+00 , 1.00e+00 , 1.00e+00)" << std::endl; + of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; + of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; + of << "(2.00e+00 , 2.00e+00 , 2.00e+00)" << std::endl; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << std::endl; + of << "" << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 2" << std::endl; + of << "(3.00e+00 , -3.00e+00 , -3.00e+00)"; + of << "(-3.00e+00 , 3.00e+00 , -3.00e+00)"; + of << "(-3.00e+00 , -3.00e+00 , 3.00e+00)" << std::endl; + of << "(2.00e+00 , -2.00e+00 , -2.00e+00)"; + of << "(-2.00e+00 , 2.00e+00 , -2.00e+00)"; + of << "(-2.00e+00 , -2.00e+00 , 2.00e+00)" << std::endl; + of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; + of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; + of << "(2.00e+00 , 2.00e+00 , 2.00e+00)" << std::endl; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << std::endl; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << std::endl; + of << "" << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 3" << std::endl; + of << "(4.00e+00 , -4.00e+00 , -4.00e+00)"; + of << "(-4.00e+00 , 4.00e+00 , -4.00e+00)"; + of << "(-4.00e+00 , -4.00e+00 , 4.00e+00)" << std::endl; + of << "(3.00e+00 , -3.00e+00 , -3.00e+00)"; + of << "(-3.00e+00 , 3.00e+00 , -3.00e+00)"; + of << "(-3.00e+00 , -3.00e+00 , 3.00e+00)" << std::endl; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << std::endl; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << std::endl; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << std::endl; + of << "" << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 4" << std::endl; + of << "(5.00e+00 , -5.00e+00 , -5.00e+00)"; + of << "(-5.00e+00 , 5.00e+00 , -5.00e+00)"; + of << "(-5.00e+00 , -5.00e+00 , 5.00e+00)" << std::endl; + of << "(4.00e+00 , -4.00e+00 , -4.00e+00)"; + of << "(-4.00e+00 , 4.00e+00 , -4.00e+00)"; + of << "(-4.00e+00 , -4.00e+00 , 4.00e+00)" << std::endl; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << std::endl; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << std::endl; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << std::endl; + of << "" << std::endl; + of << "" << std::endl; + of << "==================================================K = 1" << std::endl; + of << "--------------------------------------------------J = 0" << std::endl; + of << "(2.00e+00 , -2.00e+00 , -2.00e+00)"; + of << "(-2.00e+00 , 2.00e+00 , -2.00e+00)"; + of << "(-2.00e+00 , -2.00e+00 , 2.00e+00)" << std::endl; + of << "(1.00e+00 , -1.00e+00 , -1.00e+00)"; + of << "(-1.00e+00 , 1.00e+00 , -1.00e+00)"; + of << "(-1.00e+00 , -1.00e+00 , 1.00e+00)" << std::endl; + of << "(1.00e+00 , 1.00e+00 , 1.00e+00)"; + of << "(1.00e+00 , 1.00e+00 , 1.00e+00)"; + of << "(1.00e+00 , 1.00e+00 , 1.00e+00)" << std::endl; + of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; + of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; + of << "(2.00e+00 , 2.00e+00 , 2.00e+00)" << std::endl; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << std::endl; + of << "" << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 1" << std::endl; + of << "(3.00e+00 , -3.00e+00 , -3.00e+00)"; + of << "(-3.00e+00 , 3.00e+00 , -3.00e+00)"; + of << "(-3.00e+00 , -3.00e+00 , 3.00e+00)" << std::endl; + of << "(2.00e+00 , -2.00e+00 , -2.00e+00)"; + of << "(-2.00e+00 , 2.00e+00 , -2.00e+00)"; + of << "(-2.00e+00 , -2.00e+00 , 2.00e+00)" << std::endl; + of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; + of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; + of << "(2.00e+00 , 2.00e+00 , 2.00e+00)" << std::endl; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << std::endl; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << std::endl; + of << "" << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 2" << std::endl; + of << "(4.00e+00 , -4.00e+00 , -4.00e+00)"; + of << "(-4.00e+00 , 4.00e+00 , -4.00e+00)"; + of << "(-4.00e+00 , -4.00e+00 , 4.00e+00)" << std::endl; + of << "(3.00e+00 , -3.00e+00 , -3.00e+00)"; + of << "(-3.00e+00 , 3.00e+00 , -3.00e+00)"; + of << "(-3.00e+00 , -3.00e+00 , 3.00e+00)" << std::endl; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << std::endl; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << std::endl; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << std::endl; + of << "" << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 3" << std::endl; + of << "(5.00e+00 , -5.00e+00 , -5.00e+00)"; + of << "(-5.00e+00 , 5.00e+00 , -5.00e+00)"; + of << "(-5.00e+00 , -5.00e+00 , 5.00e+00)" << std::endl; + of << "(4.00e+00 , -4.00e+00 , -4.00e+00)"; + of << "(-4.00e+00 , 4.00e+00 , -4.00e+00)"; + of << "(-4.00e+00 , -4.00e+00 , 4.00e+00)" << std::endl; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << std::endl; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << std::endl; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << std::endl; + of << "" << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 4" << std::endl; + of << "(6.00e+00 , -6.00e+00 , -6.00e+00)"; + of << "(-6.00e+00 , 6.00e+00 , -6.00e+00)"; + of << "(-6.00e+00 , -6.00e+00 , 6.00e+00)" << std::endl; + of << "(5.00e+00 , -5.00e+00 , -5.00e+00)"; + of << "(-5.00e+00 , 5.00e+00 , -5.00e+00)"; + of << "(-5.00e+00 , -5.00e+00 , 5.00e+00)" << std::endl; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << std::endl; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << std::endl; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << std::endl; + of << "" << std::endl; + of << "" << std::endl; + of << "==================================================K = 2" << std::endl; + of << "--------------------------------------------------J = 0" << std::endl; + of << "(3.00e+00 , -3.00e+00 , -3.00e+00)"; + of << "(-3.00e+00 , 3.00e+00 , -3.00e+00)"; + of << "(-3.00e+00 , -3.00e+00 , 3.00e+00)" << std::endl; + of << "(2.00e+00 , -2.00e+00 , -2.00e+00)"; + of << "(-2.00e+00 , 2.00e+00 , -2.00e+00)"; + of << "(-2.00e+00 , -2.00e+00 , 2.00e+00)" << std::endl; + of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; + of << "(2.00e+00 , 2.00e+00 , 2.00e+00)"; + of << "(2.00e+00 , 2.00e+00 , 2.00e+00)" << std::endl; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << std::endl; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << std::endl; + of << "" << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 1" << std::endl; + of << "(4.00e+00 , -4.00e+00 , -4.00e+00)"; + of << "(-4.00e+00 , 4.00e+00 , -4.00e+00)"; + of << "(-4.00e+00 , -4.00e+00 , 4.00e+00)" << std::endl; + of << "(3.00e+00 , -3.00e+00 , -3.00e+00)"; + of << "(-3.00e+00 , 3.00e+00 , -3.00e+00)"; + of << "(-3.00e+00 , -3.00e+00 , 3.00e+00)" << std::endl; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << std::endl; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << std::endl; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << std::endl; + of << "" << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 2" << std::endl; + of << "(5.00e+00 , -5.00e+00 , -5.00e+00)"; + of << "(-5.00e+00 , 5.00e+00 , -5.00e+00)"; + of << "(-5.00e+00 , -5.00e+00 , 5.00e+00)" << std::endl; + of << "(4.00e+00 , -4.00e+00 , -4.00e+00)"; + of << "(-4.00e+00 , 4.00e+00 , -4.00e+00)"; + of << "(-4.00e+00 , -4.00e+00 , 4.00e+00)" << std::endl; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << std::endl; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << std::endl; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << std::endl; + of << "" << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 3" << std::endl; + of << "(6.00e+00 , -6.00e+00 , -6.00e+00)"; + of << "(-6.00e+00 , 6.00e+00 , -6.00e+00)"; + of << "(-6.00e+00 , -6.00e+00 , 6.00e+00)" << std::endl; + of << "(5.00e+00 , -5.00e+00 , -5.00e+00)"; + of << "(-5.00e+00 , 5.00e+00 , -5.00e+00)"; + of << "(-5.00e+00 , -5.00e+00 , 5.00e+00)" << std::endl; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << std::endl; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << std::endl; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << std::endl; + of << "" << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 4" << std::endl; + of << "(7.00e+00 , -7.00e+00 , -7.00e+00)"; + of << "(-7.00e+00 , 7.00e+00 , -7.00e+00)"; + of << "(-7.00e+00 , -7.00e+00 , 7.00e+00)" << std::endl; + of << "(6.00e+00 , -6.00e+00 , -6.00e+00)"; + of << "(-6.00e+00 , 6.00e+00 , -6.00e+00)"; + of << "(-6.00e+00 , -6.00e+00 , 6.00e+00)" << std::endl; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << std::endl; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << std::endl; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << std::endl; + of << "" << std::endl; + of << "" << std::endl; + of << "==================================================K = 3" << std::endl; + of << "--------------------------------------------------J = 0" << std::endl; + of << "(4.00e+00 , -4.00e+00 , -4.00e+00)"; + of << "(-4.00e+00 , 4.00e+00 , -4.00e+00)"; + of << "(-4.00e+00 , -4.00e+00 , 4.00e+00)" << std::endl; + of << "(3.00e+00 , -3.00e+00 , -3.00e+00)"; + of << "(-3.00e+00 , 3.00e+00 , -3.00e+00)"; + of << "(-3.00e+00 , -3.00e+00 , 3.00e+00)" << std::endl; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)"; + of << "(3.00e+00 , 3.00e+00 , 3.00e+00)" << std::endl; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << std::endl; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << std::endl; + of << "" << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 1" << std::endl; + of << "(5.00e+00 , -5.00e+00 , -5.00e+00)"; + of << "(-5.00e+00 , 5.00e+00 , -5.00e+00)"; + of << "(-5.00e+00 , -5.00e+00 , 5.00e+00)" << std::endl; + of << "(4.00e+00 , -4.00e+00 , -4.00e+00)"; + of << "(-4.00e+00 , 4.00e+00 , -4.00e+00)"; + of << "(-4.00e+00 , -4.00e+00 , 4.00e+00)" << std::endl; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << std::endl; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << std::endl; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << std::endl; + of << "" << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 2" << std::endl; + of << "(6.00e+00 , -6.00e+00 , -6.00e+00)"; + of << "(-6.00e+00 , 6.00e+00 , -6.00e+00)"; + of << "(-6.00e+00 , -6.00e+00 , 6.00e+00)" << std::endl; + of << "(5.00e+00 , -5.00e+00 , -5.00e+00)"; + of << "(-5.00e+00 , 5.00e+00 , -5.00e+00)"; + of << "(-5.00e+00 , -5.00e+00 , 5.00e+00)" << std::endl; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << std::endl; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << std::endl; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << std::endl; + of << "" << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 3" << std::endl; + of << "(7.00e+00 , -7.00e+00 , -7.00e+00)"; + of << "(-7.00e+00 , 7.00e+00 , -7.00e+00)"; + of << "(-7.00e+00 , -7.00e+00 , 7.00e+00)" << std::endl; + of << "(6.00e+00 , -6.00e+00 , -6.00e+00)"; + of << "(-6.00e+00 , 6.00e+00 , -6.00e+00)"; + of << "(-6.00e+00 , -6.00e+00 , 6.00e+00)" << std::endl; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << std::endl; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << std::endl; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << std::endl; + of << "" << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 4" << std::endl; + of << "(8.00e+00 , -8.00e+00 , -8.00e+00)"; + of << "(-8.00e+00 , 8.00e+00 , -8.00e+00)"; + of << "(-8.00e+00 , -8.00e+00 , 8.00e+00)" << std::endl; + of << "(7.00e+00 , -7.00e+00 , -7.00e+00)"; + of << "(-7.00e+00 , 7.00e+00 , -7.00e+00)"; + of << "(-7.00e+00 , -7.00e+00 , 7.00e+00)" << std::endl; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << std::endl; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << std::endl; + of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; + of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; + of << "(9.00e+00 , 9.00e+00 , 9.00e+00)" << std::endl; + of << "" << std::endl; + of << "" << std::endl; + of << "==================================================K = 4" << std::endl; + of << "--------------------------------------------------J = 0" << std::endl; + of << "(5.00e+00 , -5.00e+00 , -5.00e+00)"; + of << "(-5.00e+00 , 5.00e+00 , -5.00e+00)"; + of << "(-5.00e+00 , -5.00e+00 , 5.00e+00)" << std::endl; + of << "(4.00e+00 , -4.00e+00 , -4.00e+00)"; + of << "(-4.00e+00 , 4.00e+00 , -4.00e+00)"; + of << "(-4.00e+00 , -4.00e+00 , 4.00e+00)" << std::endl; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)"; + of << "(4.00e+00 , 4.00e+00 , 4.00e+00)" << std::endl; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << std::endl; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << std::endl; + of << "" << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 1" << std::endl; + of << "(6.00e+00 , -6.00e+00 , -6.00e+00)"; + of << "(-6.00e+00 , 6.00e+00 , -6.00e+00)"; + of << "(-6.00e+00 , -6.00e+00 , 6.00e+00)" << std::endl; + of << "(5.00e+00 , -5.00e+00 , -5.00e+00)"; + of << "(-5.00e+00 , 5.00e+00 , -5.00e+00)"; + of << "(-5.00e+00 , -5.00e+00 , 5.00e+00)" << std::endl; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)"; + of << "(5.00e+00 , 5.00e+00 , 5.00e+00)" << std::endl; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << std::endl; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << std::endl; + of << "" << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 2" << std::endl; + of << "(7.00e+00 , -7.00e+00 , -7.00e+00)"; + of << "(-7.00e+00 , 7.00e+00 , -7.00e+00)"; + of << "(-7.00e+00 , -7.00e+00 , 7.00e+00)" << std::endl; + of << "(6.00e+00 , -6.00e+00 , -6.00e+00)"; + of << "(-6.00e+00 , 6.00e+00 , -6.00e+00)"; + of << "(-6.00e+00 , -6.00e+00 , 6.00e+00)" << std::endl; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)"; + of << "(6.00e+00 , 6.00e+00 , 6.00e+00)" << std::endl; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << std::endl; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << std::endl; + of << "" << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 3" << std::endl; + of << "(8.00e+00 , -8.00e+00 , -8.00e+00)"; + of << "(-8.00e+00 , 8.00e+00 , -8.00e+00)"; + of << "(-8.00e+00 , -8.00e+00 , 8.00e+00)" << std::endl; + of << "(7.00e+00 , -7.00e+00 , -7.00e+00)"; + of << "(-7.00e+00 , 7.00e+00 , -7.00e+00)"; + of << "(-7.00e+00 , -7.00e+00 , 7.00e+00)" << std::endl; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)"; + of << "(7.00e+00 , 7.00e+00 , 7.00e+00)" << std::endl; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << std::endl; + of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; + of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; + of << "(9.00e+00 , 9.00e+00 , 9.00e+00)" << std::endl; + of << "" << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 4" << std::endl; + of << "(9.00e+00 , -9.00e+00 , -9.00e+00)"; + of << "(-9.00e+00 , 9.00e+00 , -9.00e+00)"; + of << "(-9.00e+00 , -9.00e+00 , 9.00e+00)" << std::endl; + of << "(8.00e+00 , -8.00e+00 , -8.00e+00)"; + of << "(-8.00e+00 , 8.00e+00 , -8.00e+00)"; + of << "(-8.00e+00 , -8.00e+00 , 8.00e+00)" << std::endl; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)"; + of << "(8.00e+00 , 8.00e+00 , 8.00e+00)" << std::endl; + of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; + of << "(9.00e+00 , 9.00e+00 , 9.00e+00)"; + of << "(9.00e+00 , 9.00e+00 , 9.00e+00)" << std::endl; + of << "(1.00e+01 , 1.00e+01 , 1.00e+01)"; + of << "(1.00e+01 , 1.00e+01 , 1.00e+01)"; + of << "(1.00e+01 , 1.00e+01 , 1.00e+01)" << std::endl; + of << "" << std::endl; + of << "" << std::endl; + of << "++++++++++vfzA+++++++++++" << std::endl; + of << "~~~~~~~~ field slice (0:4:1, 0:4:1) ~~~~~~~~" << std::endl; + of << "--------------------------------------------------J = 0" << std::endl; + of << "( 0.00e+00 , 0.00e+00 ) ( 1.00e+00 , 1.00e+00 )" << std::endl; + of << "( 2.00e+00 , 2.00e+00 ) ( 3.00e+00 , 3.00e+00 )" << std::endl; + of << "( -3.00e+00 , 3.00e+00 ) " << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 1" << std::endl; + of << "( 5.00e+00 , 5.00e+00 ) ( 6.00e+00 , 6.00e+00 )" << std::endl; + of << "( 7.00e+00 , 7.00e+00 ) ( 8.00e+00 , 8.00e+00 )" << std::endl; + of << "( -8.00e+00 , 8.00e+00 ) " << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 2" << std::endl; + of << "( 1.00e+01 , 1.00e+01 ) ( 1.10e+01 , 1.10e+01 )" << std::endl; + of << "( 1.20e+01 , 1.20e+01 ) ( 1.30e+01 , 1.30e+01 )" << std::endl; + of << "( -1.30e+01 , 1.30e+01 ) " << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 3" << std::endl; + of << "( 1.50e+01 , 1.50e+01 ) ( 1.60e+01 , 1.60e+01 )" << std::endl; + of << "( 1.70e+01 , 1.70e+01 ) ( 1.80e+01 , 1.80e+01 )" << std::endl; + of << "( -1.80e+01 , 1.80e+01 ) " << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 4" << std::endl; + of << "( 1.50e+01 , -1.50e+01 ) ( 1.60e+01 , -1.60e+01 )" << std::endl; + of << "( 1.70e+01 , -1.70e+01 ) ( 1.80e+01 , -1.80e+01 )" << std::endl; + of << "( -1.80e+01 , -1.80e+01 ) " << std::endl; + of << "" << std::endl; + of << "++++++++++vfzB+++++++++++" << std::endl; + of << "~~~~~~~~ field slice (0:4:1, 0:4:1) ~~~~~~~~" << std::endl; + of << "--------------------------------------------------J = 0" << std::endl; + of << "( -1.00e+00 , 1.00e+00 ) ( 0.00e+00 , 0.00e+00 )" << std::endl; + of << "( 0.00e+00 , 0.00e+00 ) ( 1.00e+00 , 1.00e+00 )" << std::endl; + of << "( -1.00e+00 , 1.00e+00 ) " << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 1" << std::endl; + of << "( -6.00e+00 , 6.00e+00 ) ( -5.00e+00 , 5.00e+00 )" << std::endl; + of << "( 5.00e+00 , 5.00e+00 ) ( 6.00e+00 , 6.00e+00 )" << std::endl; + of << "( -6.00e+00 , 6.00e+00 ) " << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 2" << std::endl; + of << "( -1.10e+01 , 1.10e+01 ) ( -1.00e+01 , 1.00e+01 )" << std::endl; + of << "( 1.00e+01 , 1.00e+01 ) ( 1.10e+01 , 1.10e+01 )" << std::endl; + of << "( -1.10e+01 , 1.10e+01 ) " << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 3" << std::endl; + of << "( -1.60e+01 , 1.60e+01 ) ( -1.50e+01 , 1.50e+01 )" << std::endl; + of << "( 1.50e+01 , 1.50e+01 ) ( 1.60e+01 , 1.60e+01 )" << std::endl; + of << "( -1.60e+01 , 1.60e+01 ) " << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 4" << std::endl; + of << "( -1.60e+01 , -1.60e+01 ) ( -1.50e+01 , -1.50e+01 )" << std::endl; + of << "( 1.50e+01 , -1.50e+01 ) ( 1.60e+01 , -1.60e+01 )" << std::endl; + of << "( -1.60e+01 , -1.60e+01 ) " << std::endl; + of << "" << std::endl; + of << "++++++++++vfzC+++++++++++" << std::endl; + of << "~~~~~~~~ field slice (0:4:1, 0:4:1) ~~~~~~~~" << std::endl; + of << "--------------------------------------------------J = 0" << std::endl; + of << "( -6.00e+00 , -6.00e+00 ) ( -5.00e+00 , -5.00e+00 )" << std::endl; + of << "( 5.00e+00 , -5.00e+00 ) ( 6.00e+00 , -6.00e+00 )" << std::endl; + of << "( -6.00e+00 , -6.00e+00 ) " << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 1" << std::endl; + of << "( -1.00e+00 , -1.00e+00 ) ( 0.00e+00 , 0.00e+00 )" << std::endl; + of << "( 0.00e+00 , 0.00e+00 ) ( 1.00e+00 , -1.00e+00 )" << std::endl; + of << "( -1.00e+00 , -1.00e+00 ) " << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 2" << std::endl; + of << "( -1.00e+00 , 1.00e+00 ) ( 0.00e+00 , 0.00e+00 )" << std::endl; + of << "( 0.00e+00 , 0.00e+00 ) ( 1.00e+00 , 1.00e+00 )" << std::endl; + of << "( -1.00e+00 , 1.00e+00 ) " << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 3" << std::endl; + of << "( -6.00e+00 , 6.00e+00 ) ( -5.00e+00 , 5.00e+00 )" << std::endl; + of << "( 5.00e+00 , 5.00e+00 ) ( 6.00e+00 , 6.00e+00 )" << std::endl; + of << "( -6.00e+00 , 6.00e+00 ) " << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 4" << std::endl; + of << "( -6.00e+00 , -6.00e+00 ) ( -5.00e+00 , -5.00e+00 )" << std::endl; + of << "( 5.00e+00 , -5.00e+00 ) ( 6.00e+00 , -6.00e+00 )" << std::endl; + of << "( -6.00e+00 , -6.00e+00 ) " << std::endl; + of << "" << std::endl; + of << "++++++++++vzA+++++++++++" << std::endl; + of << "~~~~~~~~ field slice (0:4:1, 0:4:1) ~~~~~~~~" << std::endl; + of << "--------------------------------------------------J = 0" << std::endl; + of << "( 0.00e+00 , 0.00e+00 ) ( 1.00e+00 , 0.00e+00 )" << std::endl; + of << "( 2.00e+00 , 0.00e+00 ) ( 3.00e+00 , 0.00e+00 )" << std::endl; + of << "( 0.00e+00 , 0.00e+00 ) " << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 1" << std::endl; + of << "( 0.00e+00 , 5.00e+00 ) ( 6.00e+00 , 6.00e+00 )" << std::endl; + of << "( 7.00e+00 , 7.00e+00 ) ( 8.00e+00 , 8.00e+00 )" << std::endl; + of << "( 0.00e+00 , 9.00e+00 ) " << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 2" << std::endl; + of << "( 0.00e+00 , 1.00e+01 ) ( 1.10e+01 , 1.10e+01 )" << std::endl; + of << "( 1.20e+01 , 1.20e+01 ) ( 1.30e+01 , 1.30e+01 )" << std::endl; + of << "( 0.00e+00 , 1.40e+01 ) " << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 3" << std::endl; + of << "( 0.00e+00 , 1.50e+01 ) ( 1.60e+01 , 1.60e+01 )" << std::endl; + of << "( 1.70e+01 , 1.70e+01 ) ( 1.80e+01 , 1.80e+01 )" << std::endl; + of << "( 0.00e+00 , 1.90e+01 ) " << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 4" << std::endl; + of << "( 0.00e+00 , 0.00e+00 ) ( 2.10e+01 , 0.00e+00 )" << std::endl; + of << "( 2.20e+01 , 0.00e+00 ) ( 2.30e+01 , 0.00e+00 )" << std::endl; + of << "( 0.00e+00 , 0.00e+00 ) " << std::endl; + of << "" << std::endl; + of << "++++++++++vzB+++++++++++" << std::endl; + of << "~~~~~~~~ field slice (0:4:1, 0:4:1) ~~~~~~~~" << std::endl; + of << "--------------------------------------------------J = 0" << std::endl; + of << "( 0.00e+00 , 0.00e+00 ) ( -1.00e+00 , 0.00e+00 )" << std::endl; + of << "( 0.00e+00 , 0.00e+00 ) ( 1.00e+00 , 0.00e+00 )" << std::endl; + of << "( 0.00e+00 , 0.00e+00 ) " << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 1" << std::endl; + of << "( 0.00e+00 , 7.00e+00 ) ( -6.00e+00 , 6.00e+00 )" << std::endl; + of << "( 0.00e+00 , 5.00e+00 ) ( 6.00e+00 , 6.00e+00 )" << std::endl; + of << "( 0.00e+00 , 7.00e+00 ) " << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 2" << std::endl; + of << "( 0.00e+00 , 1.20e+01 ) ( -1.10e+01 , 1.10e+01 )" << std::endl; + of << "( 0.00e+00 , 1.00e+01 ) ( 1.10e+01 , 1.10e+01 )" << std::endl; + of << "( 0.00e+00 , 1.20e+01 ) " << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 3" << std::endl; + of << "( 0.00e+00 , 1.70e+01 ) ( -1.60e+01 , 1.60e+01 )" << std::endl; + of << "( 0.00e+00 , 1.50e+01 ) ( 1.60e+01 , 1.60e+01 )" << std::endl; + of << "( 0.00e+00 , 1.70e+01 ) " << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 4" << std::endl; + of << "( 0.00e+00 , 0.00e+00 ) ( -2.10e+01 , 0.00e+00 )" << std::endl; + of << "( 0.00e+00 , 0.00e+00 ) ( 2.10e+01 , 0.00e+00 )" << std::endl; + of << "( 0.00e+00 , 0.00e+00 ) " << std::endl; + of << "" << std::endl; + of << "++++++++++vzC+++++++++++" << std::endl; + of << "~~~~~~~~ field slice (0:4:1, 0:4:1) ~~~~~~~~" << std::endl; + of << "--------------------------------------------------J = 0" << std::endl; + of << "( 0.00e+00 , 0.00e+00 ) ( -1.10e+01 , 0.00e+00 )" << std::endl; + of << "( 0.00e+00 , 0.00e+00 ) ( 1.10e+01 , 0.00e+00 )" << std::endl; + of << "( 0.00e+00 , 0.00e+00 ) " << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 1" << std::endl; + of << "( 0.00e+00 , -7.00e+00 ) ( -6.00e+00 , -6.00e+00 )" << std::endl; + of << "( 0.00e+00 , -5.00e+00 ) ( 6.00e+00 , -6.00e+00 )" << std::endl; + of << "( 0.00e+00 , -7.00e+00 ) " << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 2" << std::endl; + of << "( 0.00e+00 , 0.00e+00 ) ( -1.00e+00 , 0.00e+00 )" << std::endl; + of << "( 0.00e+00 , 0.00e+00 ) ( 1.00e+00 , 0.00e+00 )" << std::endl; + of << "( 0.00e+00 , 0.00e+00 ) " << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 3" << std::endl; + of << "( 0.00e+00 , 7.00e+00 ) ( -6.00e+00 , 6.00e+00 )" << std::endl; + of << "( 0.00e+00 , 5.00e+00 ) ( 6.00e+00 , 6.00e+00 )" << std::endl; + of << "( 0.00e+00 , 7.00e+00 ) " << std::endl; + of << "" << std::endl; + of << "--------------------------------------------------J = 4" << std::endl; + of << "( 0.00e+00 , 0.00e+00 ) ( -1.10e+01 , 0.00e+00 )" << std::endl; + of << "( 0.00e+00 , 0.00e+00 ) ( 1.10e+01 , 0.00e+00 )" << std::endl; + of << "( 0.00e+00 , 0.00e+00 ) " << std::endl; + of << "" << std::endl; + of << "" << std::endl; + + of.close(); +} +} \ No newline at end of file diff --git a/tests/ippl_src/Field/CMakeLists.txt b/tests/ippl_src/Field/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..2068676daa65c256eba225c1919cd044713a8201 --- /dev/null +++ b/tests/ippl_src/Field/CMakeLists.txt @@ -0,0 +1,22 @@ +set (_SRCS + BCond.cpp + Eureka.cpp + Field.cpp + FieldDebug.cpp +) + +add_compile_options(-Wno-write-strings) + +include_directories ( + ${CMAKE_CURRENT_SOURCE_DIR} +) + +add_sources(${_SRCS}) + +# vi: set et ts=4 sw=4 sts=4: + +# Local Variables: +# mode: cmake +# cmake-tab-width: 4 +# indent-tabs-mode: nil +# End: \ No newline at end of file diff --git a/tests/ippl_src/Field/Eureka.cpp b/tests/ippl_src/Field/Eureka.cpp new file mode 100644 index 0000000000000000000000000000000000000000..16d03167a6b1ebc4af74ff84555235b5ae32f77c --- /dev/null +++ b/tests/ippl_src/Field/Eureka.cpp @@ -0,0 +1,99 @@ +#include "gtest/gtest.h" + +#include "Index/NDIndex.h" +#include "FieldLayout/FieldLayout.h" +#include "Field/Field.h" +#include "Field/BCond.h" +#include "Meshes/UniformCartesian.h" +#include "Meshes/CartesianCentering.h" +#include "AppTypes/Vektor.h" + +#include "opal_test_utilities/SilenceTest.h" + +#include <cstdio> +#include <iostream> + +constexpr double roundOffError = 1e-10; + +// template definition in BCond.cpp +//CenteringEnum CCCEnums<2U,2U,0U>::vectorFace[2U*2U]; + +TEST(Field, Eureka) +{ + OpalTestUtilities::SilenceTest silencer; + + const int N = 6; + Index I(1,N), J(1,N); + Index I0(-1,N+2), J0(-1,N+2); + Index I1(2,N-1),J1(2,N-1); + + FieldLayout<2> layout(I,J); + FieldLayout<2> layout0(I0,J0); + GuardCellSizes<2> gc(2); + + // Test all cell centering. + BConds<double,2> bc1; + bc1[1] = new EurekaFace<double,2>(0); + bc1[2] = new EurekaFace<double,2>(1); + bc1[3] = new EurekaFace<double,2>(2); + bc1[4] = new EurekaFace<double,2>(3); + + Field<double,2> A1(layout,gc,bc1), A0(layout0); + + A1[I][J] = 10.0*I + 100.0*J; + + // Assign the full domain to A0. + A0[I0][J0] = A1[I0][J0]; + + // See if we got the right answer. + // s1 should be zero. + A0[I1][J1] -= 10.0*I1 + 100.0*J1; + + double s1 = sum(A0*A0); + + EXPECT_NEAR(s1, 0.0, roundOffError); + + // Test mixed centering. + typedef Vektor<double,2> T; + typedef UniformCartesian<2> M; + typedef CartesianCentering<CCCEnums<2,2,0>::vectorFace,2,2> C; + BConds<T,2,M,C> bc2; + bc2[0] = new EurekaFace<T,2,M,C>(0,0); + bc2[1] = new EurekaFace<T,2,M,C>(1,0); + bc2[2] = new EurekaFace<T,2,M,C>(2,0); + bc2[3] = new EurekaFace<T,2,M,C>(3,0); + bc2[4] = new EurekaFace<T,2,M,C>(0,1); + bc2[5] = new EurekaFace<T,2,M,C>(1,1); + bc2[6] = new EurekaFace<T,2,M,C>(2,1); + bc2[7] = new EurekaFace<T,2,M,C>(3,1); + + Field<T,2,M,C> B1(layout,gc,bc2), B0(layout0); + + // Fill with nontrivial data. + B1[I][J] = T(1,1)*(I + 10.0*J); + + std::cout << B1 << std::endl << std::endl; + + // Pull it out into a field that shows the guard layers. + B0[I0][J0] = B1[I0][J0]; + + std::cout << B0 << std::endl << std::endl; + + // See if we got the right answer. + B0[I1][J1] -= T(1,1)*(I1+10.0*J1); + B0[1][J1] -= T(1,1)*(1+10.0*J1); + B0[N][J1] -= T(1,1)*(N+10.0*J1); + B0[I1][1] -= T(1,1)*(I1+10.0); + B0[I1][N] -= T(1,1)*(I1+10.0*N); + + B0[N][N] -= T(1,1)*(N+10.0*N); + B0[1][N] -= T(1,1)*(1+10.0*N); + B0[1][1] -= T(1,1)*(1+10.0); + B0[N][1] -= T(1,1)*(N+10.0); + + Vektor<T,2> s2 = sum(B0*B0); + EXPECT_TRUE((s2 == Vektor<T,2>(0,0)) ); + + std::cout << s2 << std::endl; + std::cout << B0 << std::endl << std::endl; +} \ No newline at end of file diff --git a/tests/ippl_src/Field/Field.cpp b/tests/ippl_src/Field/Field.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c904cf2af86a22973b0caaecbdeee5c440b736da --- /dev/null +++ b/tests/ippl_src/Field/Field.cpp @@ -0,0 +1,791 @@ +#include "gtest/gtest.h" + +#include "opal_test_utilities/SilenceTest.h" + +#include "Field/BareField.h" +#include "Field/Field.h" +#include "FieldLayout/FieldLayout.h" +#include "Index/Index.h" +#include "Meshes/UniformCartesian.h" + +#include <map> +#include <iostream> + +constexpr unsigned Dim = 2; +constexpr unsigned D2 = 2; +constexpr unsigned D3 = 3; +constexpr unsigned D4 = 4; +constexpr double roundOffError = 1e-10; + +TEST(Field, Balance) +{ + OpalTestUtilities::SilenceTest silencer; + + const int N=10; + Index I(N); + Index J(N); + FieldLayout<Dim> layout1(I,J,PARALLEL,SERIAL,4); + FieldLayout<Dim> layout2(I,J,SERIAL,PARALLEL,8); + Field<int,Dim> A1(layout1),A2(layout2); + + A1 = 0; + A1[I][J] += I + 10*J; + A2 = A1; + + A2[I][J] -= I + 10*J; + A2 *= A2; + int s = sum(A2); + + EXPECT_NEAR(s, 0, roundOffError); +} + +TEST(Field, Component) +{ + Index I(5),J(5); + FieldLayout<Dim> layout(I,J); + typedef UniformCartesian<Dim,double> Mesh; + Field<double,Dim,Mesh> S1(layout),S2(layout),S3(layout); + Field<Vektor<double,Dim>,Dim,Mesh> V1(layout); + + S1[I][J] = I+10*J ; + S2[I][J] = -I-10*J ; + V1[I][J](0) << S1[I][J] ; + V1[I][J](1) << S2[I][J]*10.0 ; + S1[I][J] = V1[I][J](0) - (I+10*J); + S2[I][J] = V1[I][J](1)/10.0 + (I+10*J); + S1 *= S1; + S2 *= S2; + double s1 = sum(S1); + double s2 = sum(S2); + EXPECT_NEAR(s1,0,roundOffError); + EXPECT_NEAR(s2,0,roundOffError); + + V1[I][J](0) << I ; + V1[I][J](1) << 27.5 ; + S1[I][J] = V1[I][J](0) - I; + S2[I][J] = V1[I][J](1) - 27.5; + S1 *= S1; + S2 *= S2; + s1 = sum(S1); + s2 = sum(S2); + EXPECT_NEAR(s1,0,roundOffError); + EXPECT_NEAR(s2,0,roundOffError); + + S1[I][J] = I+10*J ; + S2[I][J] = -I-10*J ; + V1 = Vektor<double,2>(0,0); + V1[I][J](0) += S1[I][J] ; + V1[I][J](1) += S2[I][J]*10.0 ; + S1[I][J] = V1[I][J](0) - (I+10*J); + S2[I][J] = V1[I][J](1)/10.0 + (I+10*J); + S1 *= S1; + S2 *= S2; + s1 = sum(S1); + s2 = sum(S2); + EXPECT_NEAR(s1,0,roundOffError); + EXPECT_NEAR(s2,0,roundOffError); + + V1 = Vektor<double,2>(0,0); + V1[I][J](0) += I ; + V1[I][J](1) += 27.5 ; + S1[I][J] = V1[I][J](0) - I; + S2[I][J] = V1[I][J](1) + (-27.5); + S1 *= S1; + S2 *= S2; + s1 = sum(S1); + s2 = sum(S2); + EXPECT_NEAR(s1,0,roundOffError); + EXPECT_NEAR(s2,0,roundOffError); +} + +TEST(Field, Compressed) +{ + Index I(10),J(10); + FieldLayout<Dim> layout(I,J,PARALLEL,PARALLEL,4); + GuardCellSizes<Dim> gc(1); + typedef BareField<int,Dim> F; + F A(layout,gc); + + // A should be constructed compressed. + F::iterator_if lf; + int count; + + ////////////////////////////////////////////////////////////////////// + // Test if it is constructed compressed + // (or uncompressed, if --nofieldcompression) + ////////////////////////////////////////////////////////////////////// + + // if (IpplInfo::noFieldCompression) { + for (lf=A.begin_if(), count=0; lf!=A.end_if(); ++lf, ++count) { + if ( ( (*lf).second->IsCompressed() && IpplInfo::noFieldCompression) || + (!(*lf).second->IsCompressed() && !IpplInfo::noFieldCompression)) { + std::cout << "FAILED: An LField is (un)compressed," << count << std::endl; + EXPECT_TRUE(false); + } + } + + ////////////////////////////////////////////////////////////////////// + // Test whether fillGuardCells destroys the compression. + ////////////////////////////////////////////////////////////////////// + A.fillGuardCells(); + for (lf=A.begin_if(), count=0; lf!=A.end_if(); ++lf, ++count) { + if ( ( (*lf).second->IsCompressed() && IpplInfo::noFieldCompression) || + (!(*lf).second->IsCompressed() && !IpplInfo::noFieldCompression)) { + std::cout << "FAILED: (un)compressed after fillGuardCells, " << count << std::endl; + EXPECT_TRUE(false); + } + } + + ////////////////////////////////////////////////////////////////////// + // Test whether assigning an index uncompresses. + ////////////////////////////////////////////////////////////////////// + assign(A[I][J] , I + 10*J); + for (lf=A.begin_if(), count=0; lf!=A.end_if(); ++lf, ++count) { + if ( (*lf).second->IsCompressed() ) { + std::cout << "FAILED: Compressed after assigning Index, " << count << std::endl; + EXPECT_TRUE(false); + } + } + + int s = sum(A); + int il = I.length(); + int jl = J.length(); + int ss = jl*il*(il-1)/2 + il*jl*(jl-1)*5; + EXPECT_NEAR(s, ss, roundOffError); + + ////////////////////////////////////////////////////////////////////// + // Test whether assigning a constant compresses. + ////////////////////////////////////////////////////////////////////// + A = 1; + for (lf=A.begin_if(), count=0; lf!=A.end_if(); ++lf, ++count) { + if ( ( (*lf).second->IsCompressed() && IpplInfo::noFieldCompression) || + (!(*lf).second->IsCompressed() && !IpplInfo::noFieldCompression)) { + std::cout << "FAILED: (Un)compressed after assigning constant, " << count << std::endl; + EXPECT_TRUE(false); + } + } + s = sum(A); + EXPECT_EQ(s, (int)(I.length()*J.length())); + + ////////////////////////////////////////////////////////////////////// + // Test whether assigning a constant with indexes compresses. + ////////////////////////////////////////////////////////////////////// + // First uncompress it. + assign(A[I][J] , I+10*J); + // Then compress it. + assign(A[I][J] , 1 ); + for (lf=A.begin_if(), count=0; lf!=A.end_if(); ++lf, ++count) { + if ( ( (*lf).second->IsCompressed() && IpplInfo::noFieldCompression) || + (!(*lf).second->IsCompressed() && !IpplInfo::noFieldCompression)) { + std::cout << "FAILED: (Un)compressed after I-assigning constant, " << count << std::endl; + EXPECT_TRUE(false); + } + } + s = sum(A); + EXPECT_EQ(s, (int)(I.length()*J.length())); + + ////////////////////////////////////////////////////////////////////// + // Test whether assigning a subrange uncompresses. + ////////////////////////////////////////////////////////////////////// + Index I1( I.min()+1 , I.max()-1 ); + Index J1( J.min()+1 , J.max()-1 ); + A=0; + assign(A[I1][J1] , 1 ); + for (lf=A.begin_if(), count=0; lf!=A.end_if(); ++lf, ++count) { + if ( (*lf).second->IsCompressed() ) { + std::cout << "FAILED: Compressed after assigning subrange, " << count << std::endl; + EXPECT_TRUE(false); + } + } + s = sum(A); + EXPECT_EQ(s, (int)(I1.length()*J1.length())); + + ////////////////////////////////////////////////////////////////////// + // Test whether assigning a single element uncompresses one. + ////////////////////////////////////////////////////////////////////// + A = 0; + if (!IpplInfo::noFieldCompression) { + for (lf=A.begin_if(); lf!=A.end_if(); ++lf) { + if( !(*lf).second->IsCompressed() ) { + EXPECT_TRUE(false); + } + } + } + assign(A[3][3] , 1 ); + count = 0; + int reduced_count = 0; + if (IpplInfo::noFieldCompression) { + if (A.CompressedFraction() != 0) { + std::cout << "FAILED: Compressed somewhere after assigning single" << std::endl; + EXPECT_TRUE(false); + } + } else { + for (lf=A.begin_if(); lf!=A.end_if(); ++lf) { + if ( (*lf).second->IsCompressed() ) + ++count; + } + reduced_count = 0; + reduce(&count,&count+1,&reduced_count,OpAddAssign()); + EXPECT_EQ(reduced_count, 3); + } + s = sum(A); + EXPECT_NEAR(s, 1, roundOffError); + + ////////////////////////////////////////////////////////////////////// + // Test whether assigning a single element uncompresses one. + ////////////////////////////////////////////////////////////////////// + A = 0; + if (!IpplInfo::noFieldCompression) { + for (lf=A.begin_if(); lf!=A.end_if(); ++lf) { + if (! (*lf).second->IsCompressed() ) { + EXPECT_TRUE(false); + } + } + } + assign(A[4][3] , 1 ); + count = 0; + if (IpplInfo::noFieldCompression) { + if (A.CompressedFraction() != 0) { + std::cout << "FAILED: Compressed somewhere after assigning single" << std::endl; + EXPECT_TRUE(false); + } + } else { + for (lf=A.begin_if(); lf!=A.end_if(); ++lf) { + if ( (*lf).second->IsCompressed() ) + ++count; + } + reduced_count = 0; + reduce(&count,&count+1,&reduced_count,OpAddAssign()); + if (Ippl::deferGuardCellFills) { + EXPECT_EQ(reduced_count,3); + // testmsg << "PASSED: Uncompressed one after assigning in guard cell" + } + else { + EXPECT_EQ(reduced_count,2); + //testmsg << "PASSED: Uncompressed two after assigning in guard cell" + } + } + s = sum(A); + EXPECT_NEAR(s, 1, roundOffError); + + ////////////////////////////////////////////////////////////////////// + // Test whether an operation on that array leaves it correct. + ////////////////////////////////////////////////////////////////////// + A *= A; + count = 0; + if (IpplInfo::noFieldCompression) { + EXPECT_EQ(A.CompressedFraction(),0); + //testmsg << "FAILED: Compressed somewhere after squaring" << endl; + } + else { + for (lf=A.begin_if(); lf!=A.end_if(); ++lf) { + if ( (*lf).second->IsCompressed() ) + ++count; + } + reduced_count = 0; + reduce(&count,&count+1,&reduced_count,OpAddAssign()); + if (Ippl::deferGuardCellFills) { + EXPECT_EQ(reduced_count,3); + //testmsg << "PASSED: Uncompressed one after squaring" + } + else { + EXPECT_EQ(reduced_count,2); + //testmsg << "PASSED: Uncompressed two after squaring" + } + } + s = sum(A); + EXPECT_NEAR(s, 1, roundOffError); + + ////////////////////////////////////////////////////////////////////// + // Make sure we can construct a Field of Maps. + ////////////////////////////////////////////////////////////////////// + BareField< std::map<int,double> , Dim > B(layout); + BareField< std::map<int,double> , Dim >::iterator_if lb; + std::map<int,double> m; + m[1] = cos(1.0); + m[2] = cos(2.0); + B[2][2] = m; + count = 0; + if (IpplInfo::noFieldCompression) { + EXPECT_EQ(B.CompressedFraction(), 0); + // testmsg << "PASSED: Still uncompressed Field of maps" << endl; + } else { + for (lb=B.begin_if(); lb!=B.end_if(); ++lb) { + if ( (*lb).second->IsCompressed() ) + ++count; + } + reduced_count = 0; + reduce(&count,&count+1,&reduced_count,OpAddAssign()); + EXPECT_EQ(reduced_count, 3); + } +} + +TEST(Field, Patches) +{ + const int N=5; + Index I(N), J(N); + BConds<double,2> bc; + if (Ippl::getNodes() == 1) { + bc[0] = new PeriodicFace<double,2>(0); + bc[1] = new PeriodicFace<double,2>(1); + bc[2] = new PeriodicFace<double,2>(2); + bc[3] = new PeriodicFace<double,2>(3); + } + else { + bc[0] = new ParallelPeriodicFace<double,2>(0); + bc[1] = new ParallelPeriodicFace<double,2>(1); + bc[2] = new ParallelPeriodicFace<double,2>(2); + bc[3] = new ParallelPeriodicFace<double,2>(3); + } + + FieldLayout<1> layout1(I); + FieldLayout<2> layout2(I,J); + Field<double,2> B(layout2); + Field<double,1> C(layout1); + Field<double,2> T2(layout2); + Field<double,1> T1(layout1); + + int Guards = 0; + int i,j; + + { + Field<double,2> A(layout2,GuardCellSizes<2>(Guards),bc); + + //---------------------------------------- + + assign(A[I][J] , I+J*10); + T2 = A; + for (i=0;i<N;++i) + for (j=0;j<N;++j) { + T2[i][j] -= i+j*10.0; + } + T2 *= T2; + EXPECT_NEAR(sum(T2), 0, roundOffError); + // testmsg << " initializing A" << endl; + + //---------------------------------------- + + B = -1.0; + B[I][J] = A[J][I]; + T2 = B; + for (i=0;i<N;++i) + for (j=0;j<N;++j) { + T2[j][i] -= i+j*10.0; + } + T2 *= T2; + EXPECT_NEAR(sum(T2), 0, roundOffError); + //testmsg << " transposing A" << endl; + + //---------------------------------------- + + B = -1.0; + B[I][J] = A[I+1][J+1]; + T2 = B; + for (i=0;i<N;++i) + for (j=0;j<N;++j) { + if ( (i<N-1)&&(j<N-1) ) + T2[i][j] -= (i+1)+(j+1)*10.0; + else + T2[i][j] += 1.0; + } + T2 *= T2; + EXPECT_NEAR(sum(T2), 0, roundOffError); + // testmsg << " shifting A" << endl; + + //---------------------------------------- + + B = -1.0; + B[4][J] = A[J][4]; + T2 = B; + for (i=0;i<N;++i) { + for (j=0;j<N;++j) { + if ( i==4 ) + T2[i][j] -= j+40.0; + else + T2[i][j] += 1.0; + } + } + T2 *= T2; + EXPECT_NEAR(sum(T2), 0, roundOffError); + //testmsg << " copying a slice" << endl; + + //---------------------------------------- + + C[I] = 0.1*I; + B = -1.0; + B[I][4] = C[I] ; + T2 = B; + for (i=0;i<N;++i) { + for (j=0;j<N;++j) { + if ( j==4 ) + T2[i][j] -= i*0.1; + else + T2[i][j] += 1.0; + } + } + T2 *= T2; + EXPECT_NEAR(sum(T2), 0, roundOffError); + //testmsg << " inserting a slice" << endl; + + //---------------------------------------- + + C[I] = A[2][I] ; + for (i=0; i<N; ++i) + C[i] -= 2.0 + i*10.0; + C *= C; + EXPECT_NEAR(sum(C), 0, roundOffError); + //testmsg << " extracting a slice" << endl; + + } + + // Now the same tests with 1 layer of guard cells and periodic bc. + // The answers for shifting are slightly different. + Guards = 1; + + { + Field<double,2> A(layout2,GuardCellSizes<2>(Guards),bc); + + //---------------------------------------- + + A[I][J] = I+J*10 ; + T2 = A; + for (i=0;i<N;++i) + for (j=0;j<N;++j) { + T2[i][j] -= i+j*10.0; + } + T2 *= T2; + EXPECT_NEAR(sum(T2), 0, roundOffError); + //testmsg << " initializing guarded A" << endl; + + //---------------------------------------- + + B = -1.0; + B[I][J] = A[J][I]; + T2 = B; + for (i=0;i<N;++i) + for (j=0;j<N;++j) { + T2[j][i] -= i+j*10.0; + } + T2 *= T2; + EXPECT_NEAR(sum(T2), 0, roundOffError); + //testmsg << " transposing A" << endl; + + //---------------------------------------- + + B = -1.0; + B[I][J] = A[I+1][J+1]; + T2 = B; + for (i=0;i<N;++i) + for (j=0;j<N;++j) { + int ii = (i+1)%N; + int jj = (j+1)%N; + T2[i][j] -= ii+jj*10.0; + } + T2 *= T2; + EXPECT_NEAR(sum(T2), 0, roundOffError); + //testmsg << " shifting A" << endl; + + //---------------------------------------- + + B = -1.0; + B[4][J] = A[J][4]; + T2 = B; + for (i=0;i<N;++i) { + for (j=0;j<N;++j) { + if ( i==4 ) + T2[i][j] -= j+40.0; + else + T2[i][j] += 1.0; + } + } + T2 *= T2; + EXPECT_NEAR(sum(T2), 0, roundOffError); + //testmsg << " copying a slice" << endl; + + //---------------------------------------- + + C[I] = 0.1*I; + B = -1.0; + B[I][4] = C[I] ; + T2 = B; + for (i=0;i<N;++i) { + for (j=0;j<N;++j) { + if ( j==4 ) + T2[i][j] -= i*0.1; + else + T2[i][j] += 1.0; + } + } + T2 *= T2; + EXPECT_NEAR(sum(T2), 0, roundOffError); + //testmsg << " inserting a slice" << endl; + + //---------------------------------------- + + C[I] = A[2][I] ; + for (i=0; i<N; ++i) + C[i] -= 2.0 + i*10.0; + C *= C; + EXPECT_NEAR(sum(C), 0, roundOffError); + //testmsg << " extracting a slice" << endl; + } +} + +TEST(Field, Reduceloc) +{ + Index I(5); + Index J(5); + NDIndex<Dim> domain; + domain[0] = I; + domain[1] = J; + FieldLayout<Dim> layout(I,J); + Field<double,Dim> A(layout); + Field<double,Dim> B(layout); + Field<double,Dim> C(layout); + + A[I][J] << (I-1)*(I-1)+(J-1)*(J-1) + 1; + NDIndex<Dim> maxloc,minloc; + double maxval = max(A,maxloc); + double minval = min(A,minloc); + + double known_max = 19; + double known_min = 1; + NDIndex<Dim> known_minloc(Index(1,1),Index(1,1)); + NDIndex<Dim> known_maxloc(Index(4,4),Index(4,4)); + EXPECT_NEAR(maxval, known_max, roundOffError); + EXPECT_NEAR(minval, known_min, roundOffError); + EXPECT_TRUE(maxloc == known_maxloc); + EXPECT_TRUE(minloc == known_minloc); +} + +TEST(Field, ScalarIndexing) +{ + const unsigned nx = 4, ny = 4, nz = 4; + Index I(nx), J(ny), K(nz); + FieldLayout<D3> layout(I,J,K); + + // Instantiate and initialize scalar, vector, tensor fields: + Field<double,D3> scalarFld(layout); + double scalar = 1.0; + scalarFld << scalar; + Field<Vektor<double,D3>,D3> vectorFld(layout); + Vektor<double, D3> vector(1.0,2.0,3.0); + vectorFld << vector; + Field<Tenzor<double,D3>,D3,UniformCartesian<D3> > tensorFld(layout); + Tenzor<double, D3> tensor(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0); + tensorFld << tensor; + Field<SymTenzor<double,D3>,D3,UniformCartesian<D3> > symTensorFld(layout); + SymTenzor<double, D3> symTensor(1.0, 2.0, 3.0, 4.0, 5.0, 6.0); + symTensorFld << symTensor; + + // Now try the scalar indexing: + double scalar1 = 0.0; + Vektor<double, D3> vector1(0.0, 0.0, 0.0); + Tenzor<double, D3> tensor1(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); + SymTenzor<double, D3> symTensor1(0.0, 0.0, 0.0, 0.0, 0.0, 0.0); + scalar1 = scalarFld[1][1][1].get(); + vector1 = vectorFld[1][1][1].get(); + tensor1 = tensorFld[1][1][1].get(); + symTensor1 = symTensorFld[1][1][1].get(); + + EXPECT_TRUE((scalar1 == scalar)); + EXPECT_TRUE((vector1 == vector)); + EXPECT_TRUE((tensor1 == tensor)); + EXPECT_TRUE((symTensor1 == symTensor)); +} + +TEST(Field, Transpose) +{ + const int N=10; + + Index I(N),J(N),K(N),L(N); + NDIndex<D2> IJ(I,J); + NDIndex<D3> IJK(IJ,K); + NDIndex<D4> IJKL(IJK,L); + e_dim_tag dist[D4] = { PARALLEL,PARALLEL,SERIAL,SERIAL }; + FieldLayout<D2> layout2(IJ,dist); + FieldLayout<D3> layout3(IJK,dist); + FieldLayout<D4> layout4(IJKL,dist); + + Field<int,D2> A1(layout2),A2(layout2); + Field<int,D3> B1(layout3),B2(layout3); + Field<int,D4> C1(layout4),C2(layout4); + int ii = 1; + int jj = 10; + int kk = 100; + int ll = 1000; + int s; + + A1[I][J] = ii*I + jj*J; + A2[J][I] = A1[I][J] ; + A2[I][J] -= ii*J + jj*I ; + A2 *= A2; + s = sum(A2); + EXPECT_NEAR(s, 0, roundOffError); + //testmsg << "2D General transpose: " << (s?"FAILED":"PASSED") << endl; + + B1[I][J][K] = ii*I + jj*J + kk*K; + B2[I][J][K] = B1[I][K][J] ; + B2[I][J][K] -= ii*I + jj*K + kk*J; + B2 *= B2; + s = sum(B2); + EXPECT_NEAR(s, 0, roundOffError); + //testmsg << "3D General transpose: " << (s?"FAILED":"PASSED") << endl; + + C1[I][J][K][L] = ii*I + jj*J + kk*K + ll*L ; + C2[I][J][L][K] = C1[I][J][K][L] ; + C2[I][J][K][L] -= ii*I + jj*J + kk*L + ll*K ; + C2 *= C2; + s = sum(C2); + EXPECT_NEAR(s, 0, roundOffError); + //testmsg << "4D serial transpose: "<< (s?"FAILED":"PASSED") << endl; + + int a,b; + s = 0; + for (a=0; a<N; ++a) + { + A1[I][J] = B1[a][I][J]; + A1[I][J] -= a*ii + I*jj + J*kk; + A1 *= A1; + s += sum(A1); + } + EXPECT_NEAR(s, 0, roundOffError); + //testmsg << "General 2 from 3 " << (s ? "FAILED " : "PASSED ") << a << endl; + + s = 0; + for (a=0; a<N; ++a) + { + A1[I][J] = B1[I][a][J]; + A1[I][J] -= I*ii + a*jj + J*kk; + A1 *= A1; + s += sum(A1); + } + EXPECT_NEAR(s, 0, roundOffError); + //testmsg << "General 2 from 3 " << (s ? "FAILED " : "PASSED ") << a << endl; + + s = 0; + for (a=0; a<N; ++a) + { + A1[I][J] = B1[I][J][a]; + A1[I][J] -= I*ii + J*jj + a*kk; + A1 *= A1; + s += sum(A1); + } + EXPECT_NEAR(s, 0, roundOffError); + //testmsg << "Serial 2 from 3 " << (s ? "FAILED " : "PASSED ") << endl; + + A1[I][J] = ii*I + jj*J; + for (a=0; a<N; ++a) + B1[a][I][J] = A1[I][J] ; + B1[K][I][J] -= I*ii + J*jj; + B1 *= B1; + s = sum(B1); + EXPECT_NEAR(s, 0, roundOffError); + //testmsg << "General 3 from 2 " << (s ? "FAILED " : "PASSED ") << endl; + + for (a=0; a<N; ++a) + B1[I][a][J] = A1[I][J] ; + B1[I][K][J] -= I*ii + J*jj; + B1 *= B1; + s = sum(B1); + EXPECT_NEAR(s, 0, roundOffError); + //testmsg << "General 3 from 2 " << (s ? "FAILED " : "PASSED ") << endl; + + for (a=0; a<N; ++a) + B1[I][J][a] = A1[I][J] ; + B1[I][J][K] -= I*ii + J*jj; + B1 *= B1; + s = sum(B1); + EXPECT_NEAR(s, 0, roundOffError); + //testmsg << "Serial 3 from 2 " << (s ? "FAILED " : "PASSED ") << endl; + + for (a=0; a<N; ++a) + for (b=0; b<N; ++b) + C1[I][J][a][b] = A1[I][J] ; + C1[I][J][K][L] -= I*ii + J*jj; + C1 *= C1; + s = sum(C1); + EXPECT_NEAR(s, 0, roundOffError); + //testmsg << "Serial 4 from 2 " << (s ? "FAILED " : "PASSED ") << endl; +} + +namespace { + void check( Field<int,D3>& f, int s1, int s2, int s3, int test) + { + Index I = f.getIndex(0); + Index J = f.getIndex(1); + Index K = f.getIndex(2); + f[I][J][K] -= s1*I + s2*J + s3*K; + int sum_f = sum(f); + EXPECT_NEAR(sum_f, 0, roundOffError); + } +} + +TEST(Field, Transpose2) +{ + const int N=10; + + Index I(N),J(N),K(N); + FieldLayout<D3> layout_ppp(I,J,K,PARALLEL,PARALLEL,PARALLEL,8); + FieldLayout<D3> layout_spp(I,J,K,SERIAL,PARALLEL,PARALLEL,8); + FieldLayout<D3> layout_psp(I,J,K,PARALLEL,SERIAL,PARALLEL,8); + FieldLayout<D3> layout_pps(I,J,K,PARALLEL,PARALLEL,SERIAL,8); + + Field<int,D3> A(layout_ppp); + Field<int,D3> B(layout_spp); + Field<int,D3> C(layout_psp); + Field<int,D3> D(layout_pps); + int ii = 1; + int jj = 10; + int kk = 100; + + assign( A[I][J][K] , ii*I + jj*J + kk*K ); + B = A; + C = A; + D = A; + check(B,ii,jj,kk,1); + check(C,ii,jj,kk,2); + check(D,ii,jj,kk,3); + + B[I][J][K] = A[I][J][K]; + C[I][J][K] = A[I][J][K]; + D[I][J][K] = A[I][J][K]; + check(B,ii,jj,kk,4); + check(C,ii,jj,kk,5); + check(D,ii,jj,kk,6); + + B[I][K][J] = A[I][J][K]; + C[I][K][J] = A[I][J][K]; + D[I][K][J] = A[I][J][K]; + check(B,ii,kk,jj,7); + check(C,ii,kk,jj,8); + check(D,ii,kk,jj,9); + + B[J][I][K] = A[I][J][K]; + C[J][I][K] = A[I][J][K]; + D[J][I][K] = A[I][J][K]; + check(B,jj,ii,kk,10); + check(C,jj,ii,kk,11); + check(D,jj,ii,kk,12); + + B[J][K][I] = A[I][J][K]; + C[J][K][I] = A[I][J][K]; + D[J][K][I] = A[I][J][K]; + check(B,jj,kk,ii,13); + check(C,jj,kk,ii,14); + check(D,jj,kk,ii,15); + + B[K][I][J] = A[I][J][K]; + C[K][I][J] = A[I][J][K]; + D[K][I][J] = A[I][J][K]; + check(B,kk,ii,jj,16); + check(C,kk,ii,jj,17); + check(D,kk,ii,jj,18); + + B[K][J][I] = A[I][J][K]; + C[K][J][I] = A[I][J][K]; + D[K][J][I] = A[I][J][K]; + check(B,kk,jj,ii,19); + check(C,kk,jj,ii,20); + check(D,kk,jj,ii,21); +} \ No newline at end of file diff --git a/tests/ippl_src/Field/FieldDebug.cpp b/tests/ippl_src/Field/FieldDebug.cpp new file mode 100644 index 0000000000000000000000000000000000000000..aaf18392a261fc094de360316ee452939b9c4135 --- /dev/null +++ b/tests/ippl_src/Field/FieldDebug.cpp @@ -0,0 +1,410 @@ +#include "gtest/gtest.h" + +#include "Index/NDIndex.h" +#include "FieldLayout/FieldLayout.h" +#include "Field/Field.h" +#include "Field/BCond.h" +#include "Field/GuardCellSizes.h" +#include "AppTypes/Vektor.h" +#include "Utility/FieldDebug.h" + +#include <fstream> + +namespace { + void hardCodedOutput(char* filename); // Prototype of function defined below. + bool thediff(char* filename1, char* filename2); +} + +constexpr double roundOffError = 1e-10; + +TEST(Field, FieldDebug) +{ + bool docomm = true; // Should try the test both ways, really.... + + const unsigned Dim3=3; + + int nCells[Dim3]; // Number of grid cells in each direction + unsigned nVNodes[Dim3]; // Number of vnodes (subdomains) in each direction. + + // Hardwired values for automated test, as in regression testing: + for (unsigned int d=0; d<Dim3; d++) nCells[d] = 4; + for (unsigned int d=0; d<Dim3; d++) nVNodes[d] = 2; + + int nx, ny, nz; + nx = nCells[0]; ny = nCells[1]; nz = nCells[2]; + + Index I(nx); Index J(ny); Index K(nz); + // Specify multipple vnodes (8) to make sure this works right: + // FieldLayout<Dim3> layout3(I,J,K,PARALLEL,PARALLEL,PARALLEL,8); + NDIndex<Dim3> ndi; ndi[0] = I; ndi[1] = J; ndi[2] = K; + e_dim_tag serialParallelSpec[Dim3]; + for (unsigned int d=0; d<Dim3; d++) serialParallelSpec[d] = PARALLEL; + FieldLayout<Dim3> layout3(ndi, serialParallelSpec, nVNodes); + + // New Inform-based version (tjw): + Inform* fdip = + new Inform(NULL,"text.test.TestFieldDebug",Inform::OVERWRITE,0); + Inform& fdi = *fdip; + setInform(fdi); + + // Put guard cells and red-flag (value = -999) boundary conditions on + // Fields, to make sure nothing funny is happening: + GuardCellSizes<Dim3> gc(2); + BConds<double,Dim3> sbc; + for (unsigned int face=0; face < 2*Dim3; face++) { + sbc[face] = new ConstantFace<double,Dim3>(face,-999.0); + } + BConds<Vektor<double,Dim3>,Dim3> vbc; + for (unsigned int face=0; face < 2*Dim3; face++) { + vbc[face] = new ConstantFace<Vektor<double,Dim3>,Dim3>(face,-999.0); + } + + // Scalar Field ------------------------------------------------------------- + Field<double,Dim3> A3(layout3,sbc,gc); + assign(A3[I][J][K], I + J + K); + + fdi << endl << "--------fp3(A3)-------" << endl; + fp3(A3,docomm); + + fdi << endl << "--------sfp3(A3,nx-1,1,0,ny-1,1,0,nz-1,1)-------" << endl; + sfp3(A3,0,nx-1,1,0,ny-1,1,0,nz-1,1,docomm); + + fdi << endl << "--------sfp3(A3,nx-1,1,0,ny-1,2,0,nz-1,2)-------" << endl; + sfp3(A3,0,nx-1,1,0,ny-1,1,0,nz-1,1,docomm); + + + // Vector Field-------------------------------------------------------------- + Field<Vektor<double,Dim3>,Dim3> B3(layout3,vbc,gc); + Vektor<double, Dim3 > Vinit3(1.0,2.0,3.0); + assign(B3,Vinit3); + + fdi << endl << "--------setFormat(1,8)-------" << endl; + setFormat(1,8); + + fdi << endl << "--------fp3(B3)-------" << endl; + fp3(B3,docomm); + + // Write out "by hand" into another file what the previous field-printing + // functions should have produced; this will be compared with what they + // actually did produce: + hardCodedOutput("text.correct.TestFieldDebug"); + + // Compare the two files by mocking up the Unix "diff" command: + delete fdip; + bool passed = thediff("text.test.TestFieldDebug","text.correct.TestFieldDebug"); + EXPECT_TRUE(passed); +} + +namespace { + //----------------------------------------------------------------------------- + // Mock up the Unix "diff" utility to compare two files: + //----------------------------------------------------------------------------- + bool thediff(char* filename1, char* filename2) + { + bool same = true; + char ch1, ch2; + std::ifstream file1(filename1); + std::ifstream file2(filename2); + while (file1.get(ch1)) { // Read file 1 char-by-char until eof + if (file2.get(ch2)) { // Read equivalent char from file 2 + if (ch1 != ch2) same = false; // If they're different,files are different + } else { + same = false; // If file 2 ends before file 1, different + } + } + return(same); + } + + //----------------------------------------------------------------------------- + void hardCodedOutput(char* filename) + { + std::ofstream of(filename); + of << std::endl + << "--------fp3(A3)-------" << std::endl + << "~~~~~~~~ field slice (0:3:1, 0:3:1, 0:3:1) ~~~~~~~~" << std::endl + << "==================================================K = 0" << std::endl + << "--------------------------------------------------J = 0" << std::endl + << "0.000e+00 1.000e+00 2.000e+00 3.000e+00 " << std::endl + << "" << std::endl + << "--------------------------------------------------J = 1" << std::endl + << "1.000e+00 2.000e+00 3.000e+00 4.000e+00 " << std::endl + << "" << std::endl + << "--------------------------------------------------J = 2" << std::endl + << "2.000e+00 3.000e+00 4.000e+00 5.000e+00 " << std::endl + << "" << std::endl + << "--------------------------------------------------J = 3" << std::endl + << "3.000e+00 4.000e+00 5.000e+00 6.000e+00 " << std::endl + << "" << std::endl + << "==================================================K = 1" << std::endl + << "--------------------------------------------------J = 0" << std::endl + << "1.000e+00 2.000e+00 3.000e+00 4.000e+00 " << std::endl + << "" << std::endl + << "--------------------------------------------------J = 1" << std::endl + << "2.000e+00 3.000e+00 4.000e+00 5.000e+00 " << std::endl + << "" << std::endl + << "--------------------------------------------------J = 2" << std::endl + << "3.000e+00 4.000e+00 5.000e+00 6.000e+00 " << std::endl + << "" << std::endl + << "--------------------------------------------------J = 3" << std::endl + << "4.000e+00 5.000e+00 6.000e+00 7.000e+00 " << std::endl + << "" << std::endl + << "==================================================K = 2" << std::endl + << "--------------------------------------------------J = 0" << std::endl + << "2.000e+00 3.000e+00 4.000e+00 5.000e+00 " << std::endl + << "" << std::endl + << "--------------------------------------------------J = 1" << std::endl + << "3.000e+00 4.000e+00 5.000e+00 6.000e+00 " << std::endl + << "" << std::endl + << "--------------------------------------------------J = 2" << std::endl + << "4.000e+00 5.000e+00 6.000e+00 7.000e+00 " << std::endl + << "" << std::endl + << "--------------------------------------------------J = 3" << std::endl + << "5.000e+00 6.000e+00 7.000e+00 8.000e+00 " << std::endl + << "" << std::endl + << "==================================================K = 3" << std::endl + << "--------------------------------------------------J = 0" << std::endl + << "3.000e+00 4.000e+00 5.000e+00 6.000e+00 " << std::endl + << "" << std::endl + << "--------------------------------------------------J = 1" << std::endl + << "4.000e+00 5.000e+00 6.000e+00 7.000e+00 " << std::endl + << "" << std::endl + << "--------------------------------------------------J = 2" << std::endl + << "5.000e+00 6.000e+00 7.000e+00 8.000e+00 " << std::endl + << "" << std::endl + << "--------------------------------------------------J = 3" << std::endl + << "6.000e+00 7.000e+00 8.000e+00 9.000e+00 " << std::endl + << "" << std::endl + << "" << std::endl + << "--------sfp3(A3,nx-1,1,0,ny-1,1,0,nz-1,1)-------" << std::endl + << "~~~~~~~~ field slice (0:3:1, 0:3:1, 0:3:1) ~~~~~~~~" << std::endl + << "==================================================K = 0" << std::endl + << "--------------------------------------------------J = 0" << std::endl + << "0.000e+00 1.000e+00 2.000e+00 3.000e+00 " << std::endl + << "" << std::endl + << "--------------------------------------------------J = 1" << std::endl + << "1.000e+00 2.000e+00 3.000e+00 4.000e+00 " << std::endl + << "" << std::endl + << "--------------------------------------------------J = 2" << std::endl + << "2.000e+00 3.000e+00 4.000e+00 5.000e+00 " << std::endl + << "" << std::endl + << "--------------------------------------------------J = 3" << std::endl + << "3.000e+00 4.000e+00 5.000e+00 6.000e+00 " << std::endl + << "" << std::endl + << "==================================================K = 1" << std::endl + << "--------------------------------------------------J = 0" << std::endl + << "1.000e+00 2.000e+00 3.000e+00 4.000e+00 " << std::endl + << "" << std::endl + << "--------------------------------------------------J = 1" << std::endl + << "2.000e+00 3.000e+00 4.000e+00 5.000e+00 " << std::endl + << "" << std::endl + << "--------------------------------------------------J = 2" << std::endl + << "3.000e+00 4.000e+00 5.000e+00 6.000e+00 " << std::endl + << "" << std::endl + << "--------------------------------------------------J = 3" << std::endl + << "4.000e+00 5.000e+00 6.000e+00 7.000e+00 " << std::endl + << "" << std::endl + << "==================================================K = 2" << std::endl + << "--------------------------------------------------J = 0" << std::endl + << "2.000e+00 3.000e+00 4.000e+00 5.000e+00 " << std::endl + << "" << std::endl + << "--------------------------------------------------J = 1" << std::endl + << "3.000e+00 4.000e+00 5.000e+00 6.000e+00 " << std::endl + << "" << std::endl + << "--------------------------------------------------J = 2" << std::endl + << "4.000e+00 5.000e+00 6.000e+00 7.000e+00 " << std::endl + << "" << std::endl + << "--------------------------------------------------J = 3" << std::endl + << "5.000e+00 6.000e+00 7.000e+00 8.000e+00 " << std::endl + << "" << std::endl + << "==================================================K = 3" << std::endl + << "--------------------------------------------------J = 0" << std::endl + << "3.000e+00 4.000e+00 5.000e+00 6.000e+00 " << std::endl + << "" << std::endl + << "--------------------------------------------------J = 1" << std::endl + << "4.000e+00 5.000e+00 6.000e+00 7.000e+00 " << std::endl + << "" << std::endl + << "--------------------------------------------------J = 2" << std::endl + << "5.000e+00 6.000e+00 7.000e+00 8.000e+00 " << std::endl + << "" << std::endl + << "--------------------------------------------------J = 3" << std::endl + << "6.000e+00 7.000e+00 8.000e+00 9.000e+00 " << std::endl + << "" << std::endl + << "" << std::endl + << "--------sfp3(A3,nx-1,1,0,ny-1,2,0,nz-1,2)-------" << std::endl + << "~~~~~~~~ field slice (0:3:1, 0:3:1, 0:3:1) ~~~~~~~~" << std::endl + << "==================================================K = 0" << std::endl + << "--------------------------------------------------J = 0" << std::endl + << "0.000e+00 1.000e+00 2.000e+00 3.000e+00 " << std::endl + << "" << std::endl + << "--------------------------------------------------J = 1" << std::endl + << "1.000e+00 2.000e+00 3.000e+00 4.000e+00 " << std::endl + << "" << std::endl + << "--------------------------------------------------J = 2" << std::endl + << "2.000e+00 3.000e+00 4.000e+00 5.000e+00 " << std::endl + << "" << std::endl + << "--------------------------------------------------J = 3" << std::endl + << "3.000e+00 4.000e+00 5.000e+00 6.000e+00 " << std::endl + << "" << std::endl + << "==================================================K = 1" << std::endl + << "--------------------------------------------------J = 0" << std::endl + << "1.000e+00 2.000e+00 3.000e+00 4.000e+00 " << std::endl + << "" << std::endl + << "--------------------------------------------------J = 1" << std::endl + << "2.000e+00 3.000e+00 4.000e+00 5.000e+00 " << std::endl + << "" << std::endl + << "--------------------------------------------------J = 2" << std::endl + << "3.000e+00 4.000e+00 5.000e+00 6.000e+00 " << std::endl + << "" << std::endl + << "--------------------------------------------------J = 3" << std::endl + << "4.000e+00 5.000e+00 6.000e+00 7.000e+00 " << std::endl + << "" << std::endl + << "==================================================K = 2" << std::endl + << "--------------------------------------------------J = 0" << std::endl + << "2.000e+00 3.000e+00 4.000e+00 5.000e+00 " << std::endl + << "" << std::endl + << "--------------------------------------------------J = 1" << std::endl + << "3.000e+00 4.000e+00 5.000e+00 6.000e+00 " << std::endl + << "" << std::endl + << "--------------------------------------------------J = 2" << std::endl + << "4.000e+00 5.000e+00 6.000e+00 7.000e+00 " << std::endl + << "" << std::endl + << "--------------------------------------------------J = 3" << std::endl + << "5.000e+00 6.000e+00 7.000e+00 8.000e+00 " << std::endl + << "" << std::endl + << "==================================================K = 3" << std::endl + << "--------------------------------------------------J = 0" << std::endl + << "3.000e+00 4.000e+00 5.000e+00 6.000e+00 " << std::endl + << "" << std::endl + << "--------------------------------------------------J = 1" << std::endl + << "4.000e+00 5.000e+00 6.000e+00 7.000e+00 " << std::endl + << "" << std::endl + << "--------------------------------------------------J = 2" << std::endl + << "5.000e+00 6.000e+00 7.000e+00 8.000e+00 " << std::endl + << "" << std::endl + << "--------------------------------------------------J = 3" << std::endl + << "6.000e+00 7.000e+00 8.000e+00 9.000e+00 " << std::endl + << "" << std::endl + << "" << std::endl + << "--------setFormat(1,8)-------" << std::endl + << "" << std::endl + << "--------fp3(B3)-------" << std::endl + << "~~~~~~~~ field slice (0:3:1, 0:3:1, 0:3:1) ~~~~~~~~" << std::endl + << "==================================================K = 0" << std::endl + << "--------------------------------------------------J = 0" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "" << std::endl + << "" << std::endl + << "--------------------------------------------------J = 1" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "" << std::endl + << "" << std::endl + << "--------------------------------------------------J = 2" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "" << std::endl + << "" << std::endl + << "--------------------------------------------------J = 3" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "" << std::endl + << "" << std::endl + << "==================================================K = 1" << std::endl + << "--------------------------------------------------J = 0" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "" << std::endl + << "" << std::endl + << "--------------------------------------------------J = 1" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "" << std::endl + << "" << std::endl + << "--------------------------------------------------J = 2" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "" << std::endl + << "" << std::endl + << "--------------------------------------------------J = 3" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "" << std::endl + << "" << std::endl + << "==================================================K = 2" << std::endl + << "--------------------------------------------------J = 0" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "" << std::endl + << "" << std::endl + << "--------------------------------------------------J = 1" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "" << std::endl + << "" << std::endl + << "--------------------------------------------------J = 2" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "" << std::endl + << "" << std::endl + << "--------------------------------------------------J = 3" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "" << std::endl + << "" << std::endl + << "==================================================K = 3" << std::endl + << "--------------------------------------------------J = 0" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "" << std::endl + << "" << std::endl + << "--------------------------------------------------J = 1" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "" << std::endl + << "" << std::endl + << "--------------------------------------------------J = 2" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "" << std::endl + << "" << std::endl + << "--------------------------------------------------J = 3" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "( 1.00000000e+00 , 2.00000000e+00 , 3.00000000e+00 )" << std::endl + << "" << std::endl + << "" << std::endl; + of.close(); + } +} \ No newline at end of file diff --git a/tests/ippl_src/Index/CMakeLists.txt b/tests/ippl_src/Index/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..4f0994e80dc491a124169da27871b0c845e2fe13 --- /dev/null +++ b/tests/ippl_src/Index/CMakeLists.txt @@ -0,0 +1,17 @@ +set (_SRCS + Index.cpp +) + +include_directories ( + ${CMAKE_CURRENT_SOURCE_DIR} +) + +add_sources(${_SRCS}) + +# vi: set et ts=4 sw=4 sts=4: + +# Local Variables: +# mode: cmake +# cmake-tab-width: 4 +# indent-tabs-mode: nil +# End: \ No newline at end of file diff --git a/tests/ippl_src/Index/Index.cpp b/tests/ippl_src/Index/Index.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1ebaf07dd75aeeeb18e2383ade28bde9710fda61 --- /dev/null +++ b/tests/ippl_src/Index/Index.cpp @@ -0,0 +1,58 @@ +#include "gtest/gtest.h" + +#include "Index/SOffset.h" + +constexpr unsigned Dim = 2; +constexpr double roundOffError = 1e-10; + +TEST(Index, SOffset) +{ + // testing SOffset creation + SOffset<Dim> A(1, 2); + SOffset<Dim> B(1, 1); + EXPECT_NEAR(A[0],1, roundOffError); + EXPECT_NEAR(A[1],2, roundOffError); + EXPECT_NEAR(B[0],1, roundOffError); + EXPECT_NEAR(B[1],1, roundOffError); + + // testing SOffset [] operator + SOffset<Dim> soLeft; + SOffset<Dim> soRight; + for (unsigned int d=0; d < Dim; d++) { + soLeft[d] = 0; + soRight[d] = (d == 1 ? 1 : 0); + } + EXPECT_NEAR(soLeft[0], 0, roundOffError); + EXPECT_NEAR(soLeft[1], 0, roundOffError); + EXPECT_NEAR(soRight[0], 0, roundOffError); + EXPECT_NEAR(soRight[1], 1, roundOffError); + + // testing SOffset addition, subtraction, and copy constructor + SOffset<Dim> C(A + B); + SOffset<Dim> D(A - B); + EXPECT_NEAR(C[0], 2, roundOffError); + EXPECT_NEAR(C[1], 3, roundOffError); + EXPECT_NEAR(D[0], 0, roundOffError); + EXPECT_NEAR(D[1], 1, roundOffError); + + // testing SOffset +=, -= operators + D += C; + EXPECT_NEAR(D[0], 2, roundOffError); + EXPECT_NEAR(D[1], 4, roundOffError); + C -= D; + EXPECT_NEAR(C[0], 0, roundOffError); + EXPECT_NEAR(C[1], -1, roundOffError); + + // testing SOffset comparisons + EXPECT_TRUE(B < A); + EXPECT_TRUE(B <= A); + EXPECT_TRUE(D > C); + EXPECT_TRUE(D >= C); + EXPECT_TRUE(A != B); + EXPECT_TRUE(B == B); + + // testing containment check + NDIndex<Dim> N1(Index(0,1), Index(0,1)); + EXPECT_TRUE(! A.inside(N1)); + EXPECT_TRUE( B.inside(N1)); +} \ No newline at end of file diff --git a/tests/ippl_src/Meshes/Average.cpp b/tests/ippl_src/Meshes/Average.cpp new file mode 100644 index 0000000000000000000000000000000000000000..5630f3097e502dbb6dbb42aad8fa2c5bf4403253 --- /dev/null +++ b/tests/ippl_src/Meshes/Average.cpp @@ -0,0 +1,96 @@ +// Adapted from TestAverageVC_CV.cpp , Tim Williams 2/6/1997 +// This tests the Average functions in [Uniform]Cartesian class, which do +// weighted averages between Cell and Vertex centered Field's. + +#include "gtest/gtest.h" + +#include "Meshes/UniformCartesian.h" + +// set dimensionality and problem size +const unsigned Dim3 = 3; +const unsigned nx = 4, ny = 4, nz = 4; +constexpr double roundOffError = 1e-10; + +using namespace IPPL; + +TEST(Meshes, Average) +{ + GuardCellSizes<Dim3> gc(1); + Index I(nx); + Index J(ny); + Index K(nz); + FieldLayout<Dim3> layoutVert(I,J,K); + Index Ic(nx-1); + Index Jc(ny-1); + Index Kc(nz-1); + FieldLayout<Dim3> layoutCell(Ic,Jc,Kc); + + // Scalar Field, Cell-Centered + Field<double,Dim3,UniformCartesian<Dim3>,Cell> C(layoutCell,gc); + C = 1.0; + + // Scalar weight Field, Cell-Centered + Field<double,Dim3,UniformCartesian<Dim3>,Cell> wC(layoutCell,gc); + wC = 2.0; + + // Scalar Field, Vert-Centered + Field<double,Dim3,UniformCartesian<Dim3>,Vert> V(layoutVert,gc); + V = 1.0; + + // Scalar weight Field, Vert-Centered + Field<double,Dim3,UniformCartesian<Dim3>,Vert> wV(layoutVert,gc); + wV = 2.0; + + // Field's to hold weighted averages: + Field<double,Dim3,UniformCartesian<Dim3>,Cell> avgToC(layoutCell,gc); + Field<double,Dim3,UniformCartesian<Dim3>,Vert> avgToV(layoutVert,gc); + + // Weighted average from Cell to Vert: + assign(avgToV, Average(C, wC, avgToV)); + + // Weighted average from Vert to Cell: + assign(avgToC, Average(V, wV, avgToC)); + + // Weight from Field<Vektor,Vert> to Field<Vektor,Cell>, using scalar + // weight field wV (Field<double,Vert>) + // Vector Field, Cell-centered + Field<Vektor<double,Dim3>,Dim3,UniformCartesian<Dim3>,Vert> + vV(layoutVert,gc); + Field<Vektor<double,Dim3>,Dim3,UniformCartesian<Dim3>,Cell> + avgToCSW(layoutCell,gc); + Vektor<double,Dim3> ones; + for (unsigned int d=0; d < Dim3; d++) ones(d) = 1.0; + vV = ones; + assign(avgToCSW, Average(vV, wV, avgToCSW)); + + // Check results: + EXPECT_NEAR(sum(avgToV), nx*ny*nz, roundOffError); + EXPECT_NEAR(sum(avgToC), (nx-1)*(ny-1)*(nz-1), roundOffError); + + // Following triggers two IPPL bugs: + // 1) unsigned*Vektor<double,Dim> doesn't work, have to cast the + // unsigned to a double + // 2) sum(Field<Vektor,...>,...>) doesn't work. + // if (sum(avgToCSW) != (nx-1)*(ny-1)*(nz-1)*ones) passed = false; + // WORKAROUND: + Field<Vektor<double,Dim3>,Dim3,UniformCartesian<Dim3>,Cell>::iterator fi; + Vektor<double,Dim3> thesum = 0.0; + Vektor<double,Dim3> globalSum = 0.0; + for (fi = avgToCSW.begin(); fi != avgToCSW.end(); ++fi) thesum += *fi; + // This gets the global sum to every PE's copy when multiprocessing: + globalSum = thesum; + reduce(globalSum, globalSum, OpAddAssign()); + EXPECT_TRUE(globalSum == ((double)(nx-1)*(ny-1)*(nz-1))*ones); + + // Test one of the unweighted (2-argument) Average() functions: + // Average from Field<Vektor,Vert> to Field<Vektor,Cell> + // Vector Field, Cell-centered + Field<Vektor<double,Dim3>,Dim3,UniformCartesian<Dim3>,Vert> + vVu(layoutVert,gc); + Field<Vektor<double,Dim3>,Dim3,UniformCartesian<Dim3>,Cell> + avgToCSu(layoutCell,gc); + vVu = ones; + assign(avgToCSu, Average(vV, avgToCSu)); + // Check results: + EXPECT_TRUE(sum(avgToCSu) == (nx-1)*(ny-1)*(nz-1)); +} \ No newline at end of file diff --git a/tests/ippl_src/Meshes/CMakeLists.txt b/tests/ippl_src/Meshes/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..9aa4faa42b0193d0c635e48716fceb676adaec99 --- /dev/null +++ b/tests/ippl_src/Meshes/CMakeLists.txt @@ -0,0 +1,19 @@ +set (_SRCS + Average.cpp + Cartesian.cpp + CartesianCentering.cpp +) + +include_directories ( + ${CMAKE_CURRENT_SOURCE_DIR} +) + +add_sources(${_SRCS}) + +# vi: set et ts=4 sw=4 sts=4: + +# Local Variables: +# mode: cmake +# cmake-tab-width: 4 +# indent-tabs-mode: nil +# End: \ No newline at end of file diff --git a/tests/ippl_src/Meshes/Cartesian.cpp b/tests/ippl_src/Meshes/Cartesian.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d38740a826b0cd821397237d304e8f53cd7b1d94 --- /dev/null +++ b/tests/ippl_src/Meshes/Cartesian.cpp @@ -0,0 +1,352 @@ +#include "gtest/gtest.h" + +#include "opal_test_utilities/SilenceTest.h" + +#include "Meshes/Cartesian.h" + +#include "FieldLayout/CenteredFieldLayout.h" + +constexpr unsigned int DIM = 3; +constexpr double roundOffError = 1e-10; + +TEST(Meshes, Cartesian) +{ + OpalTestUtilities::SilenceTest silencer; + + const unsigned D = DIM; // Hardwire dimensionality + const unsigned nv = 6; // Hardwire number of vertices in every direction + unsigned vnodes = 4; // Hardwire 4 vnodes + + // Sizes: + unsigned nverts[D], ncells[D]; + unsigned totverts=1, totcells=1; + unsigned int d; + + for (d=0; d<D; d++) { + ncells[d] = nv - 1; + nverts[d] = nv; + totcells *= ncells[d]; + totverts *= nverts[d]; + } + NDIndex<D> verts, cells; + for (d=0; d<D; d++) { + verts[d] = Index(nverts[d]); + cells[d] = Index(ncells[d]); + } + + //--------------------------------------------------------------------------- + // Construct some CenteredFieldLayout's and Field's to be used below: + + // Create cartesian mesh object: + typedef Cartesian<D,double> M; + + double* delX[D]; + + for (d=0; d<D; d++) + delX[d] = new double[nverts[d]]; + + Vektor<double,D> origin; + for (d=0; d<D; d++) + origin(d) = d + 1.0; + + // Assign nonuniform mesh-spacing values to each component (linear ramps): + for (d=0; d<D; d++) { + double multipplier = (d + 1)*1.0; + for (unsigned int vert=0; vert < nverts[d]; vert++) { + (delX[d])[vert] = multipplier*(1 + vert); + } + } + + // Mesh boundary conditions: + MeshBC_E mbc[2*D]; + for (unsigned b=0; b < (2*D); b++) + mbc[b] = Reflective; + + // Test constructing mesh, and then setting spacing, origin, BC's + M mesh(verts); + mesh.set_origin(origin); + mesh.set_meshSpacing(delX); + mesh.set_MeshBC(mbc); + + // Clean up mesh spacing arrays + for (d=0; d<D; d++) + delete [] delX[d]; + + // ada have to cross check Div() fails without this + mesh.storeSpacingFields(); + + // Construct CenteredFieldLayout's using this for Vert and Cell centering: + e_dim_tag edt[D]; + for (d=0; d<D; d++) + edt[d] = PARALLEL; + CenteredFieldLayout<D,M,Cell> cl(mesh, edt, vnodes); + CenteredFieldLayout<D,M,Vert> vl(mesh, edt, vnodes); + + // Use 1 guard layer in all Field's: + GuardCellSizes<D> gc(1); + + // Vectors: + BConds<Vektor<double,D>,D,M,Vert> vvbc; + BConds<Vektor<double,D>,D,M,Cell> vcbc; + + // Scalars: + BConds<double,D,M,Cell> scbc; + + // Symmetric tensors: + BConds<SymTenzor<double,D>,D,M,Cell> stcbc; + + // Tensors: + BConds<Tenzor<double,D>,D,M,Cell> tcbc; + + // Use linear negative reflecting conditions: + for (unsigned int face=0; face<2*D; face++) { + vvbc[face] = new NegReflectFace<Vektor<double,D>,D,M,Vert>(face); + vcbc[face] = new NegReflectFace<Vektor<double,D>,D,M,Cell>(face); + scbc[face] = new NegReflectFace<double,D,M,Cell>(face); + stcbc[face] = new NegReflectFace<SymTenzor<double,D>,D,M,Cell>(face); + tcbc[face] = new NegReflectFace<Tenzor<double,D>,D,M,Cell>(face); + } + + // Now use all this to construct some Field's: + Field<Vektor<double,D>,D,M,Vert> vectorVert(mesh, vl, gc, vvbc); + Field<Vektor<double,D>,D,M,Cell> vectorCell(mesh, cl, gc, vcbc); + Field<SymTenzor<double,D>,D,M,Cell> symtCell(mesh, cl, gc, stcbc); + Field<Tenzor<double,D>,D,M,Cell> tensorCell(mesh, cl, gc, tcbc); + Field<double,D,M,Cell> scalarCell(mesh, cl, gc, scbc); + + //--------------------------------------------------------------------------- + + //--------------------------------------------------------------------------- + // Try out Divergence Vektor/Vert -> Scalar/Cell: + // Assign values into the vert-centered Field<Vektor>: + assign(vectorVert, mesh.getVertexPositionField(vectorVert)); + scalarCell = Div(vectorVert, scalarCell); + // The value should be 3.0 for all elements; test this: + EXPECT_NEAR(abs(sum(scalarCell)/totcells), 1.0*D, roundOffError); + //--------------------------------------------------------------------------- + + // -------------------------------------------------------------------------- + // Try out Gradient Scalar/Cell -> Vektor/Vert: + + // Use mesh object and vectorVert and scalarCell Field's constructed above. + vectorCell = mesh.getCellPositionField(vectorCell); + vectorCell -= mesh.get_origin(); + // Assign positive-sloping linear ramp values into the cell-centered + // Field<scalar>: + scalarCell = 0.0; + for (d=0; d<D; d++) scalarCell[cells] += vectorCell[cells](d); + // Now take the gradient: + vectorVert = Grad(scalarCell, vectorVert); + // The value should be (1.0,1.0,1.0) for all elements one at least one + // removed from the last-physical-layer elements. Last-physical-layer + // elements will be different because the BC available in IPPL don't really + // do the kind of linear extrapolation appropriate for the needs here: + Vektor<double,D> unit; for (d=0; d<D; d++) unit[d] = 1.0; + Vektor<double,D> sumVectorVert; + // Use temporary, smaller BareField as a reduced-by-two vector Field to hold + // only the boundary-exclusive elements (needed because of limitations of + // IPPL reductions ops): + NDIndex<D> bev; + for (d=0; d<D; d++) bev[d] = Index(1,nverts[d]-2,1); + FieldLayout<D> templayout(bev); + BareField<Vektor<double,D>,D> temp(templayout); + temp[bev] = vectorVert[bev]; + sumVectorVert = sum(temp); + unsigned totred=1; for (d=0; d<D; d++) totred *= nverts[d] - 2; + sumVectorVert /= totred; + Vektor<double,D> diffVectorVert; + diffVectorVert = sumVectorVert - unit; + double magDiffVectorVert = 0.0; + for (d=0; d<D; d++) magDiffVectorVert += diffVectorVert(d)*diffVectorVert(d); + magDiffVectorVert = sqrt(magDiffVectorVert); + EXPECT_NEAR(abs(magDiffVectorVert), 0, roundOffError); + //--------------------------------------------------------------------------- + + // -------------------------------------------------------------------------- + // Try out Gradient Scalar/Cell -> Vektor/Cell: + + // Use mesh object and vectorVert and scalarCell Field's constructed above. + vectorCell = mesh.getCellPositionField(vectorCell); + vectorCell -= mesh.get_origin(); + // Assign positive-sloping linear ramp values into the cell-centered + // Field<scalar>: + scalarCell = 0.0; + for (d=0; d<D; d++) scalarCell[cells] += vectorCell[cells](d); + // Now take the gradient: + vectorCell = Grad(scalarCell, vectorCell); + // The value should be (1.0,1.0,1.0) for all elements one at least one + // removed from the last-physical-layer elements. Last-physical-layer + // elements will be different because the BC available in IPPL don't really + // do the kind of linear extrapolation appropriate for the needs here: + for (d=0; d<D; d++) unit[d] = 1.0; + Vektor<double,D> sumVectorCell; + // Use temporary, smaller BareField as a reduced-by-two vector Field to hold + // only the boundary-exclusive elements (needed because of limitations of + // IPPL reductions ops): + NDIndex<D> bec; + for (d=0; d<D; d++) bec[d] = Index(1,ncells[d]-2,1); + FieldLayout<D> templayout2(bec); + BareField<Vektor<double,D>,D> temp2(templayout); + temp2[bec] = vectorCell[bec]; + sumVectorCell = sum(temp2); + unsigned totredc=1; for (d=0; d<D; d++) totredc *= ncells[d] - 2; + sumVectorCell /= totredc; + Vektor<double,D> diffVectorCell; + diffVectorCell = sumVectorCell - unit; + double magDiffVectorCell = 0.0; + for (d=0; d<D; d++) magDiffVectorCell += diffVectorCell(d)*diffVectorCell(d); + magDiffVectorCell = sqrt(magDiffVectorCell); + EXPECT_NEAR(abs(magDiffVectorCell), 0, roundOffError); + //--------------------------------------------------------------------------- + + //--------------------------------------------------------------------------- + // Try out Divergence SymTenzor/Cell -> Vektor/Vert: + + // Use CenteredFieldLayout's from above object to construct SymTenzor Field: + // Assign values into the cell-centered Field<SymTenzor>; use values from + // cell-centered scalar Field scalarCell set up above: + SymTenzor<double,D> unitSymTenzor = 1.0; + symtCell = unitSymTenzor*scalarCell; + // Now take the divergence: + vectorVert = Div(symtCell, vectorVert); + // The value should be (D,D,D,....) for all elements; test this: + // Use temporary, smaller BareField as a reduced-by-two symtensor Field to + // hold only the boundary-exclusive elements (needed because of limitations + // of IPPL reductions ops): + temp[bev] = vectorVert[bev]; + sumVectorVert = sum(temp); + sumVectorVert /= totred; + Vektor<double,D> deesVector; for (d=0; d<D; d++) deesVector(d) = 1.0*D; + diffVectorVert = sumVectorVert - deesVector; + magDiffVectorVert = 0.0; + for (d=0; d<D; d++) magDiffVectorVert += diffVectorVert(d)*diffVectorVert(d); + magDiffVectorVert = sqrt(magDiffVectorVert); + EXPECT_NEAR(abs(magDiffVectorCell), 0, roundOffError); + //--------------------------------------------------------------------------- + + // -------------------------------------------------------------------------- + // Try out Gradient Vektor/Vert -> Tenzor/Cell: + + // Set up input values in Vektor/Vert field: + vectorVert = mesh.getVertexPositionField(vectorVert); + // Now take the gradient: + tensorCell = Grad(vectorVert, tensorCell); + // Since this is the gradient of the position vector (x*x_hat + y* y_hat + + // z*z_hat), the result should be the identity tensor (NRL Plasma Formulary + // Vector Identities section): + Tenzor<double,D> identityTensor = 0.0; + for (d=0; d<D; d++) identityTensor(d,d) = 1.0; + Tenzor<double,D> sumTensorCell = sum(tensorCell); + sumTensorCell /= totcells; + Tenzor<double,D> diffTensorCell; + diffTensorCell = sumTensorCell - identityTensor; + double magDiffTensorCell = 0.0; + for (d=0; d<D; d++) { + for (unsigned int d2=0; d2<D; d2++) { + magDiffTensorCell += diffTensorCell(d,d2)*diffTensorCell(d,d2); + } + } + EXPECT_NEAR(abs(magDiffVectorCell), 0, roundOffError); + //--------------------------------------------------------------------------- + + //--------------------------------------------------------------------------- + + /* THIS TEST DOES NOT COMPILE + + // Test Average() functions: + // Scalar Field, Cell-Centered + Field<double,D,Cartesian<D>,Cell> C(mesh, cl, gc); + C = 1.0; + // Scalar weight Field, Cell-Centered + Field<double,D,Cartesian<D>,Cell> wC(mesh, cl, gc); + wC = 2.0; + // Scalar Field, Vert-Centered + Field<double,D,Cartesian<D>,Vert> V(mesh, vl, gc); + V = 1.0; + // Scalar weight Field, Vert-Centered + Field<double,D,Cartesian<D>,Vert> wV(mesh, vl, gc); + wV = 2.0; + // Field's to hold weighted averages: + Field<double,D,Cartesian<D>,Cell> avgToC(mesh, cl, gc); + Field<double,D,Cartesian<D>,Vert> avgToV(mesh, vl, gc); + + assign(avgToV, Average(C, wC, avgToV)); + assign(avgToC, Average(V, wV, avgToC)); + + // Weighted average from Cell to Vert: + // ada does not work assign(avgToV, Average(C, wC, avgToV)); + // Weighted average from Vert to Cell: + // ada dones not work assign(avgToC, Average(V, wV, avgToC)); + // Check results: + if (sum(avgToV) != totverts) { + testmsg << "avgToV values wrong" << endl; + testmsg << "sum(avgToV) = " << sum(avgToV) << " ; totverts = " << totverts + << endl; + // passed = false; + } + if (sum(avgToC) != totcells) { + testmsg << "avgToC values wrong" << endl; + testmsg << "sum(avgToC) = " << sum(avgToC) << " ; totcells = " << totcells + << endl; + // passed = false; + } + + */ + + //--------------------------------------------------------------------------- + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + //--------------------------------------------------------------------------- + // Some accessor function tests: + double theVolume, theVolume2, theVolume3; + NDIndex<D> ndi; + ndi[0] = Index(2,2,1); + ndi[1] = Index(2,2,1); + ndi[2] = Index(2,2,1); + theVolume = mesh.getCellVolume(ndi); + ndi[0] = Index(0,2,1); + ndi[1] = Index(0,2,1); + ndi[2] = Index(0,2,1); + theVolume2 = mesh.getCellRangeVolume(ndi); + EXPECT_NEAR(theVolume2, (6.0*12.0*18.0), roundOffError); + + ndi[0] = Index(0,3,1); + ndi[1] = Index(0,3,1); + ndi[2] = Index(0,3,1); + theVolume3 = mesh.getVertRangeVolume(ndi); + EXPECT_NEAR(theVolume3, theVolume2, roundOffError); + //--------------------------------------------------------------------------- + Field<double,D,Cartesian<D>,Cell> theVolumes(mesh, cl); + mesh.getCellVolumeField(theVolumes); + EXPECT_NEAR((sum(theVolumes)/totcells), theVolume, roundOffError); + //--------------------------------------------------------------------------- + Vektor<double,D> v; + v(0) = 1.5; v(1) = 4.5; v(2) = 9.5; + ndi = mesh.getNearestVertex(v); + // nearest vertex should be (1,1,1) + for (unsigned int i=0; i<D; i++) { + EXPECT_EQ((int)ndi[0].first(), 1); + EXPECT_EQ((int)ndi[0].length(), 1); + } + //--------------------------------------------------------------------------- + Vektor<double,D> v1; + v1 = mesh.getVertexPosition(ndi); + v(0) = 2.0; v(1) = 4.0; v(2) = 12.0; // Correct value + for (unsigned int i=0; i<D; i++) { + EXPECT_NEAR(v1(i), v(i), roundOffError); + } + //--------------------------------------------------------------------------- + CenteredFieldLayout<D,Cartesian<D>,Vert> + clVert(mesh); + Field<Vektor<double,D>,D,Cartesian<D>,Vert> + thePositions(clVert); + mesh.getVertexPositionField(thePositions); + //--------------------------------------------------------------------------- + v = mesh.getDeltaVertex(ndi); + Vektor<double,D> vcorrect; + vcorrect(0) = 2.0; vcorrect(1) = 4.0; vcorrect(2) = 9.0; + for (unsigned int i=0; i<D; i++) { + EXPECT_NEAR(vcorrect(i), v(i), roundOffError); + } +} \ No newline at end of file diff --git a/tests/ippl_src/Meshes/CartesianCentering.cpp b/tests/ippl_src/Meshes/CartesianCentering.cpp new file mode 100644 index 0000000000000000000000000000000000000000..85adb3570ade503460decaa41723bc07cd894adc --- /dev/null +++ b/tests/ippl_src/Meshes/CartesianCentering.cpp @@ -0,0 +1,147 @@ +#include "gtest/gtest.h" + +#include "opal_test_utilities/SilenceTest.h" + +#include "AppTypes/Vektor.h" +#include "Field/Field.h" +#include "FieldLayout/CenteredFieldLayout.h" +#include "Meshes/CartesianCentering.h" +#include "Meshes/UniformCartesian.h" + +#include <fstream> + +// forward declarations +namespace { + void hardCodedOutput(char* filename); // Prototype of function defined below. + bool thediff(char* filename1, char* filename2); + + extern const CenteringEnum zz[2] = {CELL, VERTEX}; +} + +// template definitions +CenteringEnum CCCEnums<2U,1U,0U>::allCell[2U*1U]; +CenteringEnum CCCEnums<3U,1U,1U>::allFace[3U*1U]; +CenteringEnum CCCEnums<3U,3U,0U>::allVertex[3U*3U]; +CenteringEnum CCCEnums<3U,3U,0U>::vectorFace[3U*3U]; + +TEST(Meshes, CartesianCentering) +{ + // For writing file output to compare against hardcoded correct file output: + Inform fdi(NULL,"text.test.TestCartesianCentering",Inform::OVERWRITE,0); + + const unsigned nx=4, ny=4, nz=4; + Index I(nx), J(ny), K(nz); + + const unsigned ND3 = 3; + typedef UniformCartesian<ND3> M3; + M3 m3(I,J,K); + + const unsigned ND2 = 2; + typedef UniformCartesian<ND2> M2; + M2 m2(I,J); + + typedef CommonCartesianCenterings<ND2,1U>::allCell CA; + CenteredFieldLayout<ND2,M2,CA> clA(m2); + Field<double, ND2, M2, CA > A(clA); + A.print_Centerings(fdi.getStream()); + + typedef CartesianCentering<zz,ND2,1U> CB; + CenteredFieldLayout<ND2,M2,CB> clB(m2); + Field<double, ND2, M2, CB > B(clB); + B.print_Centerings(fdi.getStream()); + + typedef CommonCartesianCenterings<ND3,1U,1U>::allFace CC; + CenteredFieldLayout<ND3,M3,CC> clC(m3); + Field<double, ND3, M3, CC> C(clC); + C.print_Centerings(fdi.getStream()); + + typedef CommonCartesianCenterings<ND3,3U>::allVertex CD; + CenteredFieldLayout<ND3,M3,CD> clD(m3); + Field<Vektor<double,ND3>, ND3, M3, CD> D(clD); + D.print_Centerings(fdi.getStream()); + + typedef CommonCartesianCenterings<ND3,3U>::vectorFace CE; + CenteredFieldLayout<ND3,M3,CE> clE(m3); + Field<Vektor<double,ND3>, ND3, M3, CE> E(clE); + E.print_Centerings(fdi.getStream()); + + fdi << endl ; // Needed to flush output to file + + // Write out "by hand" into another file what the previous field-printing + // functions should have produced; this will be compared with what they + // actually did produce: + hardCodedOutput("text.correct.TestCartesianCentering"); + + // Compare the two files by mocking up the Unix "diff" command: + bool passed = thediff("text.test.TestCartesianCentering", + "text.correct.TestCartesianCentering"); + + EXPECT_TRUE(passed); +} + +namespace { + +//----------------------------------------------------------------------------- +// Mock up the Unix "diff" utility to compare two files: +//----------------------------------------------------------------------------- +bool thediff(char* filename1, char* filename2) +{ + bool same = true; + char ch1, ch2; + std::ifstream file1(filename1); + std::ifstream file2(filename2); + while (file1.get(ch1)) { // Read file 1 char-by-char until eof + if (file2.get(ch2)) { // Read equivalent char from file 2 + if (ch1 != ch2) same = false; // If they're different,files are different + } + else { + same = false; // If file 2 ends before file 1, different + } + } + return same; +} + +//----------------------------------------------------------------------------- +void hardCodedOutput(char* filename) +{ + std::ofstream of(filename); + of << "CartesianCentering: no specialized name (yet) for this case" << std::endl + << "Dim = 2 ; NComponents = 1" << std::endl + << "centering[dim=0][component=0] = CELL " << std::endl + << "centering[dim=1][component=0] = CELL " << std::endl + << "CartesianCentering: no specialized name (yet) for this case" << std::endl + << "Dim = 2 ; NComponents = 1" << std::endl + << "centering[dim=0][component=0] = CELL " << std::endl + << "centering[dim=1][component=0] = VERTEX" << std::endl + << "CartesianCentering: no specialized name (yet) for this case" << std::endl + << "Dim = 3 ; NComponents = 1" << std::endl + << "centering[dim=0][component=0] = CELL " << std::endl + << "centering[dim=1][component=0] = CELL " << std::endl + << "centering[dim=2][component=0] = CELL " << std::endl + << "CartesianCentering: no specialized name (yet) for this case" << std::endl + << "Dim = 3 ; NComponents = 3" << std::endl + << "centering[dim=0][component=0] = CELL " << std::endl + << "centering[dim=0][component=1] = CELL " << std::endl + << "centering[dim=0][component=2] = CELL " << std::endl + << "centering[dim=1][component=0] = CELL " << std::endl + << "centering[dim=1][component=1] = CELL " << std::endl + << "centering[dim=1][component=2] = CELL " << std::endl + << "centering[dim=2][component=0] = CELL " << std::endl + << "centering[dim=2][component=1] = CELL " << std::endl + << "centering[dim=2][component=2] = CELL " << std::endl + << "CartesianCentering: no specialized name (yet) for this case" << std::endl + << "Dim = 3 ; NComponents = 3" << std::endl + << "centering[dim=0][component=0] = CELL " << std::endl + << "centering[dim=0][component=1] = CELL " << std::endl + << "centering[dim=0][component=2] = CELL " << std::endl + << "centering[dim=1][component=0] = CELL " << std::endl + << "centering[dim=1][component=1] = CELL " << std::endl + << "centering[dim=1][component=2] = CELL " << std::endl + << "centering[dim=2][component=0] = CELL " << std::endl + << "centering[dim=2][component=1] = CELL " << std::endl + << "centering[dim=2][component=2] = CELL " << std::endl + << std::endl; + of.close(); + return; +} +} \ No newline at end of file diff --git a/tests/ippl_src/Particle/CMakeLists.txt b/tests/ippl_src/Particle/CMakeLists.txt index 75d31c5cda575aa119773b28bddf62ecf9bbd9b0..3700809fa94a85c153f297dc2433bbd1c968614e 100644 --- a/tests/ippl_src/Particle/CMakeLists.txt +++ b/tests/ippl_src/Particle/CMakeLists.txt @@ -9,9 +9,9 @@ include_directories ( add_sources(${_SRCS}) # vi: set et ts=4 sw=4 sts=4: - + # Local Variables: # mode: cmake # cmake-tab-width: 4 # indent-tabs-mode: nil -# End: +# End: \ No newline at end of file