Skip to content
Snippets Groups Projects
Commit 03e7f927 authored by Jean-Noël Grad's avatar Jean-Noël Grad
Browse files

Remove unused and untested utility functions

Number formatting can be achieved with an imbued locale.
parent e377ce46
Branches
No related tags found
No related merge requests found
......@@ -27,6 +27,7 @@
#include "PhantomBlockForest.h"
#include "Types.h"
#include "core/EndianIndependentSerialization.h"
#include "core/debug/Debug.h"
#include "core/math/Uint.h"
#include "core/timing/TimingPool.h"
......
......@@ -45,7 +45,6 @@ target_sources( blockforest
SetupBlock.cpp
SetupBlockForest.cpp
StructuredBlockForest.cpp
Utility.cpp
)
add_subdirectory( communication )
......
//======================================================================================================================
//
// This file is part of waLBerla. waLBerla is free software: you can
// redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// waLBerla is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License along
// with waLBerla (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
//
//! \file Utility.cpp
//! \ingroup blockforest
//! \author Florian Schornbaum <florian.schornbaum@fau.de>
//
//======================================================================================================================
#include "Utility.h"
#include <iomanip>
#include <sstream>
#include <stack>
namespace walberla {
namespace blockforest {
std::string naturalNumberToGroupedThousandsString( uint_t number, const char separator ) { // for the documentation see the header file
std::ostringstream oss;
std::stack< uint_t > numbers;
while( true ) {
numbers.push( number % 1000 );
if( number <= 999 ) break;
number /= 1000;
}
oss << numbers.top();
numbers.pop();
while( !numbers.empty() ) {
oss << separator << std::setfill( '0' ) << std::setw( 3 ) << numbers.top();
oss << std::setw( 0 );
numbers.pop();
}
return oss.str();
}
} // namespace blockforest
} // namespace walberla
......@@ -28,9 +28,7 @@
#include "core/math/Uint.h"
#include <limits>
#include <ostream>
#include <string>
#include <vector>
namespace walberla {
......@@ -110,27 +108,5 @@ inline memory_t bytesToMiB( memory_t bytes ) {
}
//**********************************************************************************************************************
/*!
* \brief Returns the string representation of 'number', every three digits the character 'separator' is inserted
* (172408725 -> "172 408 725")
*/
//**********************************************************************************************************************
std::string naturalNumberToGroupedThousandsString( const uint_t number, const char separator = ' ' );
inline std::string naturalNumberToGroupedThousandsString( const real_t number, const char separator = ' ' ) {
return naturalNumberToGroupedThousandsString( static_cast< uint_t >( 0.5 + number ), separator );
}
inline void fillStream( std::ostream& ostream, const char fill, uint_t length ) {
while( length-- > 0 ) ostream << fill;
}
} // namespace blockforest
} // namespace walberla
......@@ -26,7 +26,6 @@
#include "AllSet.h"
#include "Array.h"
#include "DataTypes.h"
#include "EndianIndependentSerialization.h"
#include "Environment.h"
#include "FunctionTraits.h"
#include "GetPID.h"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment