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{
20 "Builds one SurfaceElementSet per subdomain from a given surface mesh.");
21 return params;
22}
23
28
29void
31{
32 // Run the shared mesh setup/validation, then build the per-subdomain
33 // grouping. This builder's consumers read it via
34 // getSurfaceElementSetsBySubdomain(), not surfaceElementSet(), so the base
35 // class's lazy whole-mesh set is simply never triggered.
38}
39
40void
42{
43 // Group active elements by subdomain, then build one SurfaceElementSet per group.
44 std::unordered_map<subdomain_id_type, std::vector<const Elem *>> elems_by_subdomain;
45 for (const auto * elem : _mesh->active_element_ptr_range())
46 elems_by_subdomain[elem->subdomain_id()].push_back(elem);
47
48 for (const auto & [sid, elems] : elems_by_subdomain)
50}
registerMooseObject("ShiftedBoundaryMethodApp", SurfaceMeshBySubdomainBuilder)
static InputParameters validParams()
virtual void initialSetup() override
std::unique_ptr< MeshBase > _mesh
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
void buildSetsBySubdomain()
Builds one SurfaceElementSet per subdomain, independent of the base class's whole-mesh set.