Commit db74ba92 authored by snuverink_j's avatar snuverink_j
Browse files

Merge branch '291-review-ippl-test-directory' into 'master'

Resolve "Review ippl/test directory"

See merge request !264
parents 34e661fd 68cfca2f
......@@ -2,9 +2,6 @@
/***************************************************************************
*
* The IPPL Framework
*
*
* Visit http://people.web.psi.ch/adelmann/ for more details
*
***************************************************************************/
......@@ -33,8 +30,8 @@ public:
// constructor: user-provided Layout object must be supplied
GenArrayParticle(PLayout* L) : IpplParticleBase<PLayout>(L) {
for (int i = 0; i < N; i++)
addAttribute(data[i]);
for (unsigned int i = 0; i < N; i++)
this->addAttribute(data[i]);
}
private:
......@@ -43,10 +40,4 @@ private:
};
#endif // GEN_ARRAY_PARTICLE_H
/***************************************************************************
* $RCSfile: GenArrayParticle.h,v $ $Author: adelmann $
* $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:28 $
* IPPL_VERSION_ID: $Id: GenArrayParticle.h,v 1.1.1.1 2003/01/23 07:40:28 adelmann Exp $
***************************************************************************/
#endif // GEN_ARRAY_PARTICLE_H
\ No newline at end of file
......@@ -86,16 +86,16 @@ public:
}
//loop over all buckets
for (unsigned bx=0; bx<buckets_per_dim[0]; ++bx) {
for (unsigned by=0; by<buckets_per_dim[1]; ++by) {
for (unsigned bz=0; bz<buckets_per_dim[2]; ++bz) {
for (int bx=0; bx<buckets_per_dim[0]; ++bx) {
for (int by=0; by<buckets_per_dim[1]; ++by) {
for (int bz=0; bz<buckets_per_dim[2]; ++bz) {
//dmsg << "bx = " << bx << "by = " << by << " bz = " << bz <<endl;
unsigned bucket_id_self = bz*buckets_per_dim[1]*buckets_per_dim[0]+by*buckets_per_dim[0]+bx;
//compute index of neighboring cell to interact with
for (int n=0; n<neigh;++n){
unsigned bx_neigh = bx+offset[n][0];
unsigned by_neigh = by+offset[n][1];
unsigned bz_neigh = bz+offset[n][2];
int bx_neigh = bx+offset[n][0];
int by_neigh = by+offset[n][1];
int bz_neigh = bz+offset[n][2];
//check if neighbor cell is within boundaries
//dmsg << " looking at neighbor n = " << n << endl;
if (bx_neigh >= 0 && bx_neigh<buckets_per_dim[0] &&
......
......@@ -91,7 +91,7 @@ void FieldDebugPrint<T,Dim>::print(BareField<T,Dim>& F,
// check that the view is contained inside of the Field's domain
if(!domain.contains(view)) {
ERRORMSG("FieldPrint::print - the domain of the field: " << domain<<endl);
ERRORMSG("FieldDebugPrint::print - the domain of the field: " << domain<<endl);
ERRORMSG(" must contain the selected view: " << view << endl);
return;
}
......
......@@ -12,7 +12,6 @@ link_directories (
${CMAKE_SOURCE_DIR}/src
)
add_compile_options (-std=c++11)
set (COMPILE_FLAGS ${OPAL_CXX_FLAGS})
set (IPPL_LIBS ippl)
......
file (RELATIVE_PATH _relPath "${CMAKE_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}")
message (STATUS "Only found stub of CMakeList.txt in ${_relPath}")
message (STATUS "Adding test t3 found in ${_relPath}")
include_directories (
${CMAKE_SOURCE_DIR}/ippl/src
)
link_directories (
${CMAKE_CURRENT_SOURCE_DIR}
)
set (IPPL_LIBS ippl)
set (COMPILE_FLAGS ${OPAL_CXX_FLAGS})
if (ENABLE_DKS)
include_directories (${DKS_INCLUDE_DIR})
link_directories (${DKS_LIBRARY_DIR})
SET (IPPL_LIBS ${IPPL_LIBS} ${DKS_LIBRARY_DIR}/libdks.a)
endif ()
add_executable (t3 t3.cpp)
target_link_libraries (
t3
${IPPL_LIBS}
${MPI_CXX_LIBRARIES}
boost_timer
)
# 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
file (RELATIVE_PATH _relPath "${CMAKE_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}")
message (STATUS "Only found stub of CMakeList.txt in ${_relPath}")
message (STATUS "Adding parallel tests found in ${_relPath}")
include_directories (
${CMAKE_SOURCE_DIR}/ippl/src
)
link_directories (
${CMAKE_CURRENT_SOURCE_DIR}
)
set (IPPL_LIBS ippl)
set (COMPILE_FLAGS ${OPAL_CXX_FLAGS})
if (ENABLE_DKS)
include_directories (${DKS_INCLUDE_DIR})
link_directories (${DKS_LIBRARY_DIR})
SET (IPPL_LIBS ${IPPL_LIBS} ${DKS_LIBRARY_DIR}/libdks.a)
endif ()
add_executable (2ddens 2ddens.cpp)
target_link_libraries (
2ddens
${IPPL_LIBS}
${MPI_CXX_LIBRARIES}
boost_timer
)
add_executable (dualmpi dualmpi.cpp)
target_link_libraries (
dualmpi
${IPPL_LIBS}
${MPI_CXX_LIBRARIES}
boost_timer
)
add_executable (reduce-1 reduce-1.cpp)
target_link_libraries (
reduce-1
${IPPL_LIBS}
${MPI_CXX_LIBRARIES}
boost_timer
)
add_executable (reduce-2 reduce-2.cpp)
target_link_libraries (
reduce-2
${IPPL_LIBS}
${MPI_CXX_LIBRARIES}
boost_timer
)
add_executable (volley volley.cpp)
target_link_libraries (
volley
${IPPL_LIBS}
${MPI_CXX_LIBRARIES}
boost_timer
)
# 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
......@@ -12,7 +12,7 @@
*
***************************************************************************/
***************************************************************************
/***************************************************************************
*
* A simple test program to test using IPPL with another MPI user.
*
......
file (RELATIVE_PATH _relPath "${CMAKE_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}")
message (STATUS "Adding test particle found in ${_relPath}")
message (STATUS "Adding particle tests found in ${_relPath}")
include_directories (
${CMAKE_SOURCE_DIR}/src
......@@ -14,9 +14,6 @@ link_directories (
${CMAKE_SOURCE_DIR}/src
)
add_compile_options (-std=c++11)
add_definitions (-DPARALLEL_IO)
set (IPPL_LIBS ippl)
set (COMPILE_FLAGS ${OPAL_CXX_FLAGS})
......@@ -85,15 +82,20 @@ target_link_libraries (
boost_timer
)
add_executable (test-scatter-1 test-scatter-1.cpp)
target_link_libraries (test-scatter-1 ${IPPL_LIBS} ${MPI_CXX_LIBRARIES} boost_timer)
add_executable (salman-1 salman-1.cpp)
target_link_libraries (salman-1 ${IPPL_LIBS} ${MPI_CXX_LIBRARIES} boost_timer)
add_executable (chsr-1 chsr-1.cpp)
target_link_libraries (chsr-1 ${IPPL_LIBS} ${MPI_CXX_LIBRARIES} boost_timer)
add_executable (chsr-2 chsr-2.cpp)
target_link_libraries (chsr-2 ${IPPL_LIBS} ${MPI_CXX_LIBRARIES} boost_timer)
add_executable (pbconds3D pbconds3D.cpp)
target_link_libraries (pbconds3D ${IPPL_LIBS} ${MPI_CXX_LIBRARIES} boost_timer)
add_executable (salman-1 salman-1.cpp)
target_link_libraries (salman-1 ${IPPL_LIBS} ${MPI_CXX_LIBRARIES} boost_timer)
add_executable (test-scatter-1 test-scatter-1.cpp)
target_link_libraries (test-scatter-1 ${IPPL_LIBS} ${MPI_CXX_LIBRARIES} boost_timer)
# vi: set et ts=4 sw=4 sts=4:
......
......@@ -2,8 +2,8 @@
/***************************************************************************
*
* The IPPL Framework
*
* This program was prepared by PSI.
*
* 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
......@@ -32,8 +32,8 @@ typedef ParticleSpatialLayout<Real,Dim> playout_t;
int main(int argc, char *argv[])
{
int i, j;
unsigned int i, j;
Ippl ippl(argc, argv);
Inform testmsg(argv[0]);
......@@ -59,7 +59,7 @@ int main(int argc, char *argv[])
testmsg << "Start of initialization ..." << endl;
if (P.singleInitNode()) {
P.create(20); // makes new particles at end of current array
P.create(20); // makes new particles at end of current array
// put ten particles near right edge, and ten near left edge
for (j=0; j < 10; j++) { // initialize new values
P.R[j] = Vektor<Real,Dim>(5, j * 10,j * 10);
......@@ -87,13 +87,13 @@ int main(int argc, char *argv[])
}
//
// test 1:
// test 1:
// add offset to R positions, moving particles beyond the border
// bconds: all open
//
testmsg << "Testing open boundary conditions ... moving by (5,-1,10):" << endl;
for (int i=0; i < 2*Dim; ++i)
for (i=0; i < 2*Dim; ++i)
P.getBConds()[i] = ParticleNoBCond;
Vektor<Real,Dim> offset1(5,-1,10);
......@@ -107,7 +107,7 @@ int main(int argc, char *argv[])
}
//
// test 2:
// test 2:
// add offset to X Y & Z positions
// BC: open X, Y
// periodc Z
......@@ -116,7 +116,7 @@ int main(int argc, char *argv[])
testmsg << endl;
P.getBConds()[4] = ParticlePeriodicBCond;
P.getBConds()[5] = ParticlePeriodicBCond;
Vektor<Real,Dim> offset2(5,-1,10);
assign(P.R, P.R + offset2);
P.update();
......@@ -128,10 +128,4 @@ int main(int argc, char *argv[])
}
testmsg << "Particle test: Spatial layout: End." << endl;
return 0;
}
/***************************************************************************
* $RCSfile: pbconds3D.cpp,v $ $Author: adelmann $
* $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:38 $
* IPPL_VERSION_ID: $Id: pbconds3D.cpp,v 1.1.1.1 2003/01/23 07:40:38 adelmann Exp $
***************************************************************************/
}
\ No newline at end of file
......@@ -106,7 +106,6 @@ TEST(Field, BC)
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++;
......@@ -154,9 +153,6 @@ TEST(Field, BC)
// 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);
......@@ -246,7 +242,6 @@ TEST(Field, BC)
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++;
......@@ -281,7 +276,6 @@ TEST(Field, BC)
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++;
......
......@@ -213,7 +213,6 @@ TEST(Field, Compressed)
}
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;
......@@ -224,7 +223,7 @@ TEST(Field, Compressed)
if ( (*lf).second->IsCompressed() )
++count;
}
reduced_count = 0;
int reduced_count = 0;
reduce(&count,&count+1,&reduced_count,OpAddAssign());
EXPECT_EQ(reduced_count, 3);
}
......@@ -254,7 +253,7 @@ TEST(Field, Compressed)
if ( (*lf).second->IsCompressed() )
++count;
}
reduced_count = 0;
int reduced_count = 0;
reduce(&count,&count+1,&reduced_count,OpAddAssign());
if (Ippl::deferGuardCellFills) {
EXPECT_EQ(reduced_count,3);
......@@ -282,7 +281,7 @@ TEST(Field, Compressed)
if ( (*lf).second->IsCompressed() )
++count;
}
reduced_count = 0;
int reduced_count = 0;
reduce(&count,&count+1,&reduced_count,OpAddAssign());
if (Ippl::deferGuardCellFills) {
EXPECT_EQ(reduced_count,3);
......@@ -314,7 +313,7 @@ TEST(Field, Compressed)
if ( (*lb).second->IsCompressed() )
++count;
}
reduced_count = 0;
int reduced_count = 0;
reduce(&count,&count+1,&reduced_count,OpAddAssign());
EXPECT_EQ(reduced_count, 3);
}
......@@ -535,9 +534,6 @@ 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);
......
......@@ -85,11 +85,8 @@ TEST(Meshes, Average)
// 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));
......
......@@ -19,7 +19,7 @@ TEST(Meshes, Cartesian)
// Sizes:
unsigned nverts[D], ncells[D];
unsigned totverts=1, totcells=1;
unsigned totverts, totcells=1;
unsigned int d;
for (d=0; d<D; d++) {
......@@ -246,7 +246,7 @@ TEST(Meshes, Cartesian)
magDiffTensorCell += diffTensorCell(d,d2)*diffTensorCell(d,d2);
}
}
EXPECT_NEAR(abs(magDiffVectorCell), 0, roundOffError);
EXPECT_NEAR(abs(magDiffTensorCell), 0, roundOffError);
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
......
......@@ -4,7 +4,6 @@
// #include "Algorithms/PartData.h"
#include "Particle/IntCIC.h"
#include "Particle/ParticleSpatialLayout.h"
#include "Particle/ParticleUniformLayout.h"
#include "Particle/ParticleAttrib.h"
#include "Meshes/UniformCartesian.h"
#include "Meshes/Centering.h"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment