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.
Setup periodic boundary conditions in a scalable way
when mesh is generated in parallel Refs idaholab#15501
- Loading branch information
Showing
11 changed files
with
336 additions
and
24 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
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,32 @@ | ||
//* This file is part of the MOOSE framework | ||
//* https://www.mooseframework.org | ||
//* | ||
//* All rights reserved, see COPYRIGHT for full restrictions | ||
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT | ||
//* | ||
//* Licensed under LGPL 2.1, please see LICENSE for details | ||
//* https://www.gnu.org/licenses/lgpl-2.1.html | ||
|
||
#pragma once | ||
|
||
#include "GeneralUserObject.h" | ||
|
||
/** | ||
* A native way to check if all boundaries are gathered to every single processor. | ||
*/ | ||
class CheckGhostedBoundaries : public GeneralUserObject | ||
{ | ||
public: | ||
static InputParameters validParams(); | ||
|
||
CheckGhostedBoundaries(const InputParameters & params); | ||
|
||
virtual void initialSetup(){}; | ||
|
||
virtual void initialize(){}; | ||
virtual void execute(); | ||
virtual void finalize(){}; | ||
|
||
private: | ||
dof_id_type _total_num_bdry_sides; | ||
}; |
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 @@ | ||
//* This file is part of the MOOSE framework | ||
//* https://www.mooseframework.org | ||
//* | ||
//* All rights reserved, see COPYRIGHT for full restrictions | ||
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT | ||
//* | ||
//* Licensed under LGPL 2.1, please see LICENSE for details | ||
//* https://www.gnu.org/licenses/lgpl-2.1.html | ||
|
||
#include "CheckGhostedBoundaries.h" | ||
|
||
registerMooseObject("MooseTestApp", CheckGhostedBoundaries); | ||
|
||
InputParameters | ||
CheckGhostedBoundaries::validParams() | ||
{ | ||
InputParameters params = GeneralUserObject::validParams(); | ||
params.addRequiredParam<dof_id_type>("total_num_bdry_sides", "Total number of boundary sides"); | ||
return params; | ||
} | ||
|
||
CheckGhostedBoundaries::CheckGhostedBoundaries(const InputParameters & params) | ||
: GeneralUserObject(params), _total_num_bdry_sides(getParam<dof_id_type>("total_num_bdry_sides")) | ||
{ | ||
} | ||
|
||
void | ||
CheckGhostedBoundaries::execute() | ||
{ | ||
dof_id_type nelems = _fe_problem.mesh().getMesh().get_boundary_info().build_side_list().size(); | ||
|
||
// If the total number of boundary sides is the same as the number of local boundary sides, | ||
// we will conclude all-gather happens. It is not necessarily true, but it works fine | ||
// for setting up tests | ||
if (_total_num_bdry_sides == nelems) | ||
mooseError("All boundaries are ghosted to every single processor, and it is not scalable."); | ||
} |
Oops, something went wrong.