15 fin.open( filename, std::ios::in );
19 logError(
"readDatFile(string)",
"was not able to open file " << filename );
22 while ( std::getline(fin,line) ){
23 std::stringstream currentLine(line);
28 while ( std::getline(currentLine, token,
' ') and entry<Dimensions ) {
30 newEntry(entry) = scale*std::atof( token.c_str() );
34 _data.push_back( newEntry );
39 logInfo(
"readDatFile(string)",
"read " <<
_data.size() <<
" particle positions from file " << filename );
63 std::list< tarch::la::Vector<Dimensions,double> > result;
65 std::list< tarch::la::Vector<Dimensions,double> >::iterator p = _data.begin();
66 while ( p!=_data.end() ) {
69 for (
int d=0; d<Dimensions; d++) {
#define logError(methodName, logMacroMessageStream)
Wrapper macro around tarch::tarch::logging::Log to improve logging.
#define logInfo(methodName, logMacroMessageStream)
Wrapper macro around tarch::tarch::logging::Log to improve logging.
std::list< tarch::la::Vector< Dimensions, double > > getParticlesWithinVoxel(const tarch::la::Vector< Dimensions, double > &x, const tarch::la::Vector< Dimensions, double > &h, bool remove)
Take particles from database which fall into given voxel.
bool getNumberOfCoordinates() const
std::list< tarch::la::Vector< Dimensions, double > > _data
void readDatFile(const std::string &filename, const double scale)
Read DAT file.
static tarch::logging::Log _log
bool greaterEquals(double lhs, double rhs, double tolerance=NUMERICAL_ZERO_DIFFERENCE)
bool smallerEquals(double lhs, double rhs, double tolerance=NUMERICAL_ZERO_DIFFERENCE)