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.
Adding PartitionerAction and enabling MooseMesh to accept custom part…
…itioner (idaholab#5543)
- Loading branch information
Sebastian Schunert
committed
Sep 23, 2015
1 parent
c5d51d8
commit 20f713e
Showing
10 changed files
with
356 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,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 PARTITIONERACTION_H | ||
#define PARTITIONERACTION_H | ||
|
||
#include "Action.h" | ||
|
||
class PartitionerAction; | ||
|
||
template<> | ||
InputParameters validParams<PartitionerAction>(); | ||
|
||
|
||
class PartitionerAction: public Action | ||
{ | ||
public: | ||
PartitionerAction(InputParameters params); | ||
|
||
virtual void act(); | ||
|
||
protected: | ||
MooseEnum _partitioner_type; | ||
}; | ||
|
||
#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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/****************************************************************/ | ||
/* 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 "libmesh/linear_partitioner.h" | ||
|
||
template<> | ||
InputParameters validParams<PartitionerAction>() | ||
{ | ||
InputParameters params = validParams<Action>(); | ||
MooseEnum partitioning("linear=0", "linear"); | ||
|
||
params.addParam<MooseEnum> ("partitioner", partitioning, "The class name of the partitioner you want to use."); | ||
return params; | ||
} | ||
|
||
PartitionerAction::PartitionerAction(InputParameters params) : | ||
Action(params), | ||
_partitioner_type(getParam<MooseEnum>("partitioner")) | ||
{ | ||
} | ||
|
||
void | ||
PartitionerAction::act() | ||
{ | ||
switch (_partitioner_type) | ||
{ | ||
case 0: | ||
_mesh->setCustomPartitioner(new LinearPartitioner()); | ||
break; | ||
} | ||
} |
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
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.