Plugins
Loading...
Searching...
No Matches
extravol.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2025 Gesellschaft fuer Anlagen- und Reaktorsicherheit gGmbH
3 * SPDX-License-Identifier: EUPL-1.2
4 * SPDX-FileContributor: Dmitry Logashenko
5 * SPDX-FileContributor: Goethe Universität Frankfurt
6 * SPDX-FileType: SOURCE
7 *
8 * This file is part of d3f++.
9 * d3f++ is an extension for UG4. Licensing information and citation requirements of UG4 are provided in LICENSES/UG4-LGPL_2.1
10 */
11
12
13/*
14 * extravol.h - data structures for the volume stabilization of flow equations.
15 */
16#ifndef __H__UG__PLUGINS__D3F__EXTRAVOL__
17#define __H__UG__PLUGINS__D3F__EXTRAVOL__
18
19namespace ug {
20namespace d3f {
21
25template <typename TDomain>
27{
28public:
29
31 typedef TDomain domain_type;
32
34 typedef typename TDomain::grid_type grid_type;
35
38
41
43 typedef ABool t_aFlag;
44
47
48public:
49
52 (
54 )
55 : m_spDomain (dom), m_bFluxActive (false), m_bFlagsActive (false)
56 {}
57
59 void reset_flux ()
60 {
61 if (! m_bFluxActive) return;
62 grid_type & grid = * m_spDomain->grid ();
63 SetAttachmentValues (m_aExtraVol, grid.vertices_begin (), grid.vertices_end (), 0);
64 }
65
68 {
69 if (m_bFluxActive) return;
70 grid_type & grid = * m_spDomain->grid ();
71 grid.template attach_to_dv<Vertex> (m_extraVol, 0);
73 m_bFluxActive = true;
74 }
75
77 bool flux_is_active () {return m_bFluxActive;}
78
81 {
82 if (! m_bFlagsActive) return;
83 grid_type & grid = * m_spDomain->grid ();
84 SetAttachmentValues (m_aFlags, grid.vertices_begin (), grid.vertices_end (), false);
85 }
86
89 {
90 if (m_bFlagsActive) return;
91 grid_type & grid = * m_spDomain->grid ();
92 grid.template attach_to_dv<Vertex> (m_flags, 0);
94 m_bFlagsActive = true;
95 }
96
99
102 (
103 const Vertex * vrt
104 )
105 {
106 return m_aExtraVol[vrt][0];
107 }
108
111 (
112 const Vertex * vrt
113 )
114 {
115 return m_aExtraVol[vrt][1];
116 }
117
120 (
121 const Vertex * vrt
122 )
123 {
124 return m_aExtraVol[vrt];
125 }
126
128 bool flag
129 (
130 const Vertex * vrt
131 )
132 {
133 return m_aFlags[vrt];
134 }
135
138 (
139 const Vertex * vrt,
140 bool v
141 )
142 {
143 m_aFlags[vrt] = v;
144 }
145
146private:
147
150
157
164};
165
166} // namespace d3f
167} // end namespace ug
168
169#endif // __H__UG__PLUGINS__D3F__EXTRAVOL__
170
171/* End of File */
bool access(Grid &grid, TAttachment &a)
Definition extravol.h:27
void reset_flags()
clear the flags
Definition extravol.h:80
SmartPtr< domain_type > m_spDomain
domain
Definition extravol.h:149
t_aaVector2 m_aExtraVol
the accessor
Definition extravol.h:156
Grid::VertexAttachmentAccessor< t_aVector2 > t_aaVector2
type of the attachment accessor for the parts of the flux
Definition extravol.h:40
void reset_flux()
clear the flux data
Definition extravol.h:59
void activate_flags()
allocate the attachments for the flags, set the activity flag
Definition extravol.h:88
bool m_bFluxActive
whether flux computations are active, i.e. the attachments for the flux is allocated
Definition extravol.h:152
TDomain::grid_type grid_type
type of the grid (typically Multigrid)
Definition extravol.h:34
TDomain domain_type
type of the domain
Definition extravol.h:31
MathVector< 2 > & value(const Vertex *vrt)
access both the parts
Definition extravol.h:120
t_aFlag m_flags
the attachment
Definition extravol.h:161
bool m_bFlagsActive
whether the outflow flags are active, i.e. the attachment for the flags is allocated
Definition extravol.h:159
t_aaFlag m_aFlags
the accessor
Definition extravol.h:163
t_aVector2 m_extraVol
the attachment
Definition extravol.h:154
FlowVolStabData(SmartPtr< domain_type > dom)
class constructor
Definition extravol.h:52
bool flux_is_active()
whether the flux computations are active
Definition extravol.h:77
ABool t_aFlag
type of the attachment for the flags
Definition extravol.h:43
void set_flag(const Vertex *vrt, bool v)
set the flag
Definition extravol.h:138
bool flag(const Vertex *vrt)
get the flag
Definition extravol.h:129
number & mass(const Vertex *vrt)
access to the mass part
Definition extravol.h:111
Grid::VertexAttachmentAccessor< t_aFlag > t_aaFlag
type of the attachment accessor for the flag
Definition extravol.h:46
AVector2 t_aVector2
type of the attachment for the stiffness and the mass parts of the stabilization
Definition extravol.h:37
number & stiff(const Vertex *vrt)
access to the stiffness part
Definition extravol.h:102
bool flags_are_active()
whether the flags are active
Definition extravol.h:98
void activate_flux()
allocate the attachments for the flux, set the activity flag
Definition extravol.h:67
SmartPtr< TGrid > grid()
void SetAttachmentValues(TAttachmentAccessor &aaVal, TIter elemsBegin, TIter elemsEnd, const TVal &val)
double number