LCOV - code coverage report
Current view: top level - src/meshgenerators - FillBetweenPointVectorsGenerator.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: #32971 (54bef8) with base c6cf66 Lines: 54 55 98.2 %
Date: 2026-05-29 20:35:17 Functions: 3 3 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       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             : 
      10             : #include "FillBetweenPointVectorsGenerator.h"
      11             : #include "FillBetweenPointVectorsTools.h"
      12             : 
      13             : registerMooseObject("MooseApp", FillBetweenPointVectorsGenerator);
      14             : 
      15             : InputParameters
      16        3159 : FillBetweenPointVectorsGenerator::validParams()
      17             : {
      18        3159 :   InputParameters params = MeshGenerator::validParams();
      19       12636 :   params.addRequiredParam<std::vector<Point>>("positions_vector_1",
      20             :                                               "Array of the node positions of the first boundary.");
      21       12636 :   params.addRequiredParam<std::vector<Point>>(
      22             :       "positions_vector_2", "Array of the node positions of the second boundary.");
      23       18954 :   params.addRequiredRangeCheckedParam<unsigned int>(
      24             :       "num_layers", "num_layers>0", "Layers of elements for transition.");
      25       12636 :   params.addParam<subdomain_id_type>("block_id", 1, "ID to be assigned to the block.");
      26        9477 :   params.addParam<boundary_id_type>(
      27             :       "input_boundary_1_id",
      28        6318 :       10000,
      29             :       "Boundary ID to be assigned to the boundary defined by positions_vector_1.");
      30        9477 :   params.addParam<boundary_id_type>(
      31             :       "input_boundary_2_id",
      32        6318 :       10000,
      33             :       "Boundary ID to be assigned to the boundary defined by positions_vector_2.");
      34        9477 :   params.addParam<boundary_id_type>("begin_side_boundary_id",
      35        6318 :                                     10000,
      36             :                                     "Boundary ID to be assigned to the boundary connecting "
      37             :                                     "starting points of the positions_vectors.");
      38        9477 :   params.addParam<boundary_id_type>("end_side_boundary_id",
      39        6318 :                                     10000,
      40             :                                     "Boundary ID to be assigned to the boundary connecting ending "
      41             :                                     "points of the positions_vectors.");
      42        9477 :   params.addParam<bool>(
      43             :       "use_quad_elements",
      44        6318 :       false,
      45             :       "Whether QUAD4 instead of TRI3 elements are used to construct the transition layer.");
      46       15795 :   params.addRangeCheckedParam<Real>(
      47             :       "bias_parameter",
      48        6318 :       1.0,
      49             :       "bias_parameter>=0",
      50             :       "Parameter used to set up biasing of the layers: bias_parameter > 0.0 is used as the biasing "
      51             :       "factor; bias_parameter = 0.0 activates automatic biasing based on local node density on "
      52             :       "both input boundaries.");
      53       15795 :   params.addRangeCheckedParam<Real>(
      54             :       "gaussian_sigma",
      55        6318 :       3.0,
      56             :       "gaussian_sigma>0.0",
      57             :       "Gaussian parameter used to smoothen local node density for automatic biasing; this "
      58             :       "parameter is not used if other biasing option is selected.");
      59        3159 :   params.addClassDescription(
      60             :       "This FillBetweenPointVectorsGenerator object is designed to generate a "
      61             :       "transition layer with two sides containing different numbers of nodes.");
      62        3159 :   return params;
      63           0 : }
      64             : 
      65          49 : FillBetweenPointVectorsGenerator::FillBetweenPointVectorsGenerator(
      66          49 :     const InputParameters & parameters)
      67             :   : MeshGenerator(parameters),
      68          49 :     _positions_vector_1(getParam<std::vector<Point>>("positions_vector_1")),
      69          98 :     _positions_vector_2(getParam<std::vector<Point>>("positions_vector_2")),
      70          98 :     _num_layers(getParam<unsigned int>("num_layers")),
      71          98 :     _block_id(getParam<subdomain_id_type>("block_id")),
      72          98 :     _input_boundary_1_id(getParam<boundary_id_type>("input_boundary_1_id")),
      73          98 :     _input_boundary_2_id(getParam<boundary_id_type>("input_boundary_2_id")),
      74          98 :     _begin_side_boundary_id(getParam<boundary_id_type>("begin_side_boundary_id")),
      75          98 :     _end_side_boundary_id(getParam<boundary_id_type>("end_side_boundary_id")),
      76          98 :     _use_quad_elements(getParam<bool>("use_quad_elements")),
      77          98 :     _bias_parameter(getParam<Real>("bias_parameter")),
      78         147 :     _sigma(getParam<Real>("gaussian_sigma"))
      79             : {
      80          49 : }
      81             : 
      82             : std::unique_ptr<MeshBase>
      83          49 : FillBetweenPointVectorsGenerator::generate()
      84             : {
      85          49 :   auto mesh = buildReplicatedMesh(2);
      86          49 :   FillBetweenPointVectorsTools::fillBetweenPointVectorsGenerator(*mesh,
      87          49 :                                                                  _positions_vector_2,
      88          49 :                                                                  _positions_vector_1,
      89          49 :                                                                  _num_layers,
      90          49 :                                                                  _block_id,
      91          49 :                                                                  _input_boundary_2_id,
      92          49 :                                                                  _input_boundary_1_id,
      93          49 :                                                                  _begin_side_boundary_id,
      94          49 :                                                                  _end_side_boundary_id,
      95          49 :                                                                  _type,
      96          49 :                                                                  _name,
      97          49 :                                                                  _use_quad_elements,
      98          49 :                                                                  _bias_parameter,
      99          49 :                                                                  _sigma);
     100          80 :   return mesh;
     101          40 : }

Generated by: LCOV version 1.14