33 #ifndef __H__UG__LIB_DISC__SPATIAL_DISC__ELEM_DISC__DENSITY_DRIVEN_FLOW__FV1__CONV_SHAPE_INTERFACE__
34 #define __H__UG__LIB_DISC__SPATIAL_DISC__ELEM_DISC__DENSITY_DRIVEN_FLOW__FV1__CONV_SHAPE_INTERFACE__
225 template <
typename TFVGeom,
typename TAssFunc>
229 template <
typename TFVGeom>
246 template <
typename TFVGeom,
typename TAssFunc>
252 size_t id = GetUniqueFVGeomID<TFVGeom>();
255 if((
size_t)
id >= m_vUpdateFunc.size())
256 m_vUpdateFunc.resize(
id+1, NULL);
259 m_vUpdateFunc[id] = (UpdateFunc)
func;
264 template <
typename TFVGeom>
270 size_t id = GetUniqueFVGeomID<TFVGeom>();
273 if(
id >= m_vUpdateFunc.size() || m_vUpdateFunc[
id] == NULL)
275 UG_LOG(
"ERROR in 'IConvectionShapes::set_geometry_type':"
276 " No update function registered for this Geometry.\n");
284 set_sizes(geo.num_scvf(), geo.num_sh());
302 m_vConvShape.resize(m_numScvf);
303 m_vConvShapeVel.resize(m_numScvf);
304 m_vConvShapeDiffusion.resize(m_numScvf);
305 for(
size_t scvf = 0; scvf < m_numScvf; ++scvf)
307 m_vConvShape[scvf].resize(m_numSh);
308 m_vConvShapeVel[scvf].resize(m_numSh);
309 m_vConvShapeDiffusion[scvf].resize(m_numSh);
base class for all FVGeometries
Definition: fv_geom_base.h:76
Interface class for upwind methods.
Definition: conv_shape_interface.h:100
std::vector< std::vector< MathMatrix< dim, dim > > > m_vConvShapeDiffusion
upwind shapes for corners shape functions
Definition: conv_shape_interface.h:214
std::vector< UpdateFunc > m_vUpdateFunc
Vector holding all update functions.
Definition: conv_shape_interface.h:234
IConvectionShapes< dim > this_type
Abbreviation for own type.
Definition: conv_shape_interface.h:103
bool(this_type::* UpdateFunc)(const FVGeometryBase *geo, const MathVector< dim > *Velocity, const MathMatrix< dim, dim > *Diffusion, bool computeDeriv)
type of update function
Definition: conv_shape_interface.h:107
const MathVector< dim > & D_vel(size_t scvf, size_t sh) const
upwind shape for corner vel
Definition: conv_shape_interface.h:141
number & conv_shape(size_t scvf, size_t sh)
non-const access to ip velocity (i.e. interpolated velocity at ip)
Definition: conv_shape_interface.h:177
void set_sizes(size_t numScvf, size_t numSh)
resize the data arrays
Definition: conv_shape_interface.h:295
std::vector< std::vector< number > > m_vConvShape
upwind shapes for corners shape functions
Definition: conv_shape_interface.h:208
IConvectionShapes()
constructor
Definition: conv_shape_interface.h:114
std::vector< std::vector< MathVector< dim > > > m_vConvShapeVel
upwind shapes for corners shape functions
Definition: conv_shape_interface.h:211
void register_update_func(TAssFunc func)
register a update function for a Geometry
Definition: conv_shape_interface.h:249
bool update(const FVGeometryBase *geo, const MathVector< dim > *Velocity, const MathMatrix< dim, dim > *DiffDisp, bool computeDeriv)
Definition: conv_shape_interface.h:159
bool set_geometry_type(const TFVGeom &geo)
set the Geometry type to use for next updates
Definition: conv_shape_interface.h:267
void set_non_zero_deriv_diffusion_flag(bool flag)
sets the shape ip flag
Definition: conv_shape_interface.h:174
virtual ~IConvectionShapes()
destructor
Definition: conv_shape_interface.h:124
bool m_bNonZeroDerivDiffusion
flag if ip shapes are non-zero
Definition: conv_shape_interface.h:217
size_t num_scvf() const
returns number of sub control volume faces
Definition: conv_shape_interface.h:130
int m_id
id of current geometry type
Definition: conv_shape_interface.h:237
size_t m_numSh
number of current shape functions (usually in corners)
Definition: conv_shape_interface.h:205
MathVector< dim > & D_vel(size_t scvf, size_t sh)
non-const access to upwind shapes for corner vel
Definition: conv_shape_interface.h:185
size_t num_sh() const
returns number of shapes
Definition: conv_shape_interface.h:127
bool non_zero_deriv_diffusion() const
returns if upwind shape w.r.t. ip vel is non-zero
Definition: conv_shape_interface.h:149
number operator()(size_t scvf, size_t sh) const
shape value
Definition: conv_shape_interface.h:133
size_t m_numScvf
number of current scvf
Definition: conv_shape_interface.h:202
MathMatrix< dim, dim > & conv_shape_diffusion(size_t scvf, size_t sh)
non-const access to upwind shapes for ip vel
Definition: conv_shape_interface.h:193
const MathMatrix< dim, dim > & D_diffusion(size_t scvf, size_t sh) const
upwind shapes for ip vel
Definition: conv_shape_interface.h:152
#define UG_ASSERT(expr, msg)
Definition: assert.h:70
#define UG_LOG(msg)
Definition: log.h:367
double number
Definition: types.h:124
function func(x, y, z, t, si)