LCOV - code coverage report
Current view: top level - src/meshgenerators - FillBetweenPointVectorsGenerator.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 2bf808 Lines: 54 55 98.2 %
Date: 2025-07-17 01:28:37 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       14369 : FillBetweenPointVectorsGenerator::validParams()
      17             : {
      18       14369 :   InputParameters params = MeshGenerator::validParams();
      19       14369 :   params.addRequiredParam<std::vector<Point>>("positions_vector_1",
      20             :                                               "Array of the node positions of the first boundary.");
      21       14369 :   params.addRequiredParam<std::vector<Point>>(
      22             :       "positions_vector_2", "Array of the node positions of the second boundary.");
      23       14369 :   params.addRequiredRangeCheckedParam<unsigned int>(
      24             :       "num_layers", "num_layers>0", "Layers of elements for transition.");
      25       14369 :   params.addParam<subdomain_id_type>("block_id", 1, "ID to be assigned to the block.");
      26       43107 :   params.addParam<boundary_id_type>(
      27             :       "input_boundary_1_id",
      28       28738 :       10000,
      29             :       "Boundary ID to be assigned to the boundary defined by positions_vector_1.");
      30       43107 :   params.addParam<boundary_id_type>(
      31             :       "input_boundary_2_id",
      32       28738 :       10000,
      33             :       "Boundary ID to be assigned to the boundary defined by positions_vector_2.");
      34       43107 :   params.addParam<boundary_id_type>("begin_side_boundary_id",
      35       28738 :                                     10000,
      36             :                                     "Boundary ID to be assigned to the boundary connecting "
      37             :                                     "starting points of the positions_vectors.");
      38       43107 :   params.addParam<boundary_id_type>("end_side_boundary_id",
      39       28738 :                                     10000,
      40             :                                     "Boundary ID to be assigned to the boundary connecting ending "
      41             :                                     "points of the positions_vectors.");
      42       43107 :   params.addParam<bool>(
      43             :       "use_quad_elements",
      44       28738 :       false,
      45             :       "Whether QUAD4 instead of TRI3 elements are used to construct the transition layer.");
      46       43107 :   params.addRangeCheckedParam<Real>(
      47             :       "bias_parameter",
      48       28738 :       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       43107 :   params.addRangeCheckedParam<Real>(
      54             :       "gaussian_sigma",
      55       28738 :       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       14369 :   params.addClassDescription(
      60             :       "This FillBetweenPointVectorsGenerator object is designed to generate a "
      61             :       "transition layer with two sides containing different numbers of nodes.");
      62       14369 :   return params;
      63           0 : }
      64             : 
      65          52 : FillBetweenPointVectorsGenerator::FillBetweenPointVectorsGenerator(
      66          52 :     const InputParameters & parameters)
      67             :   : MeshGenerator(parameters),
      68          52 :     _positions_vector_1(getParam<std::vector<Point>>("positions_vector_1")),
      69          52 :     _positions_vector_2(getParam<std::vector<Point>>("positions_vector_2")),
      70          52 :     _num_layers(getParam<unsigned int>("num_layers")),
      71          52 :     _block_id(getParam<subdomain_id_type>("block_id")),
      72          52 :     _input_boundary_1_id(getParam<boundary_id_type>("input_boundary_1_id")),
      73          52 :     _input_boundary_2_id(getParam<boundary_id_type>("input_boundary_2_id")),
      74          52 :     _begin_side_boundary_id(getParam<boundary_id_type>("begin_side_boundary_id")),
      75          52 :     _end_side_boundary_id(getParam<boundary_id_type>("end_side_boundary_id")),
      76          52 :     _use_quad_elements(getParam<bool>("use_quad_elements")),
      77          52 :     _bias_parameter(getParam<Real>("bias_parameter")),
      78         104 :     _sigma(getParam<Real>("gaussian_sigma"))
      79             : {
      80          52 : }
      81             : 
      82             : std::unique_ptr<MeshBase>
      83          52 : FillBetweenPointVectorsGenerator::generate()
      84             : {
      85          52 :   auto mesh = buildReplicatedMesh(2);
      86          52 :   FillBetweenPointVectorsTools::fillBetweenPointVectorsGenerator(*mesh,
      87          52 :                                                                  _positions_vector_2,
      88          52 :                                                                  _positions_vector_1,
      89          52 :                                                                  _num_layers,
      90          52 :                                                                  _block_id,
      91          52 :                                                                  _input_boundary_2_id,
      92          52 :                                                                  _input_boundary_1_id,
      93          52 :                                                                  _begin_side_boundary_id,
      94          52 :                                                                  _end_side_boundary_id,
      95          52 :                                                                  _type,
      96          52 :                                                                  _name,
      97          52 :                                                                  _use_quad_elements,
      98          52 :                                                                  _bias_parameter,
      99          52 :                                                                  _sigma);
     100          80 :   return mesh;
     101          40 : }

Generated by: LCOV version 1.14