idaholab/moose: framework coverage diff

Base d7c4bd Head #33187 5aa0b2
Total Total +/- New
Rate 85.99% 85.99% -0.00% 100.00%
Hits 136168 136168 - 20
Misses 22185 22189 +4 0
Filename Stmts Miss Cover
framework/src/utils/MooseMeshUtils.C +4 +4 -0.45%
TOTAL +4 +4 -0.00%
code
coverage unchanged
code
coverage increased
code
coverage decreased
+
line added or modified

framework/src/meshgenerators/BreakBoundaryOnSubdomainGenerator.C

53  
54  
55  
56 +
57  
58  
59  
    for (auto & boundary_name : boundary_names)
    {
      // check that the boundary exists in the mesh
      if (!MooseMeshUtils::hasBoundaryNameOrID(*mesh, boundary_name))
        paramError("boundaries", "The boundary '", boundary_name, "' was not found in the mesh");

      breaking_boundary_ids.insert(boundary_info.get_id_by_name(boundary_name));

framework/src/meshgenerators/CircularBoundaryCorrectionGenerator.C

91  
92  
93  
94 +
95  
96  
97  
  // Check if the input mesh has the given boundaries
  for (const auto & bd : _input_mesh_circular_boundaries)
  {
    if (!MooseMeshUtils::hasBoundaryNameOrID(*input_mesh, bd))
      paramError("input_mesh_circular_boundaries",
                 "the boundary '" + bd + "' does not exist in the input mesh.");
  }

framework/src/meshgenerators/CutMeshByLevelSetGeneratorBase.C

98  
99  
100  
101 +
102  
103  
104  

  if (!_cut_face_name.empty())
  {
    if (MooseMeshUtils::hasBoundaryNameOrID(mesh, _cut_face_name))
    {
      const boundary_id_type exist_cut_face_id =
          MooseMeshUtils::getBoundaryID(_cut_face_name, mesh);

framework/src/meshgenerators/MeshDiagnosticsGenerator.C

153  
154  
155  
156 +
157  
158  
159  
  // check that specified boundary is valid, convert BoundaryNames to BoundaryIDs, and sort
  for (const auto & boundary_name : _watertight_boundary_names)
  {
    if (!MooseMeshUtils::hasBoundaryNameOrID(*mesh, boundary_name))
      mooseError("User specified boundary_to_check \'", boundary_name, "\' does not exist");
  }
  _watertight_boundaries = MooseMeshUtils::getBoundaryIDs(*mesh, _watertight_boundary_names, false);

framework/src/transfers/MultiAppGeneralFieldTransfer.C

273  
274  
275  
276 +
277  
278  
279  
    {
      const auto & boundary_names = getParam<std::vector<BoundaryName>>("from_boundaries");
      for (const auto & bn : boundary_names)
        if (!MooseMeshUtils::hasBoundaryNameOrID(from_moose_mesh.getMesh(), bn))
          paramError("from_boundaries", "The boundary '", bn, "' was not found in the mesh");

      if (!boundary_names.empty())
352  
353  
354  
355 +
356  
357  
358  
    {
      const auto & boundary_names = getParam<std::vector<BoundaryName>>("to_boundaries");
      for (const auto & bn : boundary_names)
        if (!MooseMeshUtils::hasBoundaryNameOrID(to_moose_mesh.getMesh(), bn))
          paramError("to_boundaries", "The boundary '", bn, "' was not found in the mesh");

      if (!boundary_names.empty())

framework/src/transfers/MultiAppNearestNodeTransfer.C

92  
93  
94  
95 +
96  
97  
98  
    if (_from_meshes.size())
    {
      const auto & sb = getParam<BoundaryName>("source_boundary");
      if (!MooseMeshUtils::hasBoundaryNameOrID(_from_meshes[0]->getMesh(), sb))
        paramError("source_boundary", "The boundary '", sb, "' was not found in the mesh");

      bboxes = getFromBoundingBoxes(_from_meshes[0]->getBoundaryID(sb));
726  
727  
728  
729 +
730  
731  
732  
  {
    const auto & sb = getParam<BoundaryName>("source_boundary");
    BoundaryID src_bnd_id = mesh->getBoundaryID(sb);
    if (!MooseMeshUtils::hasBoundaryNameOrID(mesh_base, sb))
      paramError("source_boundary", "The boundary '", sb, "' was not found in the mesh");

    if (is_nodal)
820  
821  
822  
823 +
824  
825  
826  
    const std::vector<BoundaryName> & target_boundaries =
        getParam<std::vector<BoundaryName>>("target_boundary");
    for (const auto & b : target_boundaries)
      if (!MooseMeshUtils::hasBoundaryNameOrID(to_mesh, b))
        paramError("target_boundary", "The boundary '", b, "' was not found in the mesh");

    ConstBndNodeRange & bnd_nodes = *(_to_meshes[to_problem_id])->getBoundaryNodeRange();

framework/src/transfers/MultiAppUserObjectTransfer.C

177  
178  
179  
180 +
181  
182  
183  
            const std::vector<BoundaryName> & boundary_names =
                getParam<std::vector<BoundaryName>>("boundary");
            for (const auto & b : boundary_names)
              if (!MooseMeshUtils::hasBoundaryNameOrID(*mesh, b))
                paramError("boundary", "The boundary '", b, "' was not found in the mesh");

            std::vector<BoundaryID> ids = mesh->getBoundaryIDs(boundary_names, true);
327  
328  
329  
330 +
331  
332  
333  
        const std::vector<BoundaryName> & boundary_names =
            getParam<std::vector<BoundaryName>>("boundary");
        for (const auto & b : boundary_names)
          if (!MooseMeshUtils::hasBoundaryNameOrID(*to_mesh, b))
            paramError("boundary", "The boundary '", b, "' was not found in the mesh");

        std::vector<BoundaryID> ids = to_mesh->getBoundaryIDs(boundary_names, true);

framework/src/utils/MooseMeshElementConversionUtils.C

1100  
1101  
1102  
1103 +
1104  
1105  
1106  
  std::vector<boundary_id_type> boundary_ids;
  for (const auto & sideset : boundary_names)
  {
    if (!MooseMeshUtils::hasBoundaryNameOrID(mesh, sideset))
      throw MooseException("The provided boundary '", sideset, "' was not found within the mesh");
    boundary_ids.push_back(MooseMeshUtils::getBoundaryID(sideset, mesh));
    MooseMeshUtils::changeBoundaryId(mesh, boundary_ids.back(), uniform_tmp_bid, false);

framework/src/utils/MooseMeshUtils.C

563  
564  
565  
566 +
567  
568 +
569 +
570 +
571  
572  
573  
574 +
575  
576 +
577 +
578  
579  
580  
}

bool
hasBoundaryName(const MeshBase & mesh, const BoundaryName & name)
{
  const BoundaryInfo & boundary_info = mesh.get_boundary_info();
  const BoundaryID id = boundary_info.get_id_by_name(name);
  return id != Moose::INVALID_BOUNDARY_ID;
}

bool
hasBoundaryNameOrID(const MeshBase & mesh, const BoundaryName & name_or_id)
{
  const auto id = getBoundaryID(name_or_id, mesh);
  return hasBoundaryID(mesh, id);
}

void
1045  
1046  
1047  
1048 +
1049  
1050  
1051  

  // Check that the sidesets are present in the mesh
  for (const auto & sideset : boundary_names)
    if (!MooseMeshUtils::hasBoundaryNameOrID(mesh, sideset))
      mooseException("The sideset '", sideset, "' was not found within the mesh");

  auto sideset_ids = MooseMeshUtils::getBoundaryIDs(mesh, boundary_names, true);