https://mooseframework.inl.gov
Component2D.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 
10 #include "Component2D.h"
11 #include "THMMesh.h"
12 #include "THMEnums.h"
13 
14 const std::map<std::string, Component2D::ExternalBoundaryType>
15  Component2D::_external_boundary_type_to_enum{{"INNER", ExternalBoundaryType::INNER},
16  {"OUTER", ExternalBoundaryType::OUTER},
17  {"START", ExternalBoundaryType::START},
18  {"END", ExternalBoundaryType::END}};
19 
22 {
23  return THM::getMooseEnum<ExternalBoundaryType>(name, _external_boundary_type_to_enum);
24 }
25 
26 template <>
28 THM::stringToEnum(const std::string & s)
29 {
30  return stringToEnum<Component2D::ExternalBoundaryType>(
32 }
33 
36 {
38  return params;
39 }
40 
42  : GeneratedMeshComponent(params), _n_regions(0), _total_elem_number(0), _axial_offset(0.0)
43 {
44 }
45 
46 void
48 {
50 
51  if (getParam<std::vector<std::string>>("axial_region_names").size())
52  checkEqualSize<std::string, Real>("axial_region_names", "length");
53  else if (_n_sections > 1)
54  logError("If there is more than 1 axial region, then the parameter 'axial_region_names' must "
55  "be specified.");
56 }
57 
58 bool
59 Component2D::hasBlock(const std::string & name) const
60 {
61  return std::find(_names.begin(), _names.end(), name) != _names.end();
62 }
63 
64 void
66 {
67  unsigned int n_axial_positions = _node_locations.size();
68  std::vector<std::vector<unsigned int>> node_ids(
69  n_axial_positions, std::vector<unsigned int>(_total_elem_number + 1));
70 
71  // loop over axial positions
72  for (unsigned int i = 0; i < n_axial_positions; i++)
73  {
74  Point p(_node_locations[i], _axial_offset, 0);
75 
76  Node * nd = addNode(p);
77  node_ids[i][0] = nd->id();
78 
79  // loop over regions
80  unsigned int l = 1;
81  for (unsigned int j = 0; j < _n_regions; j++)
82  {
83  Real elem_length = _width[j] / _n_part_elems[j];
84  for (unsigned int k = 0; k < _n_part_elems[j]; k++, l++)
85  {
86  p(1) += elem_length;
87  nd = addNode(p);
88  node_ids[i][l] = nd->id();
89  }
90  }
91  }
92 
93  auto & boundary_info = mesh().getMesh().get_boundary_info();
94 
95  // create elements from nodes
96  unsigned int i = 0;
97  for (unsigned int i_section = 0; i_section < _n_sections; i_section++)
98  {
99  // element axial index for end of axial section
100  unsigned int i_section_end = 0;
101  for (unsigned int ii_section = 0; ii_section <= i_section; ++ii_section)
102  i_section_end += _n_elems[ii_section];
103  i_section_end -= 1;
104 
105  for (unsigned int i_local = 0; i_local < _n_elems[i_section]; i_local++)
106  {
107  unsigned int j = 0;
108  for (unsigned int j_section = 0; j_section < _n_regions; j_section++)
109  for (unsigned int j_local = 0; j_local < _n_part_elems[j_section]; j_local++)
110  {
111  Elem * elem = addElementQuad4(
112  node_ids[i][j + 1], node_ids[i][j], node_ids[i + 1][j], node_ids[i + 1][j + 1]);
113  elem->subdomain_id() = _subdomain_ids[j_section];
114 
115  // exterior axial boundaries (all radial sections)
116  if (i == 0)
117  {
118  boundary_info.add_side(elem, 0, _start_bc_id);
120  std::tuple<dof_id_type, unsigned short int>(elem->id(), 0));
121  }
122  if (i == _n_elem - 1)
123  {
124  boundary_info.add_side(elem, 2, _end_bc_id);
126  std::tuple<dof_id_type, unsigned short int>(elem->id(), 2));
127  }
128 
129  // exterior axial boundaries (per radial section)
130  if (_names.size() > 1)
131  {
132  if (i == 0)
133  {
134  boundary_info.add_side(elem, 0, _radial_start_bc_id[j_section]);
135  _boundary_info[_boundary_names_radial_start[j_section]].push_back(
136  std::tuple<dof_id_type, unsigned short int>(elem->id(), 0));
137  }
138  if (i == _n_elem - 1)
139  {
140  boundary_info.add_side(elem, 2, _radial_end_bc_id[j_section]);
141  _boundary_info[_boundary_names_radial_end[j_section]].push_back(
142  std::tuple<dof_id_type, unsigned short int>(elem->id(), 2));
143  }
144  }
145 
146  // interior axial boundaries (per radial section)
147  if (_n_sections > 1 && _axial_region_names.size() == _n_sections &&
148  i_section != _n_sections - 1 && i == i_section_end)
149  {
150  const unsigned int k = i_section * _n_regions + j_section;
151  boundary_info.add_side(elem, 2, _interior_axial_per_radial_section_bc_id[k]);
153  std::tuple<dof_id_type, unsigned short int>(elem->id(), 2));
154  }
155 
156  // exterior radial boundaries (all axial sections)
157  if (j == 0)
158  {
159  boundary_info.add_side(elem, 1, _inner_bc_id);
161  std::tuple<dof_id_type, unsigned short int>(elem->id(), 1));
162  }
163  if (j == _total_elem_number - 1)
164  {
165  boundary_info.add_side(elem, 3, _outer_bc_id);
167  std::tuple<dof_id_type, unsigned short int>(elem->id(), 3));
168  }
169 
170  // exterior radial boundaries (per axial section)
171  if (_n_sections > 1 && _axial_region_names.size() == _n_sections)
172  {
173  if (j == 0)
174  {
175  boundary_info.add_side(elem, 1, _axial_inner_bc_id[i_section]);
176  _boundary_info[_boundary_names_axial_inner[i_section]].push_back(
177  std::tuple<dof_id_type, unsigned short int>(elem->id(), 1));
178  }
179  if (j == _total_elem_number - 1)
180  {
181  boundary_info.add_side(elem, 3, _axial_outer_bc_id[i_section]);
182  _boundary_info[_boundary_names_axial_outer[i_section]].push_back(
183  std::tuple<dof_id_type, unsigned short int>(elem->id(), 3));
184  }
185  }
186 
187  // interior radial boundaries (all axial sections)
188  if (_n_regions > 1 && _names.size() == _n_regions && j_section != 0)
189  {
190  unsigned int j_section_begin = 0;
191  for (unsigned int jj_section = 0; jj_section < j_section; ++jj_section)
192  j_section_begin += _n_part_elems[jj_section];
193 
194  if (j == j_section_begin)
195  {
196  boundary_info.add_side(elem, 1, _inner_radial_bc_id[j_section - 1]);
197  _boundary_info[_boundary_names_inner_radial[j_section - 1]].push_back(
198  std::tuple<dof_id_type, unsigned short int>(elem->id(), 1));
199  }
200  }
201 
202  j++;
203  }
204 
205  i++;
206  }
207  }
208 }
209 
210 void
212 {
213  unsigned int n_axial_positions = _node_locations.size();
214  std::vector<std::vector<unsigned int>> node_ids(
215  n_axial_positions, std::vector<unsigned int>(2 * _total_elem_number + 1));
216 
217  // loop over axial positions
218  for (unsigned int i = 0; i < n_axial_positions; i++)
219  {
220  Point p(_node_locations[i], _axial_offset, 0);
221 
222  const Node * nd = addNode(p);
223  node_ids[i][0] = nd->id();
224 
225  // loop over regions
226  unsigned int l = 1;
227  for (unsigned int j = 0; j < _n_regions; j++)
228  {
229  Real elem_length = _width[j] / (2. * _n_part_elems[j]);
230  for (unsigned int k = 0; k < 2. * _n_part_elems[j]; k++, l++)
231  {
232  p(1) += elem_length;
233  nd = addNode(p);
234  node_ids[i][l] = nd->id();
235  }
236  }
237  }
238 
239  auto & boundary_info = mesh().getMesh().get_boundary_info();
240 
241  // create elements from nodes
242  unsigned int i = 0;
243  for (unsigned int i_section = 0; i_section < _n_sections; i_section++)
244  for (unsigned int i_local = 0; i_local < _n_elems[i_section]; i_local++)
245  {
246  unsigned int j = 0;
247  for (unsigned int j_section = 0; j_section < _n_regions; j_section++)
248  for (unsigned int j_local = 0; j_local < _n_part_elems[j_section]; j_local++)
249  {
250  Elem * elem = addElementQuad9(node_ids[2 * i][2 * j],
251  node_ids[2 * i][2 * (j + 1)],
252  node_ids[2 * (i + 1)][2 * (j + 1)],
253  node_ids[2 * (i + 1)][2 * j],
254  node_ids[2 * i][(2 * j) + 1],
255  node_ids[(2 * i) + 1][2 * (j + 1)],
256  node_ids[2 * (i + 1)][(2 * j) + 1],
257  node_ids[(2 * i) + 1][(2 * j)],
258  node_ids[(2 * i) + 1][(2 * j) + 1]);
259  elem->subdomain_id() = _subdomain_ids[j_section];
260 
261  if (i == 0)
262  {
263  boundary_info.add_side(elem, 0, _start_bc_id);
265  std::tuple<dof_id_type, unsigned short int>(elem->id(), 0));
266  }
267  if (i == _n_elem - 1)
268  {
269  boundary_info.add_side(elem, 2, _end_bc_id);
271  std::tuple<dof_id_type, unsigned short int>(elem->id(), 2));
272  }
273  if (_names.size() > 1)
274  {
275  if (i == 0)
276  {
277  boundary_info.add_side(elem, 0, _radial_start_bc_id[j_section]);
278  _boundary_info[_boundary_names_radial_start[j_section]].push_back(
279  std::tuple<dof_id_type, unsigned short int>(elem->id(), 0));
280  }
281  if (i == _n_elem - 1)
282  {
283  boundary_info.add_side(elem, 2, _radial_end_bc_id[j_section]);
284  _boundary_info[_boundary_names_radial_end[j_section]].push_back(
285  std::tuple<dof_id_type, unsigned short int>(elem->id(), 2));
286  }
287  }
288 
289  if (j == 0)
290  {
291  boundary_info.add_side(elem, 3, _inner_bc_id);
293  std::tuple<dof_id_type, unsigned short int>(elem->id(), 3));
294  }
295  if (j == _total_elem_number - 1)
296  {
297  boundary_info.add_side(elem, 1, _outer_bc_id);
299  std::tuple<dof_id_type, unsigned short int>(elem->id(), 1));
300  }
301 
302  if (_n_sections > 1 && _axial_region_names.size() == _n_sections)
303  {
304  if (j == 0)
305  {
306  boundary_info.add_side(elem, 1, _axial_inner_bc_id[i_section]);
307  _boundary_info[_boundary_names_axial_inner[i_section]].push_back(
308  std::tuple<dof_id_type, unsigned short int>(elem->id(), 1));
309  }
310  if (j == _total_elem_number - 1)
311  {
312  boundary_info.add_side(elem, 3, _axial_outer_bc_id[i_section]);
313  _boundary_info[_boundary_names_axial_outer[i_section]].push_back(
314  std::tuple<dof_id_type, unsigned short int>(elem->id(), 3));
315  }
316  }
317 
318  // interior radial boundaries
319  if (_n_regions > 1 && _names.size() == _n_regions && j_section != 0)
320  {
321  unsigned int j_section_begin = 0;
322  for (unsigned int jj_section = 0; jj_section < j_section; ++jj_section)
323  j_section_begin += _n_part_elems[jj_section];
324 
325  if (j == j_section_begin)
326  {
327  boundary_info.add_side(elem, 1, _inner_radial_bc_id[j_section - 1]);
328  _boundary_info[_boundary_names_inner_radial[j_section - 1]].push_back(
329  std::tuple<dof_id_type, unsigned short int>(elem->id(), 1));
330  }
331  }
332 
333  j++;
334  }
335 
336  i++;
337  }
338 }
339 
340 void
342 {
343  if (_n_part_elems.size() != _n_regions || _width.size() != _n_regions)
344  return;
345 
346  // Assign subdomain to each transverse region
347  for (unsigned int i = 0; i < _n_regions; i++)
348  {
349  // The coordinate system for MOOSE is always XYZ, even for axisymmetric
350  // components, since we do the RZ integration ourselves until we can set
351  // arbitrary number of axis symmetries in MOOSE.
352  setSubdomainInfo(mesh().getNextSubdomainId(), genName(_name, _names[i]), Moose::COORD_XYZ);
353  }
354 
355  // Create boundary IDs and associated boundary names
358  _boundary_name_inner = genName(name(), "inner");
359  _boundary_name_outer = genName(name(), "outer");
363  if (_n_sections > 1 && _axial_region_names.size() == _n_sections)
364  for (unsigned int i = 0; i < _n_sections; i++)
365  {
366  _axial_inner_bc_id.push_back(mesh().getNextBoundaryId());
367  _axial_outer_bc_id.push_back(mesh().getNextBoundaryId());
368  const BoundaryName boundary_name_axial_inner =
369  genName(name(), _axial_region_names[i], "inner");
370  const BoundaryName boundary_name_axial_outer =
371  genName(name(), _axial_region_names[i], "outer");
372  _boundary_names_axial_inner.push_back(boundary_name_axial_inner);
373  _boundary_names_axial_outer.push_back(boundary_name_axial_outer);
374  _boundary_name_to_area[boundary_name_axial_inner] =
376  _boundary_name_to_area[boundary_name_axial_outer] =
378  }
379 
380  // exterior axial boundaries
383  _boundary_name_start = genName(name(), "start");
384  _boundary_name_end = genName(name(), "end");
387  if (_names.size() > 1)
388  {
389  Real y1 = 0.0;
390  for (unsigned int i = 0; i < _names.size(); i++)
391  {
392  const Real y2 = y1 + _width[i];
393 
394  _radial_start_bc_id.push_back(mesh().getNextBoundaryId());
395  _radial_end_bc_id.push_back(mesh().getNextBoundaryId());
396  const BoundaryName boundary_name_radial_start = genName(name(), _names[i], "start");
397  const BoundaryName boundary_name_radial_end = genName(name(), _names[i], "end");
398  _boundary_names_radial_start.push_back(boundary_name_radial_start);
399  _boundary_names_radial_end.push_back(boundary_name_radial_end);
400  _boundary_name_to_area[boundary_name_radial_start] = computeAxialBoundaryArea(y1, y2);
401  _boundary_name_to_area[boundary_name_radial_end] = computeAxialBoundaryArea(y1, y2);
402  if (i != _names.size() - 1)
403  {
404  _inner_radial_bc_id.push_back(mesh().getNextBoundaryId());
405  const BoundaryName boundary_name_inner_radial = genName(name(), _names[i], _names[i + 1]);
406  _boundary_names_inner_radial.push_back(boundary_name_inner_radial);
407  _boundary_name_to_area[boundary_name_inner_radial] = computeRadialBoundaryArea(_length, y2);
408  }
409  y1 = y2;
410  }
411  }
412 
413  // interior axial boundaries
414  if (_n_sections > 1 && _axial_region_names.size() == _n_sections)
415  for (unsigned int i = 0; i < _n_sections - 1; i++)
416  {
417  Real y1 = 0.0;
418  for (unsigned int j = 0; j < _names.size(); j++)
419  {
420  const Real y2 = y1 + _width[j];
421 
422  _interior_axial_per_radial_section_bc_id.push_back(mesh().getNextBoundaryId());
423  const BoundaryName boundary_name_interior_axial_per_radial_section =
426  boundary_name_interior_axial_per_radial_section);
427  _boundary_name_to_area[boundary_name_interior_axial_per_radial_section] =
428  computeAxialBoundaryArea(y1, y2);
429  y1 = y2;
430  }
431  }
432 
433  // Build the mesh
434  if (usingSecondOrderMesh())
436  else
437  build2DMesh();
438 
439  // Set boundary names
440  auto & binfo = mesh().getMesh().get_boundary_info();
441  binfo.sideset_name(_inner_bc_id) = _boundary_name_inner;
442  binfo.sideset_name(_outer_bc_id) = _boundary_name_outer;
443  if (_n_sections > 1 && _axial_region_names.size() == _n_sections)
444  for (unsigned int i = 0; i < _n_sections; i++)
445  {
446  binfo.sideset_name(_axial_inner_bc_id[i]) = _boundary_names_axial_inner[i];
447  binfo.sideset_name(_axial_outer_bc_id[i]) = _boundary_names_axial_outer[i];
448  }
449  binfo.sideset_name(_start_bc_id) = _boundary_name_start;
450  binfo.sideset_name(_end_bc_id) = _boundary_name_end;
451  if (_names.size() > 1)
452  for (unsigned int i = 0; i < _names.size(); i++)
453  {
454  binfo.sideset_name(_radial_start_bc_id[i]) = _boundary_names_radial_start[i];
455  binfo.sideset_name(_radial_end_bc_id[i]) = _boundary_names_radial_end[i];
456  if (i != _names.size() - 1)
457  binfo.sideset_name(_inner_radial_bc_id[i]) = _boundary_names_inner_radial[i];
458  }
459  for (unsigned int k = 0; k < _interior_axial_per_radial_section_bc_id.size(); k++)
460  binfo.sideset_name(_interior_axial_per_radial_section_bc_id[k]) =
462 }
463 
464 bool
465 Component2D::isBoundaryInVector(const BoundaryName & boundary_name,
466  const std::vector<BoundaryName> & boundary_name_vector) const
467 {
468  return std::find(boundary_name_vector.begin(), boundary_name_vector.end(), boundary_name) !=
469  boundary_name_vector.end();
470 }
471 
472 bool
473 Component2D::hasBoundary(const BoundaryName & boundary_name) const
474 {
476 
477  return hasExternalBoundary(boundary_name) ||
480 }
481 
482 bool
483 Component2D::hasExternalBoundary(const BoundaryName & boundary_name) const
484 {
486 
487  return boundary_name == _boundary_name_inner || boundary_name == _boundary_name_outer ||
488  boundary_name == _boundary_name_start || boundary_name == _boundary_name_end ||
493 }
494 
496 Component2D::getExternalBoundaryType(const BoundaryName & boundary_name) const
497 {
499 
500  if (boundary_name == _boundary_name_inner ||
503  else if (boundary_name == _boundary_name_outer ||
506  else if (boundary_name == _boundary_name_start ||
509  else if (boundary_name == _boundary_name_end ||
512  else if (hasBoundary(boundary_name))
513  mooseError(name(), ": The boundary '", boundary_name, "' is an interior boundary.");
514  else
515  mooseError(name(), ": The boundary '", boundary_name, "' does not exist on this component.");
516 }
517 
518 const std::vector<std::tuple<dof_id_type, unsigned short int>> &
519 Component2D::getBoundaryInfo(const BoundaryName & boundary_name) const
520 {
522 
523  if (_boundary_info.find(boundary_name) != _boundary_info.end())
524  return _boundary_info.at(boundary_name);
525  else
526  mooseError(name(), ": The boundary '", boundary_name, "' does not exist on this component.");
527 }
528 
529 const std::vector<std::tuple<dof_id_type, unsigned short int>> &
531 {
533 
534  switch (boundary_type)
535  {
544  default:
545  mooseError(name(), ": Invalid external boundary type.");
546  }
547 }
548 
549 const BoundaryName &
551 {
553 
554  switch (boundary_type)
555  {
557  return _boundary_name_outer;
559  return _boundary_name_inner;
561  return _boundary_name_start;
563  return _boundary_name_end;
564  default:
565  mooseError(name(), ": Invalid external boundary type.");
566  }
567 }
568 
569 const Real &
570 Component2D::getBoundaryArea(const BoundaryName & boundary_name) const
571 {
573 
574  if (_boundary_name_to_area.find(boundary_name) != _boundary_name_to_area.end())
575  return _boundary_name_to_area.at(boundary_name);
576  else
577  mooseError(name(), ": The boundary '", boundary_name, "' does not exist on this component.");
578 }
bool hasBoundary(const BoundaryName &boundary_name) const
Returns true if this component has the supplied boundary.
Definition: Component2D.C:473
unsigned int _start_bc_id
BC ID of the component (start)
Definition: Component2D.h:176
const BoundaryName & getExternalBoundaryName(const ExternalBoundaryType &boundary_type) const
Gets the name of an external boundary by type.
Definition: Component2D.C:550
std::string genName(const std::string &prefix, unsigned int id, const std::string &suffix="") const
Build a name from a prefix, number and possible suffix.
Component1DConnection::EEndType stringToEnum(const std::string &s)
unsigned int _inner_bc_id
BC ID of the component (inner)
Definition: Component2D.h:174
virtual void buildMesh() override
Definition: Component2D.C:341
std::vector< BoundaryName > _boundary_names_inner_radial
Boundary names of the inner radial boundary regions of the component.
Definition: Component2D.h:211
std::vector< BoundaryName > _boundary_names_radial_end
Boundary names of the radial regions of the end side of the component.
Definition: Component2D.h:209
std::vector< unsigned int > _interior_axial_per_radial_section_bc_id
BC ID of the interior axial boundaries (per radial section) of the component.
Definition: Component2D.h:180
virtual void check() const override
Check the component integrity.
Definition: Component2D.C:47
BoundaryName _boundary_name_end
Boundary name of the end side of the component.
Definition: Component2D.h:199
BoundaryName _boundary_name_inner
Boundary name of the inner side of the component.
Definition: Component2D.h:195
virtual Real computeAxialBoundaryArea(const Real &y_min, const Real &y_max) const =0
Computes the area of an axial boundary.
const Real & getBoundaryArea(const BoundaryName &boundary_name) const
Gets the area for a boundary.
Definition: Component2D.C:570
std::vector< Real > _lengths
Length of each axial section.
static InputParameters validParams()
ExternalBoundaryType
External boundary type.
Definition: Component2D.h:18
Real _axial_offset
Distance by which to offset the mesh from the component axis.
Definition: Component2D.h:220
virtual void setSubdomainInfo(SubdomainID subdomain_id, const std::string &subdomain_name, const Moose::CoordinateSystemType &coord_system=Moose::COORD_XYZ)
Sets the next subdomain ID, name, and coordinate system.
Definition: Component.C:229
static MooseEnum getExternalBoundaryTypeMooseEnum(const std::string &default_value="")
Gets the MooseEnum corresponding to ExternalBoundaryType.
Definition: Component2D.C:21
std::vector< unsigned int > _inner_radial_bc_id
BC ID of the inner radial boundary regions of the component.
Definition: Component2D.h:190
Node * addNode(const Point &pt)
Definition: Component.C:213
virtual const std::string & name() const
std::vector< BoundaryName > _boundary_names_axial_inner
Boundary names of the axial regions of the inner side of the component.
Definition: Component2D.h:205
void logError(Args &&... args) const
Logs an error.
Definition: Component.h:215
virtual Real computeRadialBoundaryArea(const Real &length, const Real &y) const =0
Computes the area of a radial boundary.
virtual void check() const override
Check the component integrity.
std::vector< unsigned int > _axial_inner_bc_id
BC ID of the axial regions of the inner boundary of the component.
Definition: Component2D.h:184
static const std::map< std::string, ExternalBoundaryType > _external_boundary_type_to_enum
map of external boundary type string to enum
Definition: Component2D.h:234
std::vector< unsigned int > _radial_start_bc_id
BC ID of the radial regions of the start boundary of the component.
Definition: Component2D.h:186
unsigned int _total_elem_number
Total number of transverse elements.
Definition: Component2D.h:169
unsigned int _n_regions
Number of transverse regions.
Definition: Component2D.h:157
void build2DMesh()
Builds a 2D, first-order mesh.
Definition: Component2D.C:65
std::map< BoundaryName, std::vector< std::tuple< dof_id_type, unsigned short int > > > _boundary_info
Map of boundary name to list of tuples of element and side IDs for that boundary. ...
Definition: Component2D.h:217
std::vector< std::string > _names
Names of each transverse region.
Definition: Component2D.h:159
MeshBase & getMesh()
Base class for components that generate their own mesh.
const std::string name
Definition: Setup.h:20
unsigned int _outer_bc_id
BC ID of the component (outer)
Definition: Component2D.h:172
std::vector< unsigned int > _n_part_elems
Number of elements in each transverse region.
Definition: Component2D.h:167
const T & getParam(const std::string &name) const
std::vector< BoundaryName > _boundary_names_interior_axial_per_radial_section
Boundary names of the interior axial boundaries (per radial section) of the component.
Definition: Component2D.h:201
const unsigned int _n_sections
Number of axial sections.
const std::string _name
std::vector< BoundaryName > _boundary_names_radial_start
Boundary names of the radial regions of the start side of the component.
Definition: Component2D.h:207
void build2DMesh2ndOrder()
Builds a 2D, second-order mesh.
Definition: Component2D.C:211
std::vector< BoundaryName > _boundary_names_axial_outer
Boundary names of the axial regions of the outer side of the component.
Definition: Component2D.h:203
const std::vector< std::tuple< dof_id_type, unsigned short int > > & getBoundaryInfo(const BoundaryName &boundary_name) const
Gets boundary info associated with the component boundary.
Definition: Component2D.C:519
BoundaryName _boundary_name_outer
Boundary name of the outer side of the component.
Definition: Component2D.h:193
bool isBoundaryInVector(const BoundaryName &boundary_name, const std::vector< BoundaryName > &boundary_name_vector) const
Returns true if the supplied boundary is in the given vector.
Definition: Component2D.C:465
THMMesh & mesh()
Non-const reference to THM mesh, which can only be called before the end of mesh setup.
Definition: Component.C:60
const std::vector< unsigned int > & _n_elems
Number of elements in each axial section.
const unsigned int _n_elem
Total number of axial elements.
ExternalBoundaryType getExternalBoundaryType(const BoundaryName &boundary_name) const
Gets the external boundary type of the given boundary.
Definition: Component2D.C:496
Elem * addElementQuad4(dof_id_type node0, dof_id_type node1, dof_id_type node2, dof_id_type node3)
bool hasBlock(const std::string &name) const
Returns true if there is a transverse region of a given name.
Definition: Component2D.C:59
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::map< BoundaryName, Real > _boundary_name_to_area
Map of boundary name to boundary area.
Definition: Component2D.h:214
std::vector< Real > _width
Width of each transverse region.
Definition: Component2D.h:161
void checkSetupStatus(const EComponentSetupStatus &status) const
Throws an error if the supplied setup status of this component has not been reached.
Definition: Component.C:117
virtual BoundaryID getNextBoundaryId()
Gets the next nodeset or sideset ID.
Definition: THMMesh.C:209
std::vector< SubdomainID > _subdomain_ids
List of subdomain IDs this components owns.
Definition: Component.h:460
std::vector< unsigned int > _radial_end_bc_id
BC ID of the radial regions of the end boundary of the component.
Definition: Component2D.h:188
static InputParameters validParams()
Definition: Component2D.C:35
void mooseError(Args &&... args) const
unsigned int _end_bc_id
BC ID of the component (end)
Definition: Component2D.h:178
std::vector< unsigned int > _axial_outer_bc_id
BC ID of the axial regions of the outer boundary of the component.
Definition: Component2D.h:182
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
const Real & getTotalWidth() const
Gets the total width of all transverse regions.
Definition: Component2D.h:33
BoundaryName _boundary_name_start
Boundary name of the start side of the component.
Definition: Component2D.h:197
bool hasExternalBoundary(const BoundaryName &boundary_name) const
Returns true if this component has the supplied external boundary.
Definition: Component2D.C:483
std::vector< Real > _node_locations
Node locations along the main axis.
static const std::string k
Definition: NS.h:130
Component2D(const InputParameters &params)
Definition: Component2D.C:41
virtual bool usingSecondOrderMesh() const =0
Check if second order mesh is being used by this geometrical component.
const std::vector< std::string > & _axial_region_names
Axial region names.
Elem * addElementQuad9(dof_id_type node0, dof_id_type node1, dof_id_type node2, dof_id_type node3, dof_id_type node4, dof_id_type node5, dof_id_type node6, dof_id_type node7, dof_id_type node8)