Plugins
Loading...
Searching...
No Matches
val_surf_proj.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/*
15 * Projection of values of a given grid function from a given z-plane to a given subset.
16 */
17#ifndef __H__UG__PLUGINS__D3F_VAL_SURF_PROJ_H__
18#define __H__UG__PLUGINS__D3F_VAL_SURF_PROJ_H__
19
20#include <vector>
21
22#include "common/common.h"
23
29
30namespace ug {
31namespace d3f {
32
42template <typename TGridFunction>
44: public StdDependentUserData<ValSurfProjData<TGridFunction>, number, TGridFunction::dim>
45{
46public:
48 typedef TGridFunction gf_type;
49
51 static const int dim = gf_type::dim;
52
55
58
60 typedef typename gf_type::domain_type domain_type;
61
63 typedef typename domain_type::position_accessor_type pos_acc_type;
64
65private:
68
71
74
75public:
76
79 (
80 SmartPtr<gf_type> spLSF,
81 const char * cmp,
82 number z_coord,
83 const char * subsets
84 );
85
88 (
89 number defaultValue
90 )
91 {
92 m_default_value = defaultValue;
93 }
94
96 void reinit ();
97
99 virtual bool continuous () const {return true;}
100
102 virtual bool requires_grid_fct () const {return true;}
103
105 template <int refDim>
106 void eval_and_deriv
107 (
108 number vValue[],
109 const MathVector<dim> vGlobIP[],
110 number time,
111 int si,
112 GridObject* elem,
113 const MathVector<dim> vCornerCoords[],
114 const MathVector<refDim> vLocIP[],
115 const size_t nip,
116 LocalVector* u,
117 bool bDeriv,
118 int s,
119 std::vector<std::vector<number> > vvvDeriv[],
120 const MathMatrix<refDim, dim>* vJT = NULL
121 );
122
123private:
124
126
128
130
132
134
136 std::vector<number> m_vrt_val;
137};
138
139} // namespace d3f
140} // end namespace ug
141
142// include implementation
143#include "val_surf_proj_impl.h"
144
145#endif // __H__UG__PLUGINS__D3F_VAL_SURF_PROJ_H__
146
147/* End of File */
parameterString s
Definition Biogas.lua:2
number time() const
Definition val_surf_proj.h:45
std::vector< number > m_vrt_val
projected values at the vertices of the subsets
Definition val_surf_proj.h:136
virtual bool requires_grid_fct() const
Returns true to get the grid element in the evaluation routine.
Definition val_surf_proj.h:102
Attachment< size_t > num_a_type
type of the attachment numbering the vertices
Definition val_surf_proj.h:70
void set_default_value(number defaultValue)
sets the default value for the points with no projection
Definition val_surf_proj.h:88
Grid::VertexAttachmentAccessor< num_a_type > num_aa_type
type of the attachment accessor for the numbering attachment
Definition val_surf_proj.h:73
TGridFunction gf_type
type of the grid function
Definition val_surf_proj.h:48
GlobalGridFunctionNumberData< TGridFunction > glob_userdata_type
type of the class for getting the values of a grid function by a global coordinate
Definition val_surf_proj.h:67
void eval_and_deriv(number vValue[], const MathVector< dim > vGlobIP[], number time, int si, GridObject *elem, const MathVector< dim > vCornerCoords[], const MathVector< refDim > vLocIP[], const size_t nip, LocalVector *u, bool bDeriv, int s, std::vector< std::vector< number > > vvvDeriv[], const MathMatrix< refDim, dim > *vJT=NULL)
Performs the main computations:
Definition val_surf_proj_impl.h:142
StdDependentUserData< this_type, number, dim > base_type
the base type
Definition val_surf_proj.h:57
number m_default_value
the default value if the projection point not found
Definition val_surf_proj.h:133
glob_userdata_type m_glob_userdata
the object to get the values by the global coordinates
Definition val_surf_proj.h:131
ValSurfProjData< gf_type > this_type
this type
Definition val_surf_proj.h:54
virtual bool continuous() const
We consider here the height as a continuous field (although it is not completely so)
Definition val_surf_proj.h:99
SmartPtr< gf_type > m_spLSF
the grid function
Definition val_surf_proj.h:127
number m_z_coord
the z-coordinate of the plain to get the values at
Definition val_surf_proj.h:129
num_a_type m_a_vrt_num
attachment keeping a numbering of the vertices in the subsets
Definition val_surf_proj.h:135
SubsetGroup m_SsGrp
(low-dimensional) subsets to compute the coordinates over
Definition val_surf_proj.h:125
static const int dim
world dimension
Definition val_surf_proj.h:51
void reinit()
Initializer (should be called before every use)
Definition val_surf_proj_impl.h:49
domain_type::position_accessor_type pos_acc_type
position attachment accessor type
Definition val_surf_proj.h:63
gf_type::domain_type domain_type
domain type
Definition val_surf_proj.h:60
double number