MAJ terminée. Nous sommes passés en version 14.6.2 . Pour consulter les "releases notes" associées c'est ici :

https://about.gitlab.com/releases/2022/01/11/security-release-gitlab-14-6-2-released/
https://about.gitlab.com/releases/2022/01/04/gitlab-14-6-1-released/

Commit 41250feb authored by Quentin Khan's avatar Quentin Khan
Browse files

Added comments to loadFMMAndRunFMAUtils and prepared removal of args structure

parent 0d66f52f
......@@ -2,35 +2,55 @@
#define _LOADFMAANDRUNFMMUTILS_HPP_
#include "CostZones.hpp"
#include <assert.h>
/**
* \brief Saves the costzones to files.
*
* One file is created per level, one particle is stored per line in the form :
* x,y,z,zone.
*
* \param args The args that were given to the program
* \param costzones The CostZones object that was used get the tree balance.
*/
template<class OctreeClass, class CellClass>
void writeZones(const loadFMAAndRunFMMArgs& args, const CostZones <OctreeClass,CellClass>& costzones)
{
std::string outFileBaseName = args.outFileName();
std::string outFileExt = args.outFileExt();
int verboseLevel = args.verboseLevel();
int treeHeight = args.treeHeight();
auto zones = costzones.getZones();
int zoneCount = zones.size();//args.zoneCount();
std::cout << "Writing " << zoneCount << " zones." << std::endl;
// GCC versions before 5.0 have not implemented move constructors to streams
// we use unique pointers to get around this problem.
std::vector<std::unique_ptr<std::ofstream>> outfiles;
for ( int zoneIdx = 0; zoneIdx < args.treeHeight(); zoneIdx++ ) {
for ( int levelIdx = 0; levelIdx < treeHeight; levelIdx++ ) {
std::unique_ptr<std::ofstream> out(
new std::ofstream( args.outFileName()
+ "_" + std::to_string(args.zoneCount()) + "z"
+ "." + std::to_string(zoneIdx)
+ args.outFileExt()));
new std::ofstream( outFileBaseName
+ "_" + std::to_string(zoneCount) + "z"
+ "." + std::to_string(levelIdx)
+ outFileExt));
*out << "x,y,z,zone" << std::endl;
outfiles.push_back(std::move(out));
}
auto zones = costzones.getZones();
int zoneIdx = 0;
for ( auto zone : zones) {
for ( auto cell : zone) {
*(outfiles[cell.first]) << cell.second->getCoordinate().getX() << ",";
*(outfiles[cell.first]) << cell.second->getCoordinate().getY() << ",";
*(outfiles[cell.first]) << cell.second->getCoordinate().getZ() << ",";
*(outfiles[cell.first]) << zoneIdx << "," << cell.first << std::endl;
*(outfiles[cell.first]) << zoneIdx << std::endl;
}
zoneIdx++;
}
if ( args.verboseLevel() > 0) {
if ( verboseLevel > 0) {
auto& zonebounds = costzones.getZoneBounds();
zoneIdx = 0;
for ( auto zone : zonebounds ) {
......@@ -45,6 +65,11 @@ void writeZones(const loadFMAAndRunFMMArgs& args, const CostZones <OctreeClass,C
}
}
/**
* \brief Loads a tree from a loader.
* \param tree The the to load into.
* \param loader The loader to load from.
*/
template <class OctreeClass>
void loadTree(OctreeClass& tree, FFmaGenericLoader& loader)
{
......@@ -53,7 +78,7 @@ void loadTree(OctreeClass& tree, FFmaGenericLoader& loader)
// insertion
for ( int idxPart = 0 ; idxPart < loader.getNumberOfParticles() ; ++idxPart ) {
loader.fillParticle(&particlePosition, &physicalValue);
tree.insert(particlePosition);
tree.insert(particlePosition, idxPart);
}
}
......
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