Skip to content

Commit

Permalink
Merge pull request #26432 from GiudGiud/PR_rename_mg
Browse files Browse the repository at this point in the history
Rename two MGs
  • Loading branch information
GiudGiud authored Jan 5, 2024
2 parents b56c5d6 + 19b6a45 commit 9235009
Show file tree
Hide file tree
Showing 27 changed files with 82 additions and 74 deletions.
2 changes: 1 addition & 1 deletion framework/doc/content/source/auxkernels/GhostingAux.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

At any one time it will only show you the ghosted elements for one processor ID.

Normally, this class shouldn't be used directly. Instead set it up through the (DisplayGhostingAction.md).
Normally, this class shouldn't be used directly. Instead set it up through the [DisplayGhostingAction.md].

!row!
!col! class=s12 m6 l6
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# BreakMeshByElementGenerator

!syntax description /Mesh/BreakMeshByElementGenerator

## Overview

The `BreakMeshByElementGenerator` is used to break all element-element interfaces in specified subdomains. All element-element interfaces are grouped into a boundary of user's choice.

## Example input syntax

In this example input file, we break all element-element interfaces in subdomains 1 and 2.

!listing test/tests/meshgenerators/explode_mesh_generator/2D.i block=Mesh

!syntax parameters /Mesh/BreakMeshByElementGenerator

!syntax inputs /Mesh/BreakMeshByElementGenerator

!syntax children /Mesh/BreakMeshByElementGenerator

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# SubdomainPerElementGenerator

!syntax description /Mesh/SubdomainPerElementGenerator

!syntax parameters /Mesh/SubdomainPerElementGenerator

!syntax inputs /Mesh/SubdomainPerElementGenerator

!syntax children /Mesh/SubdomainPerElementGenerator
2 changes: 1 addition & 1 deletion framework/doc/content/source/outputs/JSONOutput.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ provided at the top level and reporters values are nested within a list for the

## Distributed Output

