36#ifndef __H__UG__PLUGINS__LEVEL_SET__NORMVEL_UTIL_H__
37#define __H__UG__PLUGINS__LEVEL_SET__NORMVEL_UTIL_H__
50template <
typename TGr
idFunc>
53 <EikonalVel<TGridFunc>, MathVector<TGridFunc::dim>, TGridFunc::dim>
60 static const int dim = domain_type::dim;
100 template <
int refDim>
120 UG_THROW (
"EikonalVel: Derivatives are not implemented.");
126 std::vector<MathMatrix<refDim, dim> > vJTTmp(nip);
130 = ReferenceMappingProvider::get<refDim, dim> (roid, vCornerCoords);
137 LocalFiniteElementProvider::get<refDim>(roid,
m_lfeID);
140 std::vector<DoFIndex> ind;
141 std::vector<MathVector<refDim> > vLocGrad;
148 for(
size_t ip = 0;
ip < nip; ++
ip)
154 rTrialSpace.
grads(vLocGrad, vLocIP[
ip]);
157 std::vector<DoFIndex > ind;
162 for(
size_t sh = 0; sh < vLocGrad.size(); ++sh)
181template <
typename TGr
idFunc>
184 <VelByNormalVel<TGridFunc>, MathVector<TGridFunc::dim>, TGridFunc::dim>
191 static const int dim = domain_type::dim;
216 LFEID lfeID_nv =
m_spNV->local_finite_element_id(0);
219 if (lfeID_nv != lfeID_pot)
220 UG_THROW (
"VelByNormalVel: Both grid functions should have the same approx. spaces");
234 template <
int refDim>
254 UG_THROW (
"VelByNormalVel: Derivatives are not implemented.");
260 std::vector<MathMatrix<refDim, dim> > vJTTmp(nip);
264 = ReferenceMappingProvider::get<refDim, dim> (roid, vCornerCoords);
271 LocalFiniteElementProvider::get<refDim>(roid,
m_lfeID);
274 std::vector<number> vShape;
275 std::vector<DoFIndex> ind;
276 std::vector<MathVector<refDim> > vLocGrad;
283 for(
size_t ip = 0;
ip < nip; ++
ip)
289 rTrialSpace.
shapes(vShape, vLocIP[
ip]);
292 m_spNV->dof_indices(elem, 0, ind);
295 for(
size_t sh = 0; sh < vShape.size(); ++sh)
302 rTrialSpace.
grads(vLocGrad, vLocIP[
ip]);
309 for(
size_t sh = 0; sh < vLocGrad.size(); ++sh)
parameterString s
Definition Biogas.lua:2
virtual void jacobian_transposed(MathMatrix< dim, worldDim > &JT, const MathVector< dim > &locPos) const=0
virtual ReferenceObjectID reference_object_id() const=0
const MathVector< dim > & ip(size_t s, size_t ip) const
Definition normvel_util.h:54
virtual bool requires_grid_fct() const
Returns true to get the grid element in the evaluation routine.
Definition normvel_util.h:97
TGridFunc::domain_type domain_type
Type of domain.
Definition normvel_util.h:57
number m_scaling
scaling factor for the velocity
Definition normvel_util.h:70
virtual bool continuous() const
The vector field of the gradients is not continuous over the sides of the elements.
Definition normvel_util.h:91
domain_type::position_type position_type
Type of position coordinates (e.g. position_type)
Definition normvel_util.h:63
void set_scaling(number v)
Set the scaling.
Definition normvel_util.h:88
virtual bool zero_derivative() const
No derivatives implemented.
Definition normvel_util.h:94
void eval_and_deriv(MathVector< dim > 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< MathVector< dim > > > vvvDeriv[], const MathMatrix< refDim, dim > *vJT=NULL) const
Performs the main computations:
Definition normvel_util.h:102
static const int dim
World dimension.
Definition normvel_util.h:60
EikonalVel(SmartPtr< TGridFunc > spPot)
constructor
Definition normvel_util.h:78
LFEID m_lfeID
local finite element id (assumed to be the same for both the functions)
Definition normvel_util.h:73
SmartPtr< TGridFunc > m_spVelPot
'potential' of the velocity: direction is its normalized gradient; typically the LSF
Definition normvel_util.h:67
Definition normvel_util.h:185
VelByNormalVel(SmartPtr< TGridFunc > spNV, SmartPtr< TGridFunc > spPot)
constructor
Definition normvel_util.h:209
domain_type::position_type position_type
Type of position coordinates (e.g. position_type)
Definition normvel_util.h:194
TGridFunc::domain_type domain_type
Type of domain.
Definition normvel_util.h:188
LFEID m_lfeID
local finite element id (assumed to be the same for both the functions)
Definition normvel_util.h:204
SmartPtr< TGridFunc > m_spVelPot
'potential' of the velocity: direction is its normalized gradient; typically the LSF
Definition normvel_util.h:201
virtual bool zero_derivative() const
No derivatives implemented.
Definition normvel_util.h:228
SmartPtr< TGridFunc > m_spNV
normal velocity
Definition normvel_util.h:198
virtual bool requires_grid_fct() const
Returns true to get the grid element in the evaluation routine.
Definition normvel_util.h:231
void eval_and_deriv(MathVector< dim > 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< MathVector< dim > > > vvvDeriv[], const MathMatrix< refDim, dim > *vJT=NULL) const
Performs the main computations:
Definition normvel_util.h:236
virtual bool continuous() const
The vector field of the gradients is not continuous over the sides of the elements.
Definition normvel_util.h:225
static const int dim
World dimension.
Definition normvel_util.h:191
virtual void grads(std::vector< std::vector< grad_type > > &vvGrad, const std::vector< MathVector< dim > > &vLocPos) const=0
virtual void shapes(std::vector< std::vector< shape_type > > &vvShape, const std::vector< MathVector< dim > > &vLocPos) const=0
MathMatrix< N, M, T >::value_type RightInverse(MathMatrix< N, M, T > &mOut, const MathMatrix< M, N, T > &m)
void MatVecMult(vector_t_out &vOut, const matrix_t &m, const vector_t_in &v)
vector_t::value_type VecLength(const vector_t &v)
void VecScaleAppend(vector_t &vOut, typename vector_t::value_type s1, const vector_t &v1)
void VecScale(vector_t &vOut, const vector_t &v, typename vector_t::value_type s)
const number & DoFRef(const TMatrix &mat, const DoFIndex &iInd, const DoFIndex &jInd)
void VecSet(vector_t &dest, number alpha, const std::vector< size_t > vIndex)