https://mooseframework.inl.gov
Loading...
Searching...
No Matches
SurfaceMeshBySubdomainBuilder.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
11#include "InputParameters.h"
12
14
17{
19 params.renameParam("boundary_mesh",
20 "complete_boundary_mesh",
21 "The saved mesh containing the complete boundary of each subdomain.");
23 "Builds one SurfaceElementSet per subdomain from a given surface mesh.");
24 return params;
25}
26
31
32void
34{
35 // Run the shared mesh setup/validation, then build the per-subdomain
36 // grouping. This builder's consumers read it via
37 // getSurfaceElementSetsBySubdomain(), not surfaceElementSet(), so the base
38 // class's lazy whole-mesh set is simply never triggered.
41}
42
43void
45{
46 // Group active elements by subdomain, then build one SurfaceElementSet per group.
47 std::unordered_map<subdomain_id_type, std::vector<const Elem *>> elems_by_subdomain;
48 for (const auto * elem : _mesh->active_element_ptr_range())
49 elems_by_subdomain[elem->subdomain_id()].push_back(elem);
50
51 for (const auto & [sid, elems] : elems_by_subdomain)
53}
registerMooseObject("ShiftedBoundaryMethodApp", SurfaceMeshBySubdomainBuilder)
static InputParameters validParams()
virtual void initialSetup() override
std::unique_ptr< MeshBase > _mesh
void renameParam(const std::string &old_name, const std::string &new_name, const std::string &new_docstring)
void addClassDescription(const std::string &doc_string)
static SurfaceElementSet fromElements(const std::vector< const Elem * > &elems)
BoundaryMeshBuilder specialization that groups the surface elements by subdomain, building one Surfac...
SurfaceMeshBySubdomainBuilder(const InputParameters &parameters)
std::unordered_map< subdomain_id_type, SurfaceElementSet > _sets_by_subdomain
SurfaceElementSet instances grouped by subdomain ID.
void buildSetsBySubdomain()
Builds one SurfaceElementSet per subdomain, independent of the base class's whole-mesh set.