If a Reporter value is computed with `REPORTER_MODE_DISTRIBUTED` (see [Reporters/index.md) a JSON
If a Reporter value is computed with `REPORTER_MODE_DISTRIBUTED` (see [Reporters/index.md] a JSON
file for each process will automatically be created with the distributed data and the total number
of parts and part number for the file will be included in the output.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

The GhostingUserObject maintains local data structures of elements involved in both
"Geometric" and "Algebraic" ghosting. This object is normally setup automatically through the
(DisplayGhostingAction.md).
[DisplayGhostingAction.md].

## Example Input Syntax:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
* A mesh generator to split a mesh by breaking all element-element interfaces in the
* specified subdomains
*/
class ExplodeMeshGenerator : public MeshGenerator
class BreakMeshByElementGenerator : public MeshGenerator
{
public:
static InputParameters validParams();

ExplodeMeshGenerator(const InputParameters & parameters);
BreakMeshByElementGenerator(const InputParameters & parameters);

std::unique_ptr<MeshBase> generate() override;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
/**
* MeshGenerator for assigning subdomain IDs of all elements
*/
class ElementSubdomainIDGenerator : public MeshGenerator
class SubdomainPerElementGenerator : public MeshGenerator
{
public:
static InputParameters validParams();

ElementSubdomainIDGenerator(const InputParameters & parameters);
SubdomainPerElementGenerator(const InputParameters & parameters);

std::unique_ptr<MeshBase> generate() override;

Expand Down
8 changes: 4 additions & 4 deletions framework/src/meshgenerators/BreakMeshByBlockGenerator.C
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ BreakMeshByBlockGenerator::validParams()
{
InputParameters params = BreakMeshByBlockGeneratorBase::validParams();
params.addRequiredParam<MeshGeneratorName>("input", "The mesh we want to modify");
params.addClassDescription("Break boundaries based on the subdomains to which their sides are "
"attached. Naming convention for the new boundaries will be the old "
"boundary name plus \"_to_\" plus the subdomain name. At the moment"
"this only works on REPLICATED mesh");
params.addClassDescription(
"Break the mesh at interfaces between blocks. New nodes will be generated so elements on "
"each side of the break are no longer connected. At the moment, this only works on a "
"REPLICATED mesh");
params.addParam<std::vector<SubdomainName>>(
"surrounding_blocks",
"The list of subdomain names surrounding which interfaces will be generated.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,20 @@
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html

#include "ExplodeMeshGenerator.h"
#include "BreakMeshByElementGenerator.h"
#include "CastUniquePointer.h"
#include "MooseMeshUtils.h"

#include "libmesh/partitioner.h"

registerMooseObject("MooseApp", ExplodeMeshGenerator);
registerMooseObject("MooseApp", BreakMeshByElementGenerator);
registerMooseObjectRenamed("MooseApp",
ExplodeMeshGenerator,
"05/18/2024 24:00",
BreakMeshByElementGenerator);

InputParameters
ExplodeMeshGenerator::validParams()
BreakMeshByElementGenerator::validParams()
{
InputParameters params = MeshGenerator::validParams();
params.addClassDescription("Break all element-element interfaces in the specified subdomains.");
Expand All @@ -27,7 +31,7 @@ ExplodeMeshGenerator::validParams()
return params;
}

ExplodeMeshGenerator::ExplodeMeshGenerator(const InputParameters & parameters)
BreakMeshByElementGenerator::BreakMeshByElementGenerator(const InputParameters & parameters)
: MeshGenerator(parameters),
_input(getMesh("input")),
_subdomains(getParam<std::vector<SubdomainID>>("subdomains")),
Expand All @@ -36,7 +40,7 @@ ExplodeMeshGenerator::ExplodeMeshGenerator(const InputParameters & parameters)
}

std::unique_ptr<MeshBase>
ExplodeMeshGenerator::generate()
BreakMeshByElementGenerator::generate()
{
std::unique_ptr<MeshBase> mesh = std::move(_input);

Expand All @@ -60,8 +64,8 @@ ExplodeMeshGenerator::generate()
return dynamic_pointer_cast<MeshBase>(mesh);
}

ExplodeMeshGenerator::NodeToElemMapType
ExplodeMeshGenerator::buildSubdomainRestrictedNodeToElemMap(
BreakMeshByElementGenerator::NodeToElemMapType
BreakMeshByElementGenerator::buildSubdomainRestrictedNodeToElemMap(
std::unique_ptr<MeshBase> & mesh, const std::vector<SubdomainID> & subdomains) const
{
NodeToElemMapType node_to_elem_map;
Expand Down Expand Up @@ -97,8 +101,8 @@ ExplodeMeshGenerator::buildSubdomainRestrictedNodeToElemMap(
}

void
ExplodeMeshGenerator::duplicateNodes(std::unique_ptr<MeshBase> & mesh,
const NodeToElemMapType & node_to_elem_map) const
BreakMeshByElementGenerator::duplicateNodes(std::unique_ptr<MeshBase> & mesh,
const NodeToElemMapType & node_to_elem_map) const
{
for (const auto & [node_id, connected_elem_ids] : node_to_elem_map)
for (auto & connected_elem_id : connected_elem_ids)
Expand All @@ -107,9 +111,9 @@ ExplodeMeshGenerator::duplicateNodes(std::unique_ptr<MeshBase> & mesh,
}

void
ExplodeMeshGenerator::duplicateNode(std::unique_ptr<MeshBase> & mesh,
Elem * elem,
const Node * node) const
BreakMeshByElementGenerator::duplicateNode(std::unique_ptr<MeshBase> & mesh,
Elem * elem,
const Node * node) const
{
std::unique_ptr<Node> new_node = Node::build(*node, Node::invalid_id);
new_node->processor_id() = elem->processor_id();
Expand All @@ -129,8 +133,8 @@ ExplodeMeshGenerator::duplicateNode(std::unique_ptr<MeshBase> & mesh,
}

void
ExplodeMeshGenerator::createInterface(MeshBase & mesh,
const NodeToElemMapType & node_to_elem_map) const
BreakMeshByElementGenerator::createInterface(MeshBase & mesh,
const NodeToElemMapType & node_to_elem_map) const
{
BoundaryInfo & boundary_info = mesh.get_boundary_info();
const auto & existing_boundary_ids = boundary_info.get_boundary_ids();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,19 @@
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html

#include "ElementSubdomainIDGenerator.h"
#include "SubdomainPerElementGenerator.h"
#include "CastUniquePointer.h"

#include "libmesh/elem.h"

registerMooseObject("MooseApp", ElementSubdomainIDGenerator);
registerMooseObject("MooseApp", SubdomainPerElementGenerator);
registerMooseObjectRenamed("MooseApp",
ElementSubdomainIDGenerator,
"05/18/2024 24:00",
SubdomainPerElementGenerator);

InputParameters
ElementSubdomainIDGenerator::validParams()
SubdomainPerElementGenerator::validParams()
{
InputParameters params = MeshGenerator::validParams();

Expand All @@ -28,13 +32,13 @@ ElementSubdomainIDGenerator::validParams()
return params;
}

ElementSubdomainIDGenerator::ElementSubdomainIDGenerator(const InputParameters & parameters)
SubdomainPerElementGenerator::SubdomainPerElementGenerator(const InputParameters & parameters)
: MeshGenerator(parameters), _input(getMesh("input"))
{
}

std::unique_ptr<MeshBase>
ElementSubdomainIDGenerator::generate()
SubdomainPerElementGenerator::generate()
{
std::unique_ptr<MeshBase> mesh = std::move(_input);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ The coupling between concentration and chemical potential is generated using the
- [`MatReaction`](/MatReaction.md) (multiple kernels: one that corresponds with each order parameter)
- ['BodyForce'](/BodyForce.md) (multiple kernels: one that corresponds with each order parameter)

The materials associated with strict mass conservation can be created automatically using GrandPotentialSinteringMaterial (/GrandPotentialSinteringMaterial.md)
The materials associated with strict mass conservation can be created automatically using [GrandPotentialSinteringMaterial.md]

## Example Input File Syntax

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
zmax = 4
[../]
[./subdomain_id]
type = ElementSubdomainIDGenerator
type = SubdomainPerElementGenerator
input = msh
subdomain_ids = '0 1 2 3'
[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
[]
[./subdomain_id]
input = gen
type = ElementSubdomainIDGenerator
type = SubdomainPerElementGenerator
subdomain_ids = '0 1
0 1'
[../]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
[]

[subdomain_id]
type = ElementSubdomainIDGenerator
type = SubdomainPerElementGenerator
input = gen
element_ids = '1 2 3'
subdomain_ids = '1 1 1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
[]

[subdomain_id]
type = ElementSubdomainIDGenerator
type = SubdomainPerElementGenerator
input = gen
subdomain_ids = '0 1
1 1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
[]

[subdomain_id]
type = ElementSubdomainIDGenerator
type = SubdomainPerElementGenerator
input = gen
subdomain_ids = '0 1 1 1
1 1 1 0'
Expand Down
2 changes: 1 addition & 1 deletion test/tests/meshgenerators/explode_mesh_generator/2D.i
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
top_right = '1 2 0'
[]
[explode]
type = ExplodeMeshGenerator
type = BreakMeshByElementGenerator
input = add_subdomain_3
subdomains = '1 2'
interface_name = czm
Expand Down
2 changes: 1 addition & 1 deletion test/tests/meshgenerators/explode_mesh_generator/3D.i
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
top_right = '1 2 1'
[]
[explode]
type = ExplodeMeshGenerator
type = BreakMeshByElementGenerator
input = add_subdomain_3
subdomains = '1 2'
interface_name = czm
Expand Down
4 changes: 2 additions & 2 deletions test/tests/meshgenerators/explode_mesh_generator/tests
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[all]
requirement = 'The system shall have the ability to break all element-element interfaces within '
'given subdomains both'
design = 'meshgenerators/ExplodeMeshGenerator.md'
design = 'meshgenerators/BreakMeshByElementGenerator.md'
issues = '#21060 #22117'
[2D]
type = 'Exodiff'
Expand Down Expand Up @@ -30,7 +30,7 @@
cli_args = 'Mesh/explode/subdomains="100"'
expect_err = "The block ID '100' was not found in the mesh"
requirement = "The system shall report an error if the subdomain to explode was not found in the mesh"
design = 'meshgenerators/ExplodeMeshGenerator.md'
design = 'meshgenerators/BreakMeshByElementGenerator.md'
issues = '#22117'
[]
[]
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
[]

[./subdomains]
type = ElementSubdomainIDGenerator
type = SubdomainPerElementGenerator
input = gmg
subdomain_ids = '0 0 0 0
0 0 0 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
[]

[./subdomain_id]
type = ElementSubdomainIDGenerator
type = SubdomainPerElementGenerator
input = gmg
subdomain_ids = '0 0 0 0
1 1 1 3
Expand Down
2 changes: 1 addition & 1 deletion test/tests/postprocessors/point_value/point_value.i
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[]
[./subdomain]
input = gen
type = ElementSubdomainIDGenerator
type = SubdomainPerElementGenerator
element_ids = '0 1 2 3'
subdomain_ids = '1 2 3 4'
[../]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
[]

[./subdomain_id]
type = ElementSubdomainIDGenerator
type = SubdomainPerElementGenerator
input = gmg
subdomain_ids = '0 1 2
0 1 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
[]

[./subdomain_id]
type = ElementSubdomainIDGenerator
type = SubdomainPerElementGenerator
input = gmg
subdomain_ids = '0 1 2 3 4
0 1 2 3 4
Expand Down
Loading

0 comments on commit 9235009

Please sign in to comment.