Commit 7857bce3 authored by incardon's avatar incardon

Release 0.9.0

parent 6aed688c
......@@ -20,8 +20,10 @@ All notable changes to this project will be documented in this file.
- In case of miss compilation ignore system wide installation
- Bug in VTK writer binary in case of vectors
- Bug in VTK writer binary: long int are not supported removing output
- Bug in the constructor with stencil bigger than one
### Changed
- CellList types has changed
## [0.8.0] 28 February 2016
......
......@@ -10,10 +10,10 @@
* This example show the usage of periodic grid with ghost part given in grid units to solve
* the following system of equations
*
* \f$\frac{\partial u}{\partial t} = D_u \nabla u -uv^2 + F(1-u)\f$
* \f$\frac{\partial u}{\partial t} = D_u \nabla u - uv^2 + F(1-u)\f$
*
*
* \f$\frac{\partial v}{\partial t} = D_v \nabla v -uv^2 - (F + k)v\f$
* \f$\frac{\partial v}{\partial t} = D_v \nabla v + uv^2 - (F + k)v\f$
*
* ## Constants and functions ##
*
......@@ -201,7 +201,7 @@ int main(int argc, char* argv[])
grid_dist_id<2, double, aggregate<double,double>> Old(sz,domain,g,bc);
// New grid with the decomposition of the old grid
grid_dist_id<2, double, aggregate<double,double>> New(Old.getDecomposition(),sz,domain,g);
grid_dist_id<2, double, aggregate<double,double>> New(Old.getDecomposition(),sz,g);
// spacing of the grid on x and y
......
......@@ -46,8 +46,16 @@ void init(grid_dist_id<3,double,aggregate<double,double> > & Old, grid_dist_id<3
++it;
}
grid_key_dx<3> start({(long int)std::floor(Old.size(0)*1.55f/domain.getHigh(0)),(long int)std::floor(Old.size(1)*1.55f/domain.getHigh(1)),(long int)std::floor(Old.size(1)*1.55f/domain.getHigh(2))});
grid_key_dx<3> stop ({(long int)std::ceil (Old.size(0)*1.85f/domain.getHigh(0)),(long int)std::ceil (Old.size(1)*1.85f/domain.getHigh(1)),(long int)std::floor(Old.size(1)*1.85f/domain.getHigh(1))});
long int x_start = Old.size(0)*1.55f/domain.getHigh(0);
long int y_start = Old.size(1)*1.55f/domain.getHigh(1);
long int z_start = Old.size(1)*1.55f/domain.getHigh(2);
long int x_stop = Old.size(0)*1.85f/domain.getHigh(0);
long int y_stop = Old.size(1)*1.85f/domain.getHigh(1);
long int z_stop = Old.size(1)*1.85f/domain.getHigh(2);
grid_key_dx<3> start({x_start,y_start,z_start});
grid_key_dx<3> stop ({x_stop,y_stop,z_stop});
auto it_init = Old.getSubDomainIterator(start,stop);
while (it_init.isNext())
......@@ -72,7 +80,7 @@ int main(int argc, char* argv[])
Box<3,double> domain({0.0,0.0},{2.5,2.5,2.5});
// grid size
size_t sz[3] = {128,128,128};
size_t sz[3] = {128,128,128};
// Define periodicity of the grid
periodicity<3> bc = {PERIODIC,PERIODIC,PERIODIC};
......@@ -90,11 +98,11 @@ int main(int argc, char* argv[])
double dv = 1*1e-5;
// Number of timesteps
size_t timeSteps = 17000;
size_t timeSteps = 5000;
// K and F (Physical constant in the equation)
double K = 0.065;
double F = 0.034;
double K = 0.014;
double F = 0.053;
//! \cond [init lib] \endcond
......@@ -186,7 +194,7 @@ int main(int argc, char* argv[])
// visualization
if (i % 60 == 0)
{
Old.write("output",count,VTK_WRITER | FORMAT_BINARY);
Old.write_frame("output",count,VTK_WRITER | FORMAT_BINARY);
count++;
}
}
......
......@@ -404,7 +404,7 @@ int main(int argc, char* argv[])
*
* Once we have the solution we copy it on the grid
*
* \snippet Numerics/Stoke_flow/0_2D_incompressible/main_eigen.cpp copy write
* \snippet Numerics/Stoke_flow/0_2D_incompressible/main_petsc.cpp copy write
*
*/
......@@ -424,7 +424,7 @@ int main(int argc, char* argv[])
*
* At the very end of the program we have always to de-initialize the library
*
* \snippet Numerics/Stoke_flow/0_2D_incompressible/main_eigen.cpp fin lib
* \snippet Numerics/Stoke_flow/0_2D_incompressible/main_petsc.cpp fin lib
*
*/
......@@ -440,7 +440,7 @@ int main(int argc, char* argv[])
*
* # Full code # {#num_sk_inc_2D_ps_code}
*
* \include Numerics/Stoke_flow/0_2D_incompressible/main_eigen.cpp
* \include Numerics/Stoke_flow/0_2D_incompressible/main_petsc.cpp
*
*/
}
......
......@@ -247,7 +247,7 @@ int main(int argc, char* argv[])
Point<3,float> xp = vd.getPos(p);
// Get an iterator of all the particles neighborhood of p
auto Np = NN.getIterator(NN.getCell(vd.getPos(p)));
auto Np = NN.getNNIterator(NN.getCell(vd.getPos(p)));
// For each particle near p
while (Np.isNext())
......
......@@ -6,8 +6,6 @@
*/
#include "Vector/vector_dist.hpp"
#include "Decomposition/CartDecomposition.hpp"
#include "data_type/aggregate.hpp"
#include "Plot/GoogleChart.hpp"
#include "Plot/util.hpp"
#include "timer.hpp"
......@@ -19,7 +17,10 @@
*
* # Molecular Dynamic with Lennard-Jones potential # {#e3_md}
*
* This example show a simple Lennard-Jones molecular dynamic simulation in a stable regime
* This example show a simple Lennard-Jones molecular dynamic simulation in a stable regime.
* Particle feel each other by the potential.
*
* \f$ V(x_p,x_q) = 4( (\frac{\sigma}{r})^{12} - (\frac{\sigma}{r})^6 ) \f$
*
* ## Constants ##
*
......@@ -55,7 +56,7 @@ constexpr int force = 1;
//! \cond [calc forces] \endcond
void calc_forces(vector_dist<3,double, aggregate<double[3],double[3]> > & vd, CellList<3, double, FAST, shift<3, double> > & NN, double sigma12, double sigma6, double r_cut2)
template<typename CellList> void calc_forces(vector_dist<3,double, aggregate<double[3],double[3]> > & vd, CellList & NN, double sigma12, double sigma6, double r_cut2)
{
//! \cond [calc forces] \endcond
......@@ -81,12 +82,12 @@ void calc_forces(vector_dist<3,double, aggregate<double[3],double[3]> > & vd, Ce
/*!
*
* \page Vector_3_md Vector 3 molecular dynamic with cell-list
* \page Vector_3_md_dyn Vector 3 molecular dynamic with cell-list
*
* Get an iterator over the particles and get its position. For each particle p iterate in its neighborhood q
* and calculate the force based on the Lennard-Jhones potential given by
*
* \f$ F(x_p,x_q) = 24(\frac{2}{r^{13}} - \frac{1}{r^{7}}) r \f$
* \f$ F(x_p,x_q) = 24( \frac{2 \sigma^{12}}{r^{13}} - \frac{\sigma^6}{r^{7}}) \hat{r} \f$
*
* \see \ref e0_s_assign_pos
*
......@@ -108,7 +109,7 @@ void calc_forces(vector_dist<3,double, aggregate<double[3],double[3]> > & vd, Ce
// Get the position xp of the particle
Point<3,double> xp = vd.getPos(p);
// Reset the forice counter
// Reset the force counter
vd.template getProp<force>(p)[0] = 0.0;
vd.template getProp<force>(p)[1] = 0.0;
vd.template getProp<force>(p)[2] = 0.0;
......@@ -175,7 +176,7 @@ void calc_forces(vector_dist<3,double, aggregate<double[3],double[3]> > & vd, Ce
//! \cond [calc energy] \endcond
double calc_energy(vector_dist<3,double, aggregate<double[3],double[3]> > & vd, CellList<3, double, FAST, shift<3, double> > & NN, double sigma12, double sigma6, double r_cut2)
template<typename CellList> double calc_energy(vector_dist<3,double, aggregate<double[3],double[3]> > & vd, CellList & NN, double sigma12, double sigma6, double r_cut2)
{
double rc = r_cut2;
double shift = 2.0 * ( sigma12 / (rc*rc*rc*rc*rc*rc) - sigma6 / ( rc*rc*rc) );
......@@ -208,7 +209,7 @@ double calc_energy(vector_dist<3,double, aggregate<double[3],double[3]> > & vd,
* First we get an iterator over the particles and get its position. For each particle p iterate in its neighborhood q
* and calculate the energy based on the Lennard-Jhones potential given by
*
* \f$ V(x_p,x_q) = 4(\frac{1}{r^{12}} - \frac{1}{r^{6}}) r \f$
* \f$ V(x_p,x_q) = 4(\frac{1}{r^{12}} - \frac{1}{r^{6}}) \f$
*
* \see \ref e0_s_assign_pos
*
......@@ -284,43 +285,24 @@ int main(int argc, char* argv[])
*
* ## Initialization ## {#e3_md_init}
*
* After we defined the two main function calc forces and calc energy, we define
* important parameters of the simulation, time step integration,
* After we defined the two main function calc forces and calc energy, we Initialize
* the library, we create a Box that define our domain, boundary conditions and ghost.
* Than we define important parameters of the simulation, time step integration,
* size of the box, and cut-off radius of the interaction. We also define 2 vectors
* x and y (they are like std::vector) used for statistic
*
* \see \ref e0_s_init
*
* \snippet Vector/3_molecular_dynamic/main.cpp constants run
*
*/
//! \cond [constants run] \endcond
double dt = 0.0005;
openfpm_init(&argc,&argv);
double sigma = 0.1;
double r_cut = 3.0*sigma;
double sigma12 = pow(sigma,12);
double sigma6 = pow(sigma,6);
openfpm::vector<double> x;
openfpm::vector<openfpm::vector<double>> y;
//! \cond [constants run] \endcond
/*!
* \page Vector_3_md_dyn Vector 3 molecular dynamic with cell-list
*
* Here we Initialize the library, we create a Box that define our domain, boundary conditions and ghost
*
* \see \ref e0_s_init
*
* \snippet Vector/3_molecular_dynamic/main.cpp init
*
*/
//! \cond [init] \endcond
openfpm_init(&argc,&argv);
Vcluster & v_cl = create_vcluster();
// we will use it do place particles on a 10x10x10 Grid like
size_t sz[3] = {10,10,10};
......@@ -334,7 +316,14 @@ int main(int argc, char* argv[])
// ghost, big enough to contain the interaction radius
Ghost<3,float> ghost(r_cut);
//! \cond [init] \endcond
double dt = 0.0005;
double sigma12 = pow(sigma,12);
double sigma6 = pow(sigma,6);
openfpm::vector<double> x;
openfpm::vector<openfpm::vector<double>> y;
//! \cond [constants run] \endcond
/*!
* \page Vector_3_md_dyn Vector 3 molecular dynamic with cell-list
......@@ -370,18 +359,24 @@ int main(int argc, char* argv[])
//! \cond [vect grid] \endcond
// We create the grid iterator
auto it = vd.getGridIterator(sz);
while (it.isNext())
{
// Create a new particle
vd.add();
// key contain (i,j,k) index of the grid
auto key = it.get();
// The index of the grid can be accessed with key.get(0) == i, key.get(1) == j ...
// We use getLastPos to set the position of the last particle added
vd.getLastPos()[0] = key.get(0) * it.getSpacing(0);
vd.getLastPos()[1] = key.get(1) * it.getSpacing(1);
vd.getLastPos()[2] = key.get(2) * it.getSpacing(2);
// We use getLastProp to set the property value of the last particle we added
vd.template getLastProp<velocity>()[0] = 0.0;
vd.template getLastProp<velocity>()[1] = 0.0;
vd.template getLastProp<velocity>()[2] = 0.0;
......@@ -404,8 +399,8 @@ int main(int argc, char* argv[])
*
* The verlet integration stepping look like this
*
* \f[ \vec{v}(t_{n+1/2}) = \vec{v}_p(t_n) + \frac{1}{2} \delta t \vec{a}(t_n) \f]
* \f[ \vec{x}(t_{n}) = \vec{x}_p(t_n) + \delta t \vec{v}(t_n+1/2) \f]
* \f[ \vec{v}(t_{n}+1/2) = \vec{v}_p(t_n) + \frac{1}{2} \delta t \vec{a}(t_n) \f]
* \f[ \vec{x}(t_{n}+1) = \vec{x}_p(t_n) + \delta t \vec{v}(t_n+1/2) \f]
*
* calculate the forces from \f$ \vec{a} (t_{n}) \f$ finally
*
......@@ -465,7 +460,7 @@ int main(int argc, char* argv[])
++it3;
}
// Because we mooved the particles in space we have to map them and re-sync the ghost
// Because we moved the particles in space we have to map them and re-sync the ghost
vd.map();
vd.template ghost_get<>();
......@@ -488,7 +483,7 @@ int main(int argc, char* argv[])
++it4;
}
// After every iteration collect some statistic about the confoguration
// After every iteration collect some statistic about the configuration
if (i % 100 == 0)
{
// We write the particle position for visualization (Without ghost)
......@@ -554,6 +549,15 @@ int main(int argc, char* argv[])
// width of the line
options.lineWidth = 1.0;
// Resolution in x
options.width = 1280;
// Resolution in y
options.heigh = 720;
// Add zoom capability
options.more = GC_ZOOM;
// Object that draw the X Y graph
GoogleChart cg;
......
......@@ -149,6 +149,8 @@ int main(int argc, char* argv[])
//! \cond [create multi-phase verlet] \endcond
{
// Get the cell list of the phase1
auto CL_phase1 = phases.get(1).getCellList(r_cut);
......@@ -204,6 +206,8 @@ int main(int argc, char* argv[])
++it;
}
}
//! \cond [count part from phase0 to 1] \endcond
/*!
......@@ -311,13 +315,14 @@ int main(int argc, char* argv[])
*
*/
{
//! \cond [compute sym multi-phase two phase] \endcond
// Get the cell list of the phase1
CL_phase1 = phases.get(1).getCellListSym(r_cut);
auto CL_phase1 = phases.get(1).getCellListSym(r_cut);
// This function create a Verlet-list between phases 0 and 1
NN_ver01 = createVerletSym(phases.get(0),phases.get(1),CL_phase1,r_cut);
auto NN_ver01 = createVerletSym(phases.get(0),phases.get(1),CL_phase1,r_cut);
// Get an iterator over the real and ghost particles
it = phases.get(0).getDomainAndGhostIterator();
......@@ -371,6 +376,8 @@ int main(int argc, char* argv[])
phases.get(0).ghost_put<add_,0>();
phases.get(1).ghost_put<add_,0>();
}
//! \cond [compute sym multi-phase two phase] \endcond
/*!
......
......@@ -12,7 +12,7 @@ constexpr int velocity = 0;
constexpr int force = 1;
void calc_forces(vector_dist<3,double, aggregate<double[3],double[3]> > & vd, CellList<3, double, FAST, shift<3, double> > & NN, double sigma12, double sigma6)
template<typename CellList> void calc_forces(vector_dist<3,double, aggregate<double[3],double[3]> > & vd, CellList & NN, double sigma12, double sigma6)
{
// update the Cell-list
vd.updateCellList(NN);
......@@ -73,7 +73,7 @@ void calc_forces(vector_dist<3,double, aggregate<double[3],double[3]> > & vd, Ce
}
double calc_energy(vector_dist<3,double, aggregate<double[3],double[3]> > & vd, CellList<3, double, FAST, shift<3, double> > & NN, double sigma12, double sigma6)
template<typename CellList> double calc_energy(vector_dist<3,double, aggregate<double[3],double[3]> > & vd, CellList & NN, double sigma12, double sigma6)
{
double E = 0.0;
......
......@@ -45,7 +45,7 @@ constexpr int force = 1;
//! \cond [calc forces] \endcond
void calc_forces(vector_dist<3,double, aggregate<double[3],double[3]> > & vd, CellList_hilb<3, double, FAST, shift<3, double> > & NN, double sigma12, double sigma6)
template<typename CellList> void calc_forces(vector_dist<3,double, aggregate<double[3],double[3]> > & vd, CellList & NN, double sigma12, double sigma6)
{
//! \cond [calc forces] \endcond
......@@ -140,7 +140,7 @@ void calc_forces(vector_dist<3,double, aggregate<double[3],double[3]> > & vd, Ce
//! \cond [calc energy all] \endcond
double calc_energy(vector_dist<3,double, aggregate<double[3],double[3]> > & vd, CellList_hilb<3, double, FAST, shift<3, double> > & NN, double sigma12, double sigma6)
template<typename CellList> double calc_energy(vector_dist<3,double, aggregate<double[3],double[3]> > & vd, CellList & NN, double sigma12, double sigma6)
{
double E = 0.0;
......
......@@ -148,7 +148,7 @@ void calc_forces(vector_dist<3,double, aggregate<double[3],double[3]> > & vd, Ve
//! \cond [real and ghost] \endcond
// Get an iterator over particles
auto it2 = vd.getParticleIteratorCRS(NN.getInternalCellList());
auto it2 = vd.getParticleIteratorCRS(NN);
//! \cond [real and ghost] \endcond
......@@ -250,7 +250,7 @@ double calc_energy(vector_dist<3,double, aggregate<double[3],double[3]> > & vd,
double shift = 4.0 * ( sigma12 / (rc*rc*rc*rc*rc*rc) - sigma6 / ( rc*rc*rc) );
// Get an iterator over particles
auto it2 = vd.getParticleIteratorCRS(NN.getInternalCellList());
auto it2 = vd.getParticleIteratorCRS(NN);
// For each particle ...
while (it2.isNext())
......
......@@ -912,7 +912,7 @@ int main(int argc, char* argv[])
cbar = coeff_sound * sqrt(gravity * h_swl);
// for each particle inside the fluid box ...
/* while (fluid_it.isNext())
while (fluid_it.isNext())
{
// ... add a particle ...
vd.add();
......@@ -946,8 +946,7 @@ int main(int argc, char* argv[])
// next fluid particle
++fluid_it;
}*/
}
// Recipient
Box<3,double> recipient1({0.0,0.0,0.0},{1.6+dp/2.0,0.67+dp/2.0,0.4+dp/2.0});
......@@ -1010,10 +1009,6 @@ int main(int argc, char* argv[])
vd.map();
vd.write("Recipient");
return 0;
// Now that we fill the vector with particles
ModelCustom md;
......
openfpm_data @ 2c313203
Subproject commit 3a732c98d6404fd81529c25af4fbf33f8ca3de9c
Subproject commit 2c31320305af04b0621d2a10818354d064ec1bbf
openfpm_devices @ 9817279e
Subproject commit add2acfe9623e6045da1e41adbab6dc57ef50e5f
Subproject commit 9817279ee3ac36b435d2178e994ab314a01aab30
openfpm_io @ 9b0500dd
Subproject commit a6bd0b797704f6faba662a10f5b101c218257490
Subproject commit 9b0500dd1347d9f3d2898f2a9206220eea7907d5
openfpm_vcluster @ 7030e7f7
Subproject commit 1856e665949ecca8dbcf68e08984aace853aad8d
Subproject commit 7030e7f76e5d80a297e4cc9b2d4f3ad98beb8d0f
......@@ -135,7 +135,7 @@ protected:
//! Structure that store the cartesian grid information
grid_sm<dim, void> gr_dist;
//! Structure that decompose your structure into cell without creating them
//! Structure that decompose the space into cells without creating them
//! useful to convert positions to CellId or sub-domain id in this case
CellDecomposer_sm<dim, T, shift<dim,T>> cd;
......@@ -1724,6 +1724,16 @@ public:
return dist.get_ndec();
}
/*! \brief Get the cell decomposer of the decomposition
*
* \return the cell decomposer
*
*/
const CellDecomposer_sm<dim, T, shift<dim,T>> & getCellDecomposer()
{
return cd;
}
//! friend classes
friend extended_type;
......
......@@ -114,7 +114,7 @@ struct lBox_dom
{
//! Intersection between the local sub-domain enlarged by the ghost and the contiguous processor
//! sub-domains (External ghost)
openfpm::vector_std< Box_sub<dim,T> > ebx;
openfpm::vector_std< Box_sub_k<dim,T> > ebx;
//! Intersection between the contiguous processor sub-domain enlarged by the ghost with the
//! local sub-domain (Internal ghost)
......
......@@ -991,7 +991,7 @@ public:
return true;
}
/*! \brief Check if the ie_loc_ghosts contain the same information
/*! \brief Check if the ie_ghosts contain the same information
*
* \param ig Element to check
*
......@@ -1065,52 +1065,6 @@ public:
*/
bool is_equal_ng(ie_ghost<dim,T> & ig)
{
Box<dim,T> bt;
if (getNEGhostBox() != ig.getNEGhostBox())
return false;
if (getNIGhostBox() != ig.getNIGhostBox())
return false;
for (size_t i = 0 ; i < proc_int_box.size() ; i++)
{
if (getProcessorNIGhost(i) != ig.getProcessorNIGhost(i))
return false;
for (size_t j = 0 ; j < getProcessorNIGhost(i) ; j++)
{
if (getProcessorIGhostBox(i,j).Intersect(ig.getProcessorIGhostBox(i,j),bt) == false)
return false;
if (getProcessorIGhostId(i,j) != ig.getProcessorIGhostId(i,j))
return false;
if (getProcessorIGhostSub(i,j) != ig.getProcessorIGhostSub(i,j))
return false;
}
if (getIGhostBox(i).Intersect(ig.getIGhostBox(i),bt) == false)
return false;
if (getIGhostBoxProcessor(i) != ig.getIGhostBoxProcessor(i))
return false;
}
for (size_t i = 0 ; i < proc_int_box.size() ; i++)
{
if (getProcessorNEGhost(i) != ig.getProcessorNEGhost(i))
return false;
for (size_t j = 0 ; j < getProcessorNEGhost(i) ; j++)
{
if (getProcessorEGhostBox(i,j).Intersect(ig.getProcessorEGhostBox(i,j),bt) == false)
return false;
if (getProcessorEGhostId(i,j) != ig.getProcessorEGhostId(i,j))
return false;
if (getProcessorEGhostSub(i,j) != ig.getProcessorEGhostSub(i,j))
return false;
}
if (getEGhostBox(i).Intersect(ig.getEGhostBox(i),bt) == false)
return false;
if (getEGhostBoxProcessor(i) != ig.getEGhostBoxProcessor(i))
return false;
}
return true;
}
......
......@@ -70,7 +70,7 @@ class ie_loc_ghost
if (intersect == true)
{
Box_sub<dim,T> b;
Box_sub_k<dim,T> b;
b.sub = rj;
b.bx = bi;
b.cmb = sub_domains_prc.get(j).cmb;
......@@ -84,6 +84,7 @@ class ie_loc_ghost
if (loc_ghost_box.get(rj).ibx.get(k).sub == i && loc_ghost_box.get(rj).ibx.get(k).cmb == sub_domains_prc.get(j).cmb.operator-())
{
loc_ghost_box.get(rj).ibx.get(k).k = loc_ghost_box.get(i).ebx.size()-1;
loc_ghost_box.get(i).ebx.last().k = k;
break;
}
}
......@@ -346,9 +347,11 @@ public:
return loc_ghost_box.get(id).ibx.size();
}
/*! \brief For the sub-domain i intersected with the sub-domain j enlarged, the associated
* external ghost box is located in getLocalEGhostBox(j,k) with
* getLocalIGhostSub(j,k) == i, this function return k
/*! \brief For the sub-domain i intersected with a surrounding sub-domain enlarged. Produce a internal ghost box from
* the prospecive of i and an associated external ghost box from the prospective of j.
* In order to retrieve the information about the external ghost box we have to use getLocalEGhostBox(x,k).
* where k is the value returned by getLocalIGhostE(i,j) and x is the value returned by
* getLocalIGhostSub(i,j)
*
* \param i
* \param j
......@@ -460,10 +463,10 @@ public:
return loc_ghost_box.get(i).ebx.get(j).cmb;
}
/*! \brief Considering that sub-domain has N internal local ghost box identified
/*! \brief Considering that sub-domains has N internal local ghost box identified
* with the 0 <= k < N that come from the intersection of 2 sub-domains i and j
* where j is enlarged, given the sub-domain i and the id k to identify the local internal ghost,
* it return the id k of the other sub-domain that produced the intersection
* where j is enlarged, given the sub-domain i and the id k of the internal box,
* it return the id of the other sub-domain that produced the intersection
*
* \param i sub-domain
* \param k id
......@@ -475,7 +478,7 @@ public:
return loc_ghost_box.get(i).ibx.get(k).sub;
}
/*! \brief Considering that sub-domain has N external local ghost box identified
/*! \brief Considering that sub-domains has N external local ghost box identified
* with the 0 <= k < N that come from the intersection of 2 sub-domains i and j
* where i is enlarged, given the sub-domain i and the id k of the external box,
* it return the id of the other sub-domain that produced the intersection
......@@ -562,7 +565,16 @@ public:
{
if (loc_ghost_box.get(i).ibx.get(j).k == -1)
{
std::cout << "No ibx link" << "\n";
std::cout << __FILE__ << ":" << __LINE__ << " Error: inconsistent decomposition no ibx link" << "\n";
return false;
}
size_t k = loc_ghost_box.get(i).ibx.get(j).k;
size_t sub = loc_ghost_box.get(i).ibx.get(j).sub;
if (loc_ghost_box.get(sub).ebx.get(k).k != (long int)j)
{
std::cout << __FILE__ << ":" << __LINE__ << " Error: inconsistent link between an external ghost box and an internal ghost box" << "\n";
return false;
}
}
......@@ -627,39 +639,6 @@ public:
*/
bool is_equal_ng(ie_loc_ghost<dim,T> & ilg)
{
Box<dim,T> bt;
if (ilg.loc_ghost_box.size() != loc_ghost_box.size())
return false;
// Explore all the subdomains
for (size_t i = 0 ; i < loc_ghost_box.size() ; i++)
{
if (getLocalNIGhost(i) != ilg.getLocalNIGhost(i))
return false;
if (getLocalNEGhost(i) != ilg.getLocalNEGhost(i))
return false;
for (size_t j = 0 ; j < getLocalNIGhost(i) ; j++)
{
if (getLocalIGhostE(i,j) != ilg.getLocalIGhostE(i,j))
return false;
if (getLocalIGhostBox(i,j).Intersect(ilg.getLocalIGhostBox(i,j),bt) == false)
return false;
if (getLocalIGhostSub(i,j) != ilg.getLocalIGhostSub(i,j))
return false;
}
for (size_t j = 0 ; j < getLocalNEGhost(i) ; j++)
{
if (getLocalEGhostBox(i,j).Intersect(ilg.getLocalEGhostBox(i,j),bt) == false)
return false;
if (getLocalEGhostSub(i,j) != ilg.getLocalEGhostSub(i,j))
return false;
}
}
return true;
}
......
This diff is collapsed.
This diff is collapsed.
......@@ -1359,6 +1359,126 @@ void Test3D_periodic(const Box<3,float> & domain, long int k)
}
}
// Test grid periodic
void Test3D_periodic_put(const Box<3,float> & domain, long int k)
{
Vcluster & v_cl = create_vcluster();
if ( v_cl.getProcessingUnits() > 32 )
return;
long int big_step = k / 30;
big_step = (big_step == 0)?1:big_step;
long int small_step = 21;
print_test( "Testing grid periodic put k<=",k);
// 3D test
for ( ; k >= 2 ; k-= (k > 2*big_step)?big_step:small_step )
{
BOOST_TEST_CHECKPOINT( "Testing grid periodick<=" << k );