forked from idaholab/moose
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make partitioner a plugin system like preconditioner. (idaholab#5543)
- Loading branch information
Sebastian Schunert
committed
Sep 28, 2015
1 parent
e5d3a14
commit 971c0a3
Showing
18 changed files
with
588 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/****************************************************************/ | ||
/* DO NOT MODIFY THIS HEADER */ | ||
/* MOOSE - Multiphysics Object Oriented Simulation Environment */ | ||
/* */ | ||
/* (c) 2010 Battelle Energy Alliance, LLC */ | ||
/* ALL RIGHTS RESERVED */ | ||
/* */ | ||
/* Prepared by Battelle Energy Alliance, LLC */ | ||
/* Under Contract No. DE-AC07-05ID14517 */ | ||
/* With the U. S. Department of Energy */ | ||
/* */ | ||
/* See COPYRIGHT for full restrictions */ | ||
/****************************************************************/ | ||
|
||
#ifndef PARTITIONERACTION_H | ||
#define PARTITIONERACTION_H | ||
|
||
#include "MooseObjectAction.h" | ||
|
||
class PartitionerAction; | ||
|
||
template<> | ||
InputParameters validParams<PartitionerAction>(); | ||
|
||
|
||
class PartitionerAction: public MooseObjectAction | ||
{ | ||
public: | ||
PartitionerAction(InputParameters params); | ||
|
||
virtual void act(); | ||
}; | ||
|
||
#endif //PartitionerAction_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/****************************************************************/ | ||
/* DO NOT MODIFY THIS HEADER */ | ||
/* MOOSE - Multiphysics Object Oriented Simulation Environment */ | ||
/* */ | ||
/* (c) 2010 Battelle Energy Alliance, LLC */ | ||
/* ALL RIGHTS RESERVED */ | ||
/* */ | ||
/* Prepared by Battelle Energy Alliance, LLC */ | ||
/* Under Contract No. DE-AC07-05ID14517 */ | ||
/* With the U. S. Department of Energy */ | ||
/* */ | ||
/* See COPYRIGHT for full restrictions */ | ||
/****************************************************************/ | ||
|
||
#ifndef LIBMESHPARTITIONER_H | ||
#define LIBMESHPARTITIONER_H | ||
|
||
#include "MoosePartitioner.h" | ||
|
||
class LibmeshPartitioner; | ||
|
||
template<> | ||
InputParameters validParams<LibmeshPartitioner>(); | ||
|
||
class LibmeshPartitioner : public MoosePartitioner | ||
{ | ||
public: | ||
LibmeshPartitioner(const InputParameters & params); | ||
virtual ~LibmeshPartitioner(); | ||
|
||
virtual Partitioner * getPartitioner(); | ||
protected: | ||
Partitioner * _partitioner; | ||
MooseEnum _partitioner_name; | ||
}; | ||
|
||
#endif /* LIBMESHPARTITIONER_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/****************************************************************/ | ||
/* DO NOT MODIFY THIS HEADER */ | ||
/* MOOSE - Multiphysics Object Oriented Simulation Environment */ | ||
/* */ | ||
/* (c) 2010 Battelle Energy Alliance, LLC */ | ||
/* ALL RIGHTS RESERVED */ | ||
/* */ | ||
/* Prepared by Battelle Energy Alliance, LLC */ | ||
/* Under Contract No. DE-AC07-05ID14517 */ | ||
/* With the U. S. Department of Energy */ | ||
/* */ | ||
/* See COPYRIGHT for full restrictions */ | ||
/****************************************************************/ | ||
|
||
#ifndef MOOSEPARTITIONER_H | ||
#define MOOSEPARTITIONER_H | ||
|
||
#include "MooseObject.h" | ||
#include "Restartable.h" | ||
|
||
#include "libmesh/partitioner.h" | ||
|
||
//Forward declarations | ||
namespace libMesh | ||
{ | ||
class MeshBase; | ||
} | ||
|
||
class MoosePartitioner; | ||
|
||
template<> | ||
InputParameters validParams<MoosePartitioner>(); | ||
|
||
/** | ||
* Base class for MOOSE partitioner | ||
*/ | ||
class MoosePartitioner : | ||
public MooseObject, | ||
public Restartable | ||
{ | ||
public: | ||
MoosePartitioner(const InputParameters & params); | ||
virtual ~MoosePartitioner(); | ||
|
||
virtual Partitioner * getPartitioner() = 0; | ||
}; | ||
|
||
#endif /* MOOSEPARTITIONER_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/****************************************************************/ | ||
/* DO NOT MODIFY THIS HEADER */ | ||
/* MOOSE - Multiphysics Object Oriented Simulation Environment */ | ||
/* */ | ||
/* (c) 2010 Battelle Energy Alliance, LLC */ | ||
/* ALL RIGHTS RESERVED */ | ||
/* */ | ||
/* Prepared by Battelle Energy Alliance, LLC */ | ||
/* Under Contract No. DE-AC07-05ID14517 */ | ||
/* With the U. S. Department of Energy */ | ||
/* */ | ||
/* See COPYRIGHT for full restrictions */ | ||
/****************************************************************/ | ||
|
||
#include "PartitionerAction.h" | ||
|
||
#include "FEProblem.h" | ||
#include "MooseEnum.h" | ||
#include "MoosePartitioner.h" | ||
|
||
template<> | ||
InputParameters validParams<PartitionerAction>() | ||
{ | ||
InputParameters params = validParams<MooseObjectAction>(); | ||
return params; | ||
} | ||
|
||
PartitionerAction::PartitionerAction(InputParameters params) : | ||
MooseObjectAction(params) | ||
{ | ||
} | ||
|
||
void | ||
PartitionerAction::act() | ||
{ | ||
_mesh->setIsCustomPartitionerRequested(true); | ||
MooseSharedPointer<MoosePartitioner> mp = MooseSharedNamespace::static_pointer_cast<MoosePartitioner>(_factory.create(_type, _name, _moose_object_pars)); | ||
_mesh->setCustomPartitioner(mp->getPartitioner()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.