https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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{
21public:
23
25
28 {
31 };
32
34 Real getViewFactor(BoundaryID from_id, BoundaryID to_id) const;
35 Real getViewFactor(BoundaryName from_name, BoundaryName to_name) const;
37
38 virtual void initialize() override;
39 virtual void execute() override;
40 virtual void finalize() override final;
41
42protected:
43 virtual void threadJoin(const UserObject & y) override final;
44
46 Real devReciprocity(unsigned int i, unsigned int j) const;
47
49 Real maxDevReciprocity() const;
50
52 Real viewFactorRowSum(unsigned int i) const;
53
55 Real maxDevRowSum() const;
56
59
62
64 unsigned int indexHelper(unsigned int i, unsigned int j) const;
65
67 unsigned int getSideNameIndex(std::string name) const;
68
71
73 virtual void finalizeViewFactor() = 0;
74
76 virtual void threadJoinViewFactor(const UserObject & y) = 0;
77
79 unsigned int _n_sides;
80
82 std::vector<Real> _areas;
83
85 const Real _view_factor_tol;
86
89
92
93 // whether to print view factor information
95
97 std::vector<std::vector<Real>> _view_factors;
98
100 std::unordered_map<std::string, unsigned int> _side_name_index;
101};
boundary_id_type BoundaryID
const std::vector< double > y
const InputParameters & parameters() const
const std::string & name() const
A base class for automatic computation of view factors between sidesets.
virtual void execute() override
const bool _normalize_view_factor
whether to normalize view factors so vf[from][:] sums to one
virtual void finalizeViewFactor()=0
a purely virtural function called in finalize, must be overriden by derived class
const Real _view_factor_tol
view factor tolerance
void normalizeUsingLagrangeMultiplier()
normalizes view factors by Lagrange multiplier method
void normalizeUsingInverseRowSum()
normalizes view factors by inverse row sum
unsigned int indexHelper(unsigned int i, unsigned int j) const
helper for finding index of correction for i,j-th entry
unsigned int getSideNameIndex(std::string name) const
helper function to get the index from the boundary name
virtual void threadJoin(const UserObject &y) override final
std::vector< std::vector< Real > > _view_factors
the view factor from side i to side j
std::unordered_map< std::string, unsigned int > _side_name_index
boundary name to index map
Real maxDevRowSum() const
maximum deviation of any view factor row sum from 1
virtual void initialize() override
virtual void threadJoinViewFactor(const UserObject &y)=0
a purely virtual function called in finalize, must be overriden by derived class
virtual void finalize() override final
unsigned int _n_sides
number of boundaries of this side uo
NormalizationMethod
How to normalize view factors.
Real devReciprocity(unsigned int i, unsigned int j) const
this function computes the deviation from reciprocity defined as Fij - Aj/Ai * Fji
const NormalizationMethod _normalization_method
How to normalize view factors.
std::vector< Real > _areas
area of the sides i
Real getViewFactor(BoundaryID from_id, BoundaryID to_id) const
public interface for obtaining view factors
Real maxDevReciprocity() const
this function computes the maximum absolute value of the deviation from reciprocity
const bool _print_view_factor_info
void checkAndNormalizeViewFactor()
this function checks & normalizes view factors to sum to one, this is not always
static InputParameters validParams()
Real viewFactorRowSum(unsigned int i) const
sum of a row in the view factor matrix