Skip to content
Snippets Groups Projects
Commit 06b2c40c authored by Oliver Sander's avatar Oliver Sander
Browse files

Get rid of the UGGrid::heapSize_ data member

The hand-coded memory heap of UG has been removed from dune-uggrid
about a year ago.  Hence, the heapSize parameter of UGGrid does
not have any purpose anymore.  This patch removes it completely.
It only leaves the public method setDefaultHeapSize and marks it
as deprecated, in order not to break people's codes.
parent 7d26651e
No related branches found
No related tags found
1 merge request!345Get rid of the UGGrid::heapSize_ data member
Pipeline #22512 passed
......@@ -106,11 +106,7 @@ namespace Dune
// get grid parameter block
dgf::UGGridParameterBlock gridParam( input );
// create grid here to set heap size
// create grid factory (passed grid is returned by createGrid method)
if( gridParam.heapSize() > 0 )
UGGrid< dim >::setDefaultHeapSize( gridParam.heapSize() );
for( int n = 0; n < dgf_.nofvtx; n++ )
{
FieldVector< double, dim > v;
......
......@@ -286,9 +286,6 @@ namespace Dune {
typedef unsigned int Rank;
/** \brief Default constructor
*
* Uses the default heapsize, which can be set using the static method
* setDefaultHeapSize().
*/
UGGrid(UGCollectiveCommunication comm = {});
......@@ -767,9 +764,9 @@ namespace Dune {
* specified on grid creation (at the latest). This sets the default heap
* size, which is used when no heap size is given to the constructor.
*/
static void setDefaultHeapSize(unsigned size) {
heapSize_ = size;
}
static void setDefaultHeapSize(unsigned size)
DUNE_DEPRECATED_MSG("Do not set the UGGrid default heap size---it is ignored anyway!")
{}
/** \brief Sets a vertex to a new position
......@@ -852,12 +849,6 @@ namespace Dune {
*/
bool someElementHasBeenMarkedForCoarsening_;
/** \brief The size of UG's internal heap in megabytes
*
* It is handed over to UG for each new multigrid.
*/
static unsigned int heapSize_;
/** \brief The classes implementing the geometry of the boundary segments, if requested */
std::vector<std::shared_ptr<BoundarySegment<dim> > > boundarySegments_;
......@@ -870,10 +861,6 @@ namespace Dune {
}; // end Class UGGrid
// those are defined in uggrid/uggrid.cc
template<> unsigned int UGGrid<2>::heapSize_;
template<> unsigned int UGGrid<3>::heapSize_;
namespace Capabilities
{
/** \struct hasEntity
......
......@@ -31,9 +31,6 @@ namespace Dune {
template<> int UGGrid<2>::numOfUGGrids = 0;
template<> int UGGrid<3>::numOfUGGrids = 0;
template<> unsigned int UGGrid<2>::heapSize_ = 500;
template<> unsigned int UGGrid<3>::heapSize_ = 500;
template <int dim>
UGGrid < dim >::UGGrid(UGCollectiveCommunication comm)
......@@ -587,7 +584,7 @@ void UGGrid<dim>::loadState(const std::string& filename)
type,
problemName.c_str(),
formatName.c_str(),
heapSize_,
0, // dummy heap size
true, //force,
true, //optimizedIO,
false //autosave
......@@ -603,7 +600,7 @@ void UGGrid<dim>::loadState(const std::string& filename)
type,
problemName.c_str(),
formatName.c_str(),
heapSize_,
0, // dummy heap size
true, //force,
true, //optimizedIO,
false //autosave
......
......@@ -458,25 +458,24 @@ createGrid()
DUNE_THROW(GridError, "Calling UG::" << dimworld << "d::ConfigureCommand failed!");
//new @PROBLEM $b @PROBLEM $f @FORMAT $h @HEAP;
char* newArgs[4];
for (int i=0; i<4; i++)
char* newArgs[3];
for (int i=0; i<3; i++)
newArgs[i] = (char*)::malloc(50*sizeof(char));
sprintf(newArgs[0], "new %s", grid_->name_.c_str());
sprintf(newArgs[1], "b %s_Problem", grid_->name_.c_str());
sprintf(newArgs[2], "f DuneFormat%dd", dimworld);
sprintf(newArgs[3], "h %dM", grid_->heapSize_);
if (UG_NS<dimworld>::NewCommand(
4, newArgs
3, newArgs
#if ModelP and DUNE_UGGRID_HAVE_PPIFCONTEXT
, std::make_shared<PPIF::PPIFContext>(grid_->comm())
#endif
))
DUNE_THROW(GridError, "UGGrid<" << dimworld << ">::makeNewMultigrid failed!");
for (int i=0; i<4; i++)
for (int i=0; i<3; i++)
free(newArgs[i]);
// Get a direct pointer to the newly created multigrid
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment