ug4
grid_function_user_data.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012-2015: G-CSC, Goethe University Frankfurt
3  * Author: Andreas Vogel
4  *
5  * This file is part of UG4.
6  *
7  * UG4 is free software: you can redistribute it and/or modify it under the
8  * terms of the GNU Lesser General Public License version 3 (as published by the
9  * Free Software Foundation) with the following additional attribution
10  * requirements (according to LGPL/GPL v3 §7):
11  *
12  * (1) The following notice must be displayed in the Appropriate Legal Notices
13  * of covered and combined works: "Based on UG4 (www.ug4.org/license)".
14  *
15  * (2) The following notice must be displayed at a prominent place in the
16  * terminal output of covered works: "Based on UG4 (www.ug4.org/license)".
17  *
18  * (3) The following bibliography is recommended for citation and must be
19  * preserved in all covered files:
20  * "Reiter, S., Vogel, A., Heppner, I., Rupp, M., and Wittum, G. A massively
21  * parallel geometric multigrid solver on hierarchically distributed grids.
22  * Computing and visualization in science 16, 4 (2013), 151-164"
23  * "Vogel, A., Reiter, S., Rupp, M., Nägel, A., and Wittum, G. UG4 -- a novel
24  * flexible software system for simulating pde based models on high performance
25  * computers. Computing and visualization in science 16, 4 (2013), 165-179"
26  *
27  * This program is distributed in the hope that it will be useful,
28  * but WITHOUT ANY WARRANTY; without even the implied warranty of
29  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30  * GNU Lesser General Public License for more details.
31  */
32 
33 #ifndef __H__UG__LIB_DISC__FUNCTION_SPACE__GRID_FUNCTION_USER_DATA__
34 #define __H__UG__LIB_DISC__FUNCTION_SPACE__GRID_FUNCTION_USER_DATA__
35 
36 #include "common/common.h"
37 
39 
46 
47 
48 namespace ug{
49 
64 template <typename TGridFunction>
66 : public StdDependentUserData<GridFunctionNumberData<TGridFunction>,
67  number, TGridFunction::dim>
68 {
69  public:
70  // world dimension of grid function
71  static const int dim = TGridFunction::dim;
72 
73  private:
74  // grid function
76 
77  // component of function
78  size_t m_fct;
79 
80  // local finite element id
82 
83  public:
85  GridFunctionNumberData(SmartPtr<TGridFunction> spGridFct, const char* cmp)
86  {
87  assign(spGridFct, cmp);
88  }
89 
91 
92  void assign(SmartPtr<TGridFunction> spGridFct, const char* cmp)
93  {
94  m_spGridFct = spGridFct;
95  this->set_functions(cmp);
96 
97  // get function id of name
98  m_fct = spGridFct->fct_id_by_name(cmp);
99 
100  // check that function exists
101  if(m_fct >= spGridFct->num_fct())
102  UG_THROW("GridFunctionNumberData: Function space does not contain"
103  " a function with name " << cmp << ".");
104 
105  // local finite element id
106  m_lfeID = spGridFct->local_finite_element_id(m_fct);
107  }
108 
109  virtual bool continuous() const
110  {
112  }
113 
114  template <int refDim>
115  void eval_and_deriv(number vValue[],
116  const MathVector<dim> vGlobIP[],
117  number time, int si,
118  GridObject* elem,
119  const MathVector<dim> vCornerCoords[],
120  const MathVector<refDim> vLocIP[],
121  const size_t nip,
122  LocalVector* u,
123  bool bDeriv,
124  int s,
125  std::vector<std::vector<number> > vvvDeriv[],
126  const MathMatrix<refDim, dim>* vJT = NULL) const
127  {
128  // reference object id
129  const ReferenceObjectID roid = elem->reference_object_id();
130 
131  // get trial space
132  try{
133  const LocalShapeFunctionSet<refDim>& rTrialSpace =
134  LocalFiniteElementProvider::get<refDim>(roid, m_lfeID);
135 
136  // memory for shapes
137  std::vector<number> vShape;
138  // memory for indices
139  std::vector<DoFIndex> ind;
140 
141  // loop ips
142  for(size_t ip = 0; ip < nip; ++ip)
143  {
144  // evaluate at shapes at ip
145  rTrialSpace.shapes(vShape, vLocIP[ip]);
146 
147  // get multiindices of element
148  m_spGridFct->dof_indices(elem, m_fct, ind);
149 
150  // compute solution at integration point
151  vValue[ip] = 0.0;
152  for(size_t sh = 0; sh < vShape.size(); ++sh)
153  {
154  const number valSH = DoFRef(*m_spGridFct, ind[sh]);
155  vValue[ip] += valSH * vShape[sh];
156  }
157  }
158 
159  if(bDeriv){
160  for(size_t ip = 0; ip < nip; ++ip){
161  // evaluate at shapes at ip
162  rTrialSpace.shapes(vShape, vLocIP[ip]);
163 
164  for(size_t sh = 0; sh < vShape.size(); ++sh)
165  vvvDeriv[ip][0][sh] = vShape[sh];
166  }
167  }
168  }
169  UG_CATCH_THROW("GridFunctionNumberData: Shape Function Set missing for"
170  " Reference Object: "<<roid<<", Trial Space: "
171  <<m_lfeID<<", refDim="<<refDim);
172 
173  }
174 
175  virtual void operator() (number& value,
176  const MathVector<dim>& globIP,
177  number time, int si,
178  Vertex* vrt) const
179  {
180  std::vector<DoFIndex> ind;
181  if (m_spGridFct->dof_indices(vrt, m_fct, ind) != 1)
182  UG_THROW ("GridFunctionNumberData: Values at vertices of the grid function are not uniquely defined.");
183  value = DoFRef(*m_spGridFct, ind[0]);
184  }
185 };
186 
201 template <typename TGridFunction>
203 : public StdDependentUserData<GridFunctionVectorData<TGridFunction>,
204  MathVector<TGridFunction::dim>, TGridFunction::dim>
205 {
206  public:
207  // world dimension of grid function
208  static const int dim = TGridFunction::dim;
209 
210  private:
211  // grid function
213 
214  // component of function
215  size_t m_vfct[dim];
216 
217  // local finite element id
219 
220  public:
223  : m_spGridFct(spGridFct)
224  {
225  this->set_functions(cmp);
226 
227  // create function group of this elem disc
228  try{
229  // get strings
230  std::string fctString = std::string(cmp);
231 
232  // tokenize strings and select functions
233  std::vector<std::string> tokens;
234  TokenizeString(fctString, tokens, ',');
235 
236  for(size_t i = 0; i < tokens.size(); ++i)
237  RemoveWhitespaceFromString(tokens[i]);
238 
239  if((int)tokens.size() != dim)
240  UG_THROW("GridFunctionVectorData: Needed "<<dim<<" components "
241  "in symbolic function names, but given: "<<cmp);
242 
243  // get function id of name
244  for(int i = 0; i < dim; ++i){
245  m_vfct[i] = spGridFct->fct_id_by_name(tokens[i].c_str());
246  m_vlfeID[i] = spGridFct->local_finite_element_id(m_vfct[i]);
247  }
248 
249  }UG_CATCH_THROW("GridFunctionVectorData: Cannot find some symbolic function "
250  "name in '"<<cmp<<"'.");
251  };
252 
253  GridFunctionVectorData(SmartPtr<TGridFunction> spGridFct, std::vector<std::string> vCmp)
254  : m_spGridFct(spGridFct)
255  {
256  this->set_functions(vCmp);
257 
258  // create function group of this elem disc
259  try
260  {
261  if ((int)vCmp.size() != dim)
262  UG_THROW("GridFunctionVectorData: Needed "<<dim<<" components "
263  "in symbolic function names, but given: "<< (int) vCmp.size());
264 
265  // get function id of name
266  for (size_t i = 0; i < (size_t) dim; ++i)
267  {
268  m_vfct[i] = spGridFct->fct_id_by_name(vCmp[i].c_str());
269  m_vlfeID[i] = spGridFct->local_finite_element_id(m_vfct[i]);
270  }
271 
272  }UG_CATCH_THROW("GridFunctionVectorData: Cannot find some symbolic function "
273  "name in component vector.");
274  }
275 
276  virtual bool continuous() const
277  {
278  for(int i = 0; i < dim; ++i)
280  return false;
281  return true;
282  }
283 
284  template <int refDim>
286  const MathVector<dim> vGlobIP[],
287  number time, int si,
288  GridObject* elem,
289  const MathVector<dim> vCornerCoords[],
290  const MathVector<refDim> vLocIP[],
291  const size_t nip,
292  LocalVector* u,
293  bool bDeriv,
294  int s,
295  std::vector<std::vector<MathVector<dim> > > vvvDeriv[],
296  const MathMatrix<refDim, dim>* vJT = NULL) const
297  {
298  // reference object id
299  const ReferenceObjectID roid = elem->reference_object_id();
300 
301  // memory for shapes
302  std::vector<number> vShape;
303  // memory for indices
304  std::vector<DoFIndex> ind;
305 
306  // loop ips
307  try{
308  for(size_t ip = 0; ip < nip; ++ip)
309  {
310  for(int d = 0; d < dim; ++d)
311  {
312  const LocalShapeFunctionSet<refDim>& rTrialSpace =
313  LocalFiniteElementProvider::get<refDim>(roid, m_vlfeID[d]);
314 
315  // evaluate at shapes at ip
316  rTrialSpace.shapes(vShape, vLocIP[ip]);
317 
318  // get multiindices of element
319  m_spGridFct->dof_indices(elem, m_vfct[d], ind);
320 
321  // compute solution at integration point
322  vValue[ip][d] = 0.0;
323  for(size_t sh = 0; sh < vShape.size(); ++sh)
324  {
325  const number valSH = DoFRef( *m_spGridFct, ind[sh]);
326  vValue[ip][d] += valSH * vShape[sh];
327  }
328  }
329  }
330 
331 
332  if(bDeriv){
333  for(size_t ip = 0; ip < nip; ++ip){
334  for(int d = 0; d < dim; ++d)
335  {
336  const LocalShapeFunctionSet<refDim>& rTrialSpace =
337  LocalFiniteElementProvider::get<refDim>(roid, m_vlfeID[d]);
338  // evaluate at shapes at ip
339  rTrialSpace.shapes(vShape, vLocIP[ip]);
340 
341  for(size_t sh = 0; sh < vShape.size(); ++sh)
342  vvvDeriv[ip][d][sh][d] = vShape[sh];
343  }
344  }
345  }
346 
347 
348  }UG_CATCH_THROW("GridFunctionVectorData: Reference Object: "
349  <<roid<<", refDim="<<refDim);
350  }
351 
353  const MathVector<dim>& globIP,
354  number time, int si,
355  Vertex* vrt) const
356  {
357  std::vector<DoFIndex> ind;
358  for(int d = 0; d < dim; ++d)
359  {
360  if (m_spGridFct->dof_indices(vrt, m_vfct[d], ind) != 1)
361  UG_THROW ("GridFunctionVectorData: Values at vertices of the grid function are not uniquely defined.");
362  value[d] = DoFRef(*m_spGridFct, ind[0]);
363  }
364  }
365 };
366 
367 
382 template <typename TGridFunction>
384 : public StdDependentUserData<GridFunctionGradientData<TGridFunction> ,
385  MathVector<TGridFunction::dim>, TGridFunction::dim>
386 {
387  public:
388  // world dimension of grid function
389  static const int dim = TGridFunction::dim;
390 
391  private:
392  // grid function
394 
395  // component of function
396  size_t m_fct;
397 
398  // local finite element id
400 
401  public:
404  : m_spGridFct(spGridFct)
405  {
406  this->set_functions(cmp);
407 
408  // get function id of name
409  m_fct = spGridFct->fct_id_by_name(cmp);
410 
411  // check that function exists
412  if(m_fct >= spGridFct->num_fct())
413  UG_THROW("GridFunctionGradientData: Function space does not contain"
414  " a function with name " << cmp << ".");
415 
416  // local finite element id
417  m_lfeID = spGridFct->local_finite_element_id(m_fct);
418  };
419 
420  virtual bool continuous() const
421  {
422  return false;
423  }
424 
425  template <int refDim>
427  const MathVector<dim> vGlobIP[],
428  number time, int si,
429  GridObject* elem,
430  const MathVector<dim> vCornerCoords[],
431  const MathVector<refDim> vLocIP[],
432  const size_t nip,
433  LocalVector* u,
434  bool bDeriv,
435  int s,
436  std::vector<std::vector<MathVector<dim> > > vvvDeriv[],
437  const MathMatrix<refDim, dim>* vJT = NULL) const
438  {
439  // reference object id
440  const ReferenceObjectID roid = elem->reference_object_id();
441 
442  // get reference element mapping by reference object id
443  std::vector<MathMatrix<refDim, dim> > vJTTmp(nip);
444  if(vJT == NULL){
445  try{
447  = ReferenceMappingProvider::get<refDim, dim>(roid, vCornerCoords);
448 
449  // compute transformation matrices
450  mapping.jacobian_transposed(&(vJTTmp[0]), vLocIP, nip);
451 
452  // store tmp Gradient
453  vJT = &(vJTTmp[0]);
454  }UG_CATCH_THROW("GridFunctionGradientData: failed.");
455  }
456 
457  // get trial space
458  try{
459  const LocalShapeFunctionSet<refDim>& rTrialSpace =
460  LocalFiniteElementProvider::get<refDim>(roid, m_lfeID);
461 
462  // storage for shape function at ip
463  std::vector<MathVector<refDim> > vLocGrad;
464  MathVector<refDim> locGrad;
465 
466  // Reference Mapping
468 
469  // loop ips
470  for(size_t ip = 0; ip < nip; ++ip)
471  {
472  // evaluate at shapes at ip
473  rTrialSpace.grads(vLocGrad, vLocIP[ip]);
474 
475  // get multiindices of element
476  std::vector<DoFIndex > ind;
477  m_spGridFct->dof_indices(elem, m_fct, ind);
478 
479  // compute grad at ip
480  VecSet(locGrad, 0.0);
481  for(size_t sh = 0; sh < vLocGrad.size(); ++sh)
482  {
483  const number valSH = DoFRef( *m_spGridFct, ind[sh]);
484  VecScaleAppend(locGrad, valSH, vLocGrad[sh]);
485  }
486 
487  RightInverse (JTInv, vJT[ip]);
488  MatVecMult(vValue[ip], JTInv, locGrad);
489  }
490  }
491  UG_CATCH_THROW("GridFunctionNumberData: Shape Function Set missing for"
492  " Reference Object: "<<roid<<", Trial Space: "
493  <<m_lfeID<<", refDim="<<refDim);
494 
495  if(bDeriv)
496  UG_THROW("Not implemented.");
497  }
498 };
499 
500 
510 template <typename TGridFunction>
512 : public StdDependentUserData<GridFunctionGradientComponentData<TGridFunction>,
513  number, TGridFunction::dim>
514 {
515  public:
517  static const int dim = TGridFunction::dim;
518 
519  private:
522 
524  size_t m_fct;
525 
527  size_t m_component;
528 
531 
532  public:
540  const char* cmp,
541  size_t component /* 1-based */ )
542  : m_spGridFct( spGridFct )
543  {
544  this->set_functions(cmp);
545 
546  // check validity of component index
547  if ( component > static_cast<size_t>(dim) && component > 0 ) {
548  UG_THROW( "GridFunctionGradientComponentData: Requested component index "
549  << component << " out of bounds [1," << dim << "]." );
550  }
551  m_component = component - 1;
552 
553  // get function id of name
554  m_fct = spGridFct->fct_id_by_name( cmp );
555 
556  // check that function exists
557  if( m_fct >= spGridFct->num_fct() ) {
558  UG_THROW( "GridFunctionGradientComponentData: Function space does not contain"
559  " a function with name " << cmp << "." );
560  }
561 
562  // local finite element id
563  m_lfeID = spGridFct->local_finite_element_id( m_fct );
564  };
565 
566  virtual bool continuous() const
567  {
568  return false;
569  }
570 
574  template <int refDim>
575  void eval_and_deriv(number vValue[],
576  const MathVector<dim> vGlobIP[],
577  number time, int si,
578  GridObject* elem,
579  const MathVector<dim> vCornerCoords[],
580  const MathVector<refDim> vLocIP[],
581  const size_t nip,
582  LocalVector* u,
583  bool bDeriv,
584  int s,
585  std::vector<std::vector<number> > vvvDeriv[],
586  const MathMatrix<refDim, dim>* vJT = NULL) const
587  {
588  // reference object id
589  const ReferenceObjectID roid = elem->reference_object_id();
590 
591  // get reference element mapping by reference object id
592  std::vector<MathMatrix<refDim, dim> > vJTTmp( nip );
593  if( vJT == NULL ) {
594  try{
596  = ReferenceMappingProvider::get< refDim, dim >( roid, vCornerCoords );
597 
598  // compute transformation matrices
599  mapping.jacobian_transposed( &(vJTTmp[0]), vLocIP, nip );
600 
601  // store tmp Gradient
602  vJT = &(vJTTmp[0]);
603  } UG_CATCH_THROW( "GridFunctionGradientComponentData: failed.");
604  }
605 
606  // get trial space
607  try {
608  const LocalShapeFunctionSet<refDim>& rTrialSpace =
609  LocalFiniteElementProvider::get<refDim>( roid, m_lfeID );
610 
611  // storage for shape function at ip
612  std::vector<MathVector<refDim> > vLocGrad;
613  MathVector<refDim> locGrad;
614  std::vector<MathVector<dim> > vValueVec;
615  vValueVec.resize( nip );
616 
617  // Reference Mapping
619 
620  // loop ips
621  for( size_t ip = 0; ip < nip; ++ip ) {
622  // evaluate at shapes at ip
623  rTrialSpace.grads( vLocGrad, vLocIP[ip] );
624 
625  // get multiindices of element
626  std::vector<DoFIndex> ind;
627  m_spGridFct->dof_indices( elem, m_fct, ind );
628 
629  // compute grad at ip
630  VecSet( locGrad, 0.0 );
631  for( size_t sh = 0; sh < vLocGrad.size(); ++sh ) {
632  const number valSH = DoFRef( *m_spGridFct, ind[sh] );
633  VecScaleAppend( locGrad, valSH, vLocGrad[sh] );
634  }
635 
636  RightInverse( JTInv, vJT[ip] );
637  MatVecMult( vValueVec[ip], JTInv, locGrad );
638 
639  vValue[ip] = vValueVec[ip][m_component];
640 
641  if(bDeriv){
642  for( size_t ip = 0; ip < nip; ++ip ) {
643  UG_ASSERT(vvvDeriv[ip].size() == 1,
644  "Single component expected, but "<<vvvDeriv[ip].size())
645  UG_ASSERT(vvvDeriv[ip][0].size() == vLocGrad.size(),
646  "Wrong number sh: "<<vvvDeriv[ip][0].size()<<", but expected: "<<vLocGrad.size())
647 
648  for( size_t sh = 0; sh < vLocGrad.size(); ++sh ) {
649  MatVecMult( vValueVec[ip], JTInv, vLocGrad[sh] );
650  vvvDeriv[ip][0][sh] = vValueVec[ip][m_component];
651  }
652  }
653  }
654  }
655  }
656  UG_CATCH_THROW("GridFunctionNumberData: Shape Function Set missing for"
657  " Reference Object: "<<roid<<", Trial Space: "
658  <<m_lfeID<<", refDim="<<refDim);
659  }
660 };
661 
662 } // end namespace ug
663 
664 #endif /* __H__UG__LIB_DISC__FUNCTION_SPACE__GRID_FUNCTION_USER_DATA__ */
const TData & value(size_t s, size_t ip) const
returns the value at ip
Definition: user_data.h:512
virtual base class for reference mappings
Definition: reference_mapping_provider.h:53
virtual void jacobian_transposed(MathMatrix< dim, worldDim > &JT, const MathVector< dim > &locPos) const =0
returns transposed of jacobian
Retrieve component of gradient of GridFunction.
Definition: grid_function_user_data.h:514
static const int dim
World dimension of GridFunction m_spGridFct.
Definition: grid_function_user_data.h:517
size_t m_fct
Component ID of function to be used.
Definition: grid_function_user_data.h:524
LFEID m_lfeID
Local Finite Element ID.
Definition: grid_function_user_data.h:530
SmartPtr< TGridFunction > m_spGridFct
GridFunction to loop over.
Definition: grid_function_user_data.h:521
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) const
Definition: grid_function_user_data.h:575
size_t m_component
Component index of gradient to return (0-based)
Definition: grid_function_user_data.h:527
GridFunctionGradientComponentData(SmartPtr< TGridFunction > spGridFct, const char *cmp, size_t component)
Constructor.
Definition: grid_function_user_data.h:539
virtual bool continuous() const
returns if provided data is continuous over geometric object boundaries
Definition: grid_function_user_data.h:566
Definition: grid_function_user_data.h:386
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
Definition: grid_function_user_data.h:426
GridFunctionGradientData(SmartPtr< TGridFunction > spGridFct, const char *cmp)
constructor
Definition: grid_function_user_data.h:403
static const int dim
Definition: grid_function_user_data.h:389
size_t m_fct
Definition: grid_function_user_data.h:396
virtual bool continuous() const
returns if provided data is continuous over geometric object boundaries
Definition: grid_function_user_data.h:420
SmartPtr< TGridFunction > m_spGridFct
Definition: grid_function_user_data.h:393
LFEID m_lfeID
Definition: grid_function_user_data.h:399
Definition: grid_function_user_data.h:68
GridFunctionNumberData()
Definition: grid_function_user_data.h:90
GridFunctionNumberData(SmartPtr< TGridFunction > spGridFct, const char *cmp)
constructor
Definition: grid_function_user_data.h:85
virtual void operator()(number &value, const MathVector< dim > &globIP, number time, int si, Vertex *vrt) const
Definition: grid_function_user_data.h:175
size_t m_fct
Definition: grid_function_user_data.h:78
LFEID m_lfeID
Definition: grid_function_user_data.h:81
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) const
Definition: grid_function_user_data.h:115
static const int dim
Definition: grid_function_user_data.h:71
SmartPtr< TGridFunction > m_spGridFct
Definition: grid_function_user_data.h:75
void assign(SmartPtr< TGridFunction > spGridFct, const char *cmp)
Definition: grid_function_user_data.h:92
virtual bool continuous() const
returns if provided data is continuous over geometric object boundaries
Definition: grid_function_user_data.h:109
Definition: grid_function_user_data.h:205
GridFunctionVectorData(SmartPtr< TGridFunction > spGridFct, const char *cmp)
constructor
Definition: grid_function_user_data.h:222
GridFunctionVectorData(SmartPtr< TGridFunction > spGridFct, std::vector< std::string > vCmp)
Definition: grid_function_user_data.h:253
virtual void operator()(MathVector< dim > &value, const MathVector< dim > &globIP, number time, int si, Vertex *vrt) const
Definition: grid_function_user_data.h:352
static const int dim
Definition: grid_function_user_data.h:208
SmartPtr< TGridFunction > m_spGridFct
Definition: grid_function_user_data.h:212
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
Definition: grid_function_user_data.h:285
virtual bool continuous() const
returns if provided data is continuous over geometric object boundaries
Definition: grid_function_user_data.h:276
size_t m_vfct[dim]
Definition: grid_function_user_data.h:215
LFEID m_vlfeID[dim]
Definition: grid_function_user_data.h:218
The base class for all geometric objects, such as vertices, edges, faces, volumes,...
Definition: grid_base_objects.h:157
virtual ReferenceObjectID reference_object_id() const =0
const MathVector< dim > & ip(size_t s, size_t ip) const
returns global ip
Definition: user_data.h:401
number time() const
get the current evaluation time
Definition: user_data.h:285
Identifier for Local Finite Elements.
Definition: local_finite_element_id.h:98
static bool continuous(const LFEID &id, bool bCreate=true)
returns if a Local Shape Function Set is continuous
Definition: local_finite_element_provider.cpp:749
virtual base class for local shape function sets
Definition: local_shape_function_set.h:70
virtual void grads(grad_type *vGrad, const MathVector< dim > &x) const =0
returns all gradients evaluated at a point
virtual void shapes(shape_type *vShape, const MathVector< dim > &x) const =0
returns all shape functions evaluated at a point
Definition: local_algebra.h:198
A class for fixed size, dense matrices.
Definition: math_matrix.h:52
Definition: std_user_data.h:133
Base-class for all vertex-types.
Definition: grid_base_objects.h:231
MathMatrix< N, M, T >::value_type RightInverse(MathMatrix< N, M, T > &mOut, const MathMatrix< M, N, T > &m)
Right-Inverse of a Matrix.
Definition: math_matrix_functions_common_impl.hpp:679
static const int dim
void RemoveWhitespaceFromString(std::string &str)
removes all white space from a string, also within the string
Definition: string_util.cpp:50
#define UG_ASSERT(expr, msg)
Definition: assert.h:70
#define UG_CATCH_THROW(msg)
Definition: error.h:64
#define UG_THROW(msg)
Definition: error.h:57
double number
Definition: types.h:124
void MatVecMult(vector_t_out &vOut, const matrix_t &m, const vector_t_in &v)
Matrix - Vector Multiplication.
Definition: math_matrix_vector_functions_common_impl.hpp:49
void VecScaleAppend(vector_t &vOut, typename vector_t::value_type s1, const vector_t &v1)
Scales a Vector and adds it to a second vector.
Definition: math_vector_functions_common_impl.hpp:126
void VecSet(vector_t &vInOut, typename vector_t::value_type s)
Set each vector component to scalar (componentwise)
Definition: math_vector_functions_common_impl.hpp:539
the ug namespace
ReferenceObjectID
these ids are used to identify the shape of a geometric object.
Definition: grid_base_objects.h:74
number & DoFRef(TMatrix &mat, const DoFIndex &iInd, const DoFIndex &jInd)
Definition: multi_index.h:276
void TokenizeString(const string &str, vector< string > &vToken, const char delimiter)
Definition: string_util.cpp:56