Skip to content

Commit

Permalink
Make _custom_partitioner UniquePtr and remove getCustomPartitioner (i…
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Schunert committed Oct 23, 2015
1 parent 21635be commit db2d11b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
5 changes: 2 additions & 3 deletions framework/include/mesh/MooseMesh.h
Expand Up @@ -683,9 +683,8 @@ class MooseMesh :
MooseMesh::MortarInterface * getMortarInterface(BoundaryID master, BoundaryID slave);

/**
* Setter and getter for custom partitioner
* Setter for custom partitioner
*/
Partitioner * getCustomPartitioner() const;
void setCustomPartitioner(Partitioner * partitioner);

/**
Expand Down Expand Up @@ -713,7 +712,7 @@ class MooseMesh :
bool _partitioner_overridden;

/// The custom partitioner
Partitioner * _custom_partitioner;
UniquePtr<Partitioner> _custom_partitioner;
bool _custom_partitioner_requested;

/// Convenience enums
Expand Down
15 changes: 2 additions & 13 deletions framework/src/mesh/MooseMesh.C
Expand Up @@ -211,11 +211,6 @@ MooseMesh::MooseMesh(const MooseMesh & other_mesh) :

for (std::vector<BoundaryID>::const_iterator it = node_boundaries.begin(); it != node_boundaries.end(); ++it)
boundary_info.nodeset_name(*it) = other_boundary_info.get_nodeset_name(*it);

if (other_mesh.getCustomPartitioner())
setCustomPartitioner(other_mesh.getCustomPartitioner());
else
_custom_partitioner = NULL;
}

MooseMesh::~MooseMesh()
Expand Down Expand Up @@ -1713,7 +1708,7 @@ MooseMesh::init()
// Set custom partitioner
if (!_custom_partitioner)
mooseError("Custom partitioner requested but not set!");
getMesh().partitioner().reset(_custom_partitioner);
getMesh().partitioner().reset(_custom_partitioner.release());
}
else
{
Expand Down Expand Up @@ -2187,16 +2182,10 @@ MooseMesh::getMortarInterface(BoundaryID master, BoundaryID slave)
mooseError("Requesting non-existing mortar interface (master = " << master << ", slave = " << slave << ").");
}

Partitioner *
MooseMesh::getCustomPartitioner() const
{
return _custom_partitioner;
}

void
MooseMesh::setCustomPartitioner(Partitioner * partitioner)
{
_custom_partitioner = partitioner->clone().release();
_custom_partitioner = partitioner->clone();
}

bool
Expand Down

0 comments on commit db2d11b

Please sign in to comment.