Plugins
Loading...
Searching...
No Matches
smile_rescale.hpp
Go to the documentation of this file.
1
8#ifndef _SMILE_RESCALE_HPP_
9#define _SMILE_RESCALE_HPP_
10
11#include <vector>
12
13#include "common/common.h"
16
17#include "smile_cloud.hpp"
18
19namespace ug {
20namespace smile {
21
25template <typename TDomain, typename TAlgebra>
27{
30
31public:
33 typedef TDomain domain_type;
34
36 typedef typename TDomain::grid_type grid_type;
37
39 typedef typename domain_type::subset_handler_type subset_handler_type;
40
42 typedef typename domain_type::position_accessor_type position_accessor_type;
43
45 typedef typename domain_type::position_type position_type;
46
48 static const int WDim = TDomain::dim;
49
51 typedef TAlgebra algebra_type;
52
55
58
61
64
65public:
66
69
72 {
73 m_spFactor = factor;
74 }
75
77 void multiply
78 (
80 const char * cmps
81 );
82
84 void divide
85 (
87 const char * cmps
88 );
89
90private:
91
93 template <typename TElem>
95 (
96 int si,
97 gf_type & gf,
98 aa_factor_type & factor
99 );
102 {
104 int m_si;
107
109 (
110 this_type * pThis,
111 int si,
112 gf_type & gf,
113 aa_factor_type & aa_factor
114 )
115 : m_pThis (pThis), m_si (si), m_gf (gf), m_aa_factor (aa_factor) {}
116
117 template <typename TElem> void operator() (TElem &)
118 {
119 m_pThis->template get_scaling_factors_for_<TElem> (m_si, m_gf, m_aa_factor);
120 }
121 };
124 (
125 gf_type & gf,
126 a_factor_type & factor
127 );
128
129private:
130
132};
133
134} // end namespace smile
135} // end namespace ug
136
137#include "smile_rescale_impl.hpp"
138
139#endif // _SMILE_RESCALE_HPP_
140
141/* End of File */
Definition smile_rescale.hpp:27
void set_factor(SmartPtr< factor_type > factor)
Sets the scaling factor.
Definition smile_rescale.hpp:71
void get_scaling_factors(gf_type &gf, a_factor_type &factor)
Compute (sum up) the scaling factors (over the entire grid)
Definition smile_rescale_impl.hpp:87
TAlgebra algebra_type
Type of algebra.
Definition smile_rescale.hpp:51
SmartRescaler()
Constructor.
Definition smile_rescale.hpp:68
static const int WDim
World dimention.
Definition smile_rescale.hpp:48
TDomain domain_type
Type of Domain.
Definition smile_rescale.hpp:33
ANumber a_factor_type
Attachment type for the factors.
Definition smile_rescale.hpp:57
void get_scaling_factors_for_(int si, gf_type &gf, aa_factor_type &factor)
Compute (sum up) the scaling factors (for one element type)
Definition smile_rescale_impl.hpp:23
void divide(SmartPtr< gf_type > gf, const char *cmps)
Divide the given components of the grid function by the factors.
Definition smile_rescale_impl.hpp:154
SmartPtr< factor_type > m_spFactor
Definition smile_rescale.hpp:131
domain_type::position_type position_type
Type of the position coordinate vectors.
Definition smile_rescale.hpp:45
TDomain::grid_type grid_type
Type of Grid:
Definition smile_rescale.hpp:36
UserData< number, WDim > factor_type
User data scaling factor type.
Definition smile_rescale.hpp:54
Grid::VertexAttachmentAccessor< a_factor_type > aa_factor_type
Attachment accessor type for the factors.
Definition smile_rescale.hpp:60
SmartRescaler< TDomain, TAlgebra > this_type
This type.
Definition smile_rescale.hpp:29
void multiply(SmartPtr< gf_type > gf, const char *cmps)
Multiplies the given components of the grid function by the factors.
Definition smile_rescale_impl.hpp:117
domain_type::position_accessor_type position_accessor_type
Type of the position accessor.
Definition smile_rescale.hpp:42
domain_type::subset_handler_type subset_handler_type
Type of subset handler.
Definition smile_rescale.hpp:39
GridFunction< domain_type, algebra_type > gf_type
Grid function type.
Definition smile_rescale.hpp:63
Helper class for the computation of the factors.
Definition smile_rescale.hpp:102
void operator()(TElem &)
Definition smile_rescale.hpp:117
this_type * m_pThis
Definition smile_rescale.hpp:103
GetScalingFactors(this_type *pThis, int si, gf_type &gf, aa_factor_type &aa_factor)
Definition smile_rescale.hpp:109
int m_si
Definition smile_rescale.hpp:104
aa_factor_type & m_aa_factor
Definition smile_rescale.hpp:106
gf_type & m_gf
Definition smile_rescale.hpp:105