Commit 7d6f6083 by BLANCHARD Pierre

Provided new distribution of particles (hyperbolic paraboloid Z=C*(AX*AX-BY*BY)).

parent a7feed21
 ... ... @@ -189,12 +189,24 @@ int main(int argc, char ** argv){ pos = aspectRatio.find(":"); aspectRatio.replace(pos,1," "); std::stringstream ss(aspectRatio); ss >>A >> B >> C ; if(A != B){ std::cerr << " A /= B in prolate sllipsoide A =B. Your aspect ratio: "<< aspectRatio<>A >> B >> C ; std::cout << "A: "<>A >> B >> C ; std::cout << "A: "<
 ... ... @@ -171,6 +171,31 @@ void unifRandonPointsOnProlate(const FSize N , const FReal &a, const FReal &c, F } ; //! \fn unifRandonPointsOnHyperPara(const int N , const FReal &a, const FReal &b, const FReal &c, FReal * points) //! \brief Generate N points uniformly distributed on the hyperbolic paraboloid of aspect ratio a:b:c //! //! \param N the number of points //! \param a the x semi-axe length //! \param b the y semi-axe length //! \param c the z semi-axe length //! \param points array of size 4*N and stores data as follow x,y,z,0,x,y,z,0.... //! template void unifRandonPointsOnHyperPara(const FSize N , const FReal &a, const FReal &b, const FReal &c, FReal * points) { // FReal u, v ; FSize j =0 ; for (FSize i = 0 ; i< N ; ++i, j+=4) { u = 2.0*getRandom() - 1.0 ; v = 2.0*getRandom() - 1.0 ; points[j] = a*u ; points[j+1] = b*v ; points[j+2] = c*(u*u - v*v) ; } }; //! \fn unifRandonPointsOnSphere(const int N , const FReal R, FReal * points) //! \brief Generate N points uniformly distributed on the sphere of radius R ... ... @@ -247,245 +272,5 @@ void unifRandonPlummer(const FSize N , const FReal R, const FReal M, FReal * poi <<100*static_cast(cpt-N)/static_cast(cpt) << " %" < void exportCVS(std::ofstream& file, const FReal * particles , const FSize N, const int nbDataPerParticle=4){ int j = 0; if (nbDataPerParticle==4){ file << " x , y , z, q " < void exportCOSMOS(std::ofstream& file, const FReal * particles , const FSize N){ FSize j = 0; file << " x , y , z, q " < void exportVTK(std::ofstream& VTKfile, const FReal * particles, const FSize N, const int nbDataPerParticle=4 ){ int j = 0; //--------------------------- // print generic information //--------------------------- VTKfile << "# vtk DataFile Version 3.0" << "\n"; VTKfile << "# Generated bt exportVTK" << "\n"; VTKfile << "ASCII" << "\n"; VTKfile << "DATASET POLYDATA" << "\n"; // //--------------------------------- // print nodes ordered by their TAG //--------------------------------- VTKfile << "POINTS " << N << " float" << "\n"; // for(FSize i = 0 ; i< N; ++i, j+=nbDataPerParticle){ VTKfile << particles[j] << " " << particles[j+1] << " " << particles[j+2] < void exportVTKxml(std::ofstream& VTKfile, const FReal * particles, const FSize N ){ FSize j = 0; VTKfile << "" < "<"<"<"< "< "< "< "<"<"<"<"<<" "<"<"<" <"<"<"<"<"<"<"<"<"< void exportVTKxml(std::ofstream& VTKfile, const FReal * particles, const FSize N, const int nbDataPerParticle ){ FSize j = 0; VTKfile << "" < "<"<"<"< "< "< "< "<"<"<"<"< "< "< "<"<"<"<"<<" "<"<"<" <"<"<"<"<"<"<"<"<"<
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!