https://mooseframework.inl.gov
ViewFactorBase.h
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 #pragma once
11 
12 #include "SideUserObject.h"
13 
14 // Forward Declarations
15 
20 {
21 public:
23 
25 
27  Real getViewFactor(BoundaryID from_id, BoundaryID to_id) const;
28  Real getViewFactor(BoundaryName from_name, BoundaryName to_name) const;
30 
31  virtual void finalize() override final;
32 
33 protected:
34  virtual void threadJoin(const UserObject & y) override final;
35 
37  Real devReciprocity(unsigned int i, unsigned int j) const;
38 
40  Real maxDevReciprocity() const;
41 
43  Real viewFactorRowSum(unsigned int i) const;
44 
46  Real maxDevRowSum() const;
47 
49  unsigned int indexHelper(unsigned int i, unsigned int j) const;
50 
52  unsigned int getSideNameIndex(std::string name) const;
53 
56 
58  virtual void finalizeViewFactor() = 0;
59 
61  virtual void threadJoinViewFactor(const UserObject & y) = 0;
62 
64  unsigned int _n_sides;
65 
67  std::vector<Real> _areas;
68 
71 
74 
75  // whether to print view factor information
77 
79  std::vector<std::vector<Real>> _view_factors;
80 
82  std::unordered_map<std::string, unsigned int> _side_name_index;
83 };
virtual void finalizeViewFactor()=0
a purely virtural function called in finalize, must be overriden by derived class ...
unsigned int indexHelper(unsigned int i, unsigned int j) const
helper for finding index of correction for i,j-th entry
std::vector< Real > _areas
area of the sides i
virtual void finalize() override final
std::unordered_map< std::string, unsigned int > _side_name_index
boundary name to index map
const Real _view_factor_tol
view factor tolerance
ViewFactorBase(const InputParameters &parameters)
unsigned int _n_sides
number of boundaries of this side uo
const bool _print_view_factor_info
const std::vector< double > y
const bool _normalize_view_factor
whether to normalize view factors so vf[from][:] sums to one
Real devReciprocity(unsigned int i, unsigned int j) const
this function computes the deviation from reciprocity defined as Fij - Aj/Ai * Fji ...
Real getViewFactor(BoundaryID from_id, BoundaryID to_id) const
public interface for obtaining view factors
virtual const std::string & name() const
A base class for automatic computation of view factors between sidesets.
Real maxDevRowSum() const
maximum deviation of any view factor row sum from 1
std::vector< std::vector< Real > > _view_factors
the view factor from side i to side j
boundary_id_type BoundaryID
unsigned int getSideNameIndex(std::string name) const
helper function to get the index from the boundary name
Real viewFactorRowSum(unsigned int i) const
sum of a row in the view factor matrix
virtual void threadJoinViewFactor(const UserObject &y)=0
a purely virtual function called in finalize, must be overriden by derived class
static InputParameters validParams()
void checkAndNormalizeViewFactor()
this function checks & normalizes view factors to sum to one, this is not always
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual void threadJoin(const UserObject &y) override final
const InputParameters & parameters() const
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
Real maxDevReciprocity() const
this function computes the maximum absolute value of the deviation from reciprocity ...