dune-pdelab  2.7-git
assemblerutilities.hh
Go to the documentation of this file.
1 // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 // vi: set et ts=4 sw=2 sts=2:
3 
4 #ifndef DUNE_PDELAB_GRIDOPERATOR_COMMON_ASSEMBLERUTILITIES_HH
5 #define DUNE_PDELAB_GRIDOPERATOR_COMMON_ASSEMBLERUTILITIES_HH
6 
7 #include <algorithm>
8 #include <tuple>
9 
12 
13 namespace Dune{
14  namespace PDELab{
15 
21  template<typename GO>
23  {
24 
26  typedef typename GO::Traits::TrialGridFunctionSpace TrialGridFunctionSpace;
27 
29  typedef typename GO::Traits::TestGridFunctionSpace TestGridFunctionSpace;
30 
31 
33  typedef typename GO::Traits::TrialGridFunctionSpaceConstraints TrialGridFunctionSpaceConstraints;
34 
36  typedef typename GO::Traits::TestGridFunctionSpaceConstraints TestGridFunctionSpaceConstraints;
37 
38 
40  typedef typename GO::Traits::MatrixBackend MatrixBackend;
41 
42 
44  typedef typename GO::Traits::DomainField DomainField;
45 
47  typedef typename GO::Traits::Domain Domain;
48 
50  typedef typename GO::Traits::Domain Solution;
51 
52 
54  typedef typename GO::Traits::RangeField RangeField;
55 
57  typedef typename GO::Traits::Range Range;
58 
60  typedef typename GO::Traits::Range Residual;
61 
62 
64  typedef typename GO::Traits::JacobianField JacobianField;
65 
67  typedef typename GO::Traits::Jacobian Jacobian;
68 
70  typedef typename MatrixBackend::template Pattern<
71  Jacobian,
75 
77  typedef typename GO::BorderDOFExchanger BorderDOFExchanger;
78 
79  };
80 
81  // ********************************************************************************
82  // default local pattern implementation
83  // ********************************************************************************
84 
97  class SparsityLink : public std::tuple<int,int>
98  {
99  public:
102  {}
103 
105  SparsityLink (int i, int j)
106  : std::tuple<int,int>(i,j)
107  {}
108 
110  inline int i () const
111  {
112  return std::get<0>(*this);
113  }
114 
116  inline int j () const
117  {
118  return std::get<1>(*this);
119  }
120 
122  void set (int i, int j)
123  {
124  std::get<0>(*this) = i;
125  std::get<1>(*this) = j;
126  }
127  };
128 
136  : public std::vector<SparsityLink>
137  {
138 
139  // make push_back() inaccessible
140  using std::vector<SparsityLink>::push_back;
141 
142  public:
143 
145 
154  template<typename LFSV, typename LFSU>
155  void addLink(const LFSV& lfsv, std::size_t i, const LFSU& lfsu, std::size_t j)
156  {
157  std::vector<SparsityLink>::push_back(
158  SparsityLink(
159  lfsv.localIndex(i),
160  lfsu.localIndex(j)
161  )
162  );
163  }
164 
165  };
166 
167 
168 
169  // ********************************************************************************
170  // Assembler base class
171  // ********************************************************************************
172 
185  template<typename B,
186  typename CU=EmptyTransformation,
187  typename CV=EmptyTransformation>
189  {
190  public:
191 
192  typedef typename B::size_type SizeType;
193 
197  {}
198 
200  LocalAssemblerBase (const CU& cu, const CV& cv)
201  :pconstraintsu(&cu), pconstraintsv(&cv)
202  {}
203 
205  const CU& trialConstraints() const
206  {
207  return *pconstraintsu;
208  }
209 
211  const CV& testConstraints() const
212  {
213  return *pconstraintsv;
214  }
215 
216 
222  template<typename X>
223  typename std::enable_if<
224  AlwaysTrue<X>::value && !std::is_same<
225  CV,
227  >::value
228  >::type
229  forwardtransform(X & x, const bool postrestrict = false) const
230  {
231  typedef typename CV::const_iterator global_col_iterator;
232  for (global_col_iterator cit=pconstraintsv->begin(); cit!=pconstraintsv->end(); ++cit){
233  typedef typename global_col_iterator::value_type::first_type GlobalIndex;
234  const GlobalIndex & contributor = cit->first;
235 
236  typedef typename global_col_iterator::value_type::second_type ContributedMap;
237  typedef typename ContributedMap::const_iterator global_row_iterator;
238  const ContributedMap & contributed = cit->second;
239  global_row_iterator it = contributed.begin();
240  global_row_iterator eit = contributed.end();
241 
242  for(;it!=eit;++it)
243  {
244  // typename X::block_type block(x[contributor]);
245  // block *= it->second;
246  // x[it->first] += block;
247  x[it->first] += it->second * x[contributor];
248  }
249  }
250 
251  if(postrestrict)
252  for (global_col_iterator cit=pconstraintsv->begin(); cit!=pconstraintsv->end(); ++cit)
253  x[cit->first]=0.;
254  }
255 
256 
257  // Disable forwardtransform for EmptyTransformation
258  template<typename X>
259  typename std::enable_if<
260  AlwaysTrue<X>::value && std::is_same<
261  CV,
263  >::value
264  >::type
265  forwardtransform(X & x, const bool postrestrict = false) const
266  {}
267 
268 
273  template<typename X>
274  typename std::enable_if<
275  AlwaysTrue<X>::value && !std::is_same<
276  CV,
278  >::value
279  >::type
280  backtransform(X & x, const bool prerestrict = false) const
281  {
282  typedef typename CV::const_iterator global_col_iterator;
283  for (global_col_iterator cit=pconstraintsv->begin(); cit!=pconstraintsv->end(); ++cit){
284  typedef typename global_col_iterator::value_type::first_type GlobalIndex;
285  const GlobalIndex & contributor = cit->first;
286 
287  typedef typename global_col_iterator::value_type::second_type ContributedMap;
288  typedef typename ContributedMap::const_iterator global_row_iterator;
289  const ContributedMap & contributed = cit->second;
290  global_row_iterator it = contributed.begin();
291  global_row_iterator eit = contributed.end();
292 
293  if(prerestrict)
294  x[contributor] = 0.;
295 
296  for(;it!=eit;++it)
297  {
298  // typename X::block_type block(x[it->first]);
299  // block *= it->second;
300  // x[contributor] += block;
301  x[contributor] += it->second * x[it->first]; // PB: 27 Sep 12 this was the old version
302  }
303  }
304  }
305 
306  // disable backtransform for empty transformation
307  template<typename X>
308  typename std::enable_if<
309  AlwaysTrue<X>::value && std::is_same<
310  CV,
312  >::value
313  >::type
314  backtransform(X & x, const bool prerestrict = false) const
315  {}
316 
317 
318  protected:
319 
321  template<typename GCView, typename T>
322  void eread (const GCView& globalcontainer_view, LocalMatrix<T>& localcontainer) const
323  {
324  for (int i = 0; i < localcontainer.N(); ++i)
325  for (int j = 0; j < localcontainer.M(); ++j)
326  localcontainer(i,j) = globalcontainer_view(i,j);
327  }
328 
330  template<typename T, typename GCView>
331  void ewrite (const LocalMatrix<T>& localcontainer, GCView& globalcontainer_view) const
332  {
333  for (int i = 0; i < localcontainer.N(); ++i)
334  for (int j = 0; j < localcontainer.M(); ++j)
335  globalcontainer_view(i,j) = localcontainer(i,j);
336  }
337 
339  template<typename T, typename GCView>
340  void eadd (const LocalMatrix<T>& localcontainer, GCView& globalcontainer_view) const
341  {
342  for (int i = 0; i < localcontainer.N(); ++i)
343  for (int j = 0; j < localcontainer.M(); ++j)
344  globalcontainer_view.add(i,j,localcontainer(i,j));
345  }
346 
348  template<typename M, typename GCView>
349  typename std::enable_if<
350  AlwaysTrue<M>::value && !std::is_same<
351  CV,
353  >::value
354  >::type
355  scatter_jacobian(M& local_container, GCView& global_container_view, bool symmetric_mode) const
356  {
357  typedef typename GCView::RowIndexCache LFSVIndexCache;
358  typedef typename GCView::ColIndexCache LFSUIndexCache;
359 
360  const LFSVIndexCache& lfsv_indices = global_container_view.rowIndexCache();
361  const LFSUIndexCache& lfsu_indices = global_container_view.colIndexCache();
362 
363  if (lfsv_indices.constraintsCachingEnabled() && lfsu_indices.constraintsCachingEnabled())
364  if (symmetric_mode)
365  etadd_symmetric(local_container,global_container_view);
366  else
367  etadd(local_container,global_container_view);
368  else
369  {
370 
371  typedef typename LFSVIndexCache::LocalFunctionSpace LFSV;
372  const LFSV& lfsv = lfsv_indices.localFunctionSpace();
373 
374  typedef typename LFSUIndexCache::LocalFunctionSpace LFSU;
375  const LFSU& lfsu = lfsu_indices.localFunctionSpace();
376 
377  // optionally clear out columns that belong to Dirichlet-constrained DOFs to keep matrix symmetric
378  if (symmetric_mode)
379  {
380  typedef typename LFSUIndexCache::ContainerIndex CI;
381 
382  for (size_t j = 0; j < lfsu_indices.size(); ++j)
383  {
384  const CI& container_index = lfsu_indices.containerIndex(j);
385  const typename CU::const_iterator cit = pconstraintsu->find(container_index);
386  if (cit != pconstraintsu->end())
387  {
388  // make sure we only have Dirichlet constraints
389  assert(cit->second.empty());
390  // clear out the current column
391  for (size_t i = 0; i < lfsv_indices.size(); ++i)
392  {
393  // we do not need to update the residual, since the solution
394  // (i.e. the correction) for the Dirichlet DOF is 0 by definition
395  local_container(lfsv,i,lfsu,j) = 0.0;
396  }
397  }
398  }
399  }
400 
401  // write entries without considering constraints.
402  // Dirichlet-constrained rows will be fixed in a postprocessing step.
403  for (auto it = local_container.begin(); it != local_container.end(); ++it)
404  {
405  // skip 0 entries because they might not be present in the pattern
406  if (*it == 0.0)
407  continue;
408  global_container_view.add(it.row(),it.col(),*it);
409  }
410  }
411  }
412 
413  // specialization for empty constraints container
414  template<typename M, typename GCView>
415  typename std::enable_if<
416  AlwaysTrue<M>::value && std::is_same<
417  CV,
419  >::value
420  >::type
421  scatter_jacobian(M& local_container, GCView& global_container_view, bool symmetric_mode) const
422  {
423  // write entries without considering constraints.
424  // Dirichlet-constrained rows will be fixed in a postprocessing step.
425  for (auto it = local_container.begin(); it != local_container.end(); ++it)
426  {
427  // skip 0 entries because they might not be present in the pattern
428  if (*it == 0.0)
429  continue;
430  global_container_view.add(it.row(),it.col(),*it);
431  }
432  }
433 
437  template<typename M, typename GCView>
438  void etadd_symmetric (M& localcontainer, GCView& globalcontainer_view) const
439  {
440 
441  typedef typename GCView::RowIndexCache LFSVIndexCache;
442  typedef typename GCView::ColIndexCache LFSUIndexCache;
443 
444  const LFSVIndexCache& lfsv_indices = globalcontainer_view.rowIndexCache();
445  const LFSUIndexCache& lfsu_indices = globalcontainer_view.colIndexCache();
446 
447  typedef typename LFSVIndexCache::LocalFunctionSpace LFSV;
448  const LFSV& lfsv = lfsv_indices.localFunctionSpace();
449 
450  typedef typename LFSUIndexCache::LocalFunctionSpace LFSU;
451  const LFSU& lfsu = lfsu_indices.localFunctionSpace();
452 
453  for (size_t j = 0; j < lfsu_indices.size(); ++j)
454  {
455  if (lfsu_indices.isConstrained(j) && lfsu_indices.isDirichletConstraint(j))
456  {
457  // clear out the current column
458  for (size_t i = 0; i < lfsv_indices.size(); ++i)
459  {
460  // we do not need to update the residual, since the solution
461  // (i.e. the correction) for the Dirichlet DOF is 0 by definition
462  localcontainer(lfsv,i,lfsu,j) = 0.0;
463  }
464  }
465  }
466 
467  // hand off to standard etadd() method
468  etadd(localcontainer,globalcontainer_view);
469  }
470 
471 
472  template<typename M, typename GCView>
473  void etadd (const M& localcontainer, GCView& globalcontainer_view) const
474  {
475 
476  typedef typename M::value_type T;
477 
478  typedef typename GCView::RowIndexCache LFSVIndexCache;
479  typedef typename GCView::ColIndexCache LFSUIndexCache;
480 
481  const LFSVIndexCache& lfsv_indices = globalcontainer_view.rowIndexCache();
482  const LFSUIndexCache& lfsu_indices = globalcontainer_view.colIndexCache();
483 
484  typedef typename LFSVIndexCache::LocalFunctionSpace LFSV;
485  const LFSV& lfsv = lfsv_indices.localFunctionSpace();
486 
487  typedef typename LFSUIndexCache::LocalFunctionSpace LFSU;
488  const LFSU& lfsu = lfsu_indices.localFunctionSpace();
489 
490  for (size_t i = 0; i<lfsv_indices.size(); ++i)
491  for (size_t j = 0; j<lfsu_indices.size(); ++j)
492  {
493 
494  if (localcontainer(lfsv,i,lfsu,j) == 0.0)
495  continue;
496 
497  const bool constrained_v = lfsv_indices.isConstrained(i);
498  const bool constrained_u = lfsu_indices.isConstrained(j);
499 
500  typedef typename LFSVIndexCache::ConstraintsIterator VConstraintsIterator;
501  typedef typename LFSUIndexCache::ConstraintsIterator UConstraintsIterator;
502 
503  if (constrained_v)
504  {
505  if (lfsv_indices.isDirichletConstraint(i))
506  continue;
507 
508  for (VConstraintsIterator vcit = lfsv_indices.constraintsBegin(i); vcit != lfsv_indices.constraintsEnd(i); ++vcit)
509  if (constrained_u)
510  {
511  if (lfsu_indices.isDirichletConstraint(j))
512  {
513  T value = localcontainer(lfsv,i,lfsu,j) * vcit->weight();
514  if (value != 0.0)
515  globalcontainer_view.add(vcit->containerIndex(),j,value);
516  }
517  else
518  {
519  for (UConstraintsIterator ucit = lfsu_indices.constraintsBegin(j); ucit != lfsu_indices.constraintsEnd(j); ++ucit)
520  {
521  T value = localcontainer(lfsv,i,lfsu,j) * vcit->weight() * ucit->weight();
522  if (value != 0.0)
523  globalcontainer_view.add(vcit->containerIndex(),ucit->containerIndex(),value);
524  }
525  }
526  }
527  else
528  {
529  T value = localcontainer(lfsv,i,lfsu,j) * vcit->weight();
530  if (value != 0.0)
531  globalcontainer_view.add(vcit->containerIndex(),j,value);
532  }
533  }
534  else
535  {
536  if (constrained_u)
537  {
538  if (lfsu_indices.isDirichletConstraint(j))
539  {
540  T value = localcontainer(lfsv,i,lfsu,j);
541  if (value != 0.0)
542  globalcontainer_view.add(i,j,value);
543  }
544  else
545  {
546  for (UConstraintsIterator ucit = lfsu_indices.constraintsBegin(j); ucit != lfsu_indices.constraintsEnd(j); ++ucit)
547  {
548  T value = localcontainer(lfsv,i,lfsu,j) * ucit->weight();
549  if (value != 0.0)
550  globalcontainer_view.add(i,ucit->containerIndex(),value);
551  }
552  }
553  }
554  else
555  globalcontainer_view.add(i,j,localcontainer(lfsv,i,lfsu,j));
556  }
557  }
558  }
559 
560 
561  template<typename Pattern, typename RI, typename CI>
562  typename std::enable_if<
564  >::type
565  add_diagonal_entry(Pattern& pattern, const RI& ri, const CI& ci) const
566  {
567  if (ri == ci)
568  pattern.add_link(ri,ci);
569  }
570 
571  template<typename Pattern, typename RI, typename CI>
572  typename std::enable_if<
574  >::type
575  add_diagonal_entry(Pattern& pattern, const RI& ri, const CI& ci) const
576  {}
577 
582  template<typename P, typename LFSVIndices, typename LFSUIndices, typename Index>
583  void add_entry(P & globalpattern,
584  const LFSVIndices& lfsv_indices, Index i,
585  const LFSUIndices& lfsu_indices, Index j) const
586  {
587  typedef typename LFSVIndices::ConstraintsIterator VConstraintsIterator;
588  typedef typename LFSUIndices::ConstraintsIterator UConstraintsIterator;
589 
590  const bool constrained_v = lfsv_indices.isConstrained(i);
591  const bool constrained_u = lfsu_indices.isConstrained(j);
592 
593  add_diagonal_entry(globalpattern,
594  lfsv_indices.containerIndex(i),
595  lfsu_indices.containerIndex(j)
596  );
597 
598  if(!constrained_v)
599  {
600  if (!constrained_u || lfsu_indices.isDirichletConstraint(j))
601  {
602  globalpattern.add_link(lfsv_indices.containerIndex(i),lfsu_indices.containerIndex(j));
603  }
604  else
605  {
606  for (UConstraintsIterator gurit = lfsu_indices.constraintsBegin(j); gurit != lfsu_indices.constraintsEnd(j); ++gurit)
607  globalpattern.add_link(lfsv_indices.containerIndex(i),gurit->containerIndex());
608  }
609  }
610  else
611  {
612  if (lfsv_indices.isDirichletConstraint(i))
613  {
614  globalpattern.add_link(lfsv_indices.containerIndex(i),lfsu_indices.containerIndex(j));
615  }
616  else
617  {
618  for(VConstraintsIterator gvrit = lfsv_indices.constraintsBegin(i); gvrit != lfsv_indices.constraintsEnd(i); ++gvrit)
619  {
620  if (!constrained_u || lfsu_indices.isDirichletConstraint(j))
621  {
622  globalpattern.add_link(gvrit->containerIndex(),lfsu_indices.containerIndex(j));
623  }
624  else
625  {
626  for (UConstraintsIterator gurit = lfsu_indices.constraintsBegin(j); gurit != lfsu_indices.constraintsEnd(j); ++gurit)
627  globalpattern.add_link(gvrit->containerIndex(),gurit->containerIndex());
628  }
629  }
630  }
631  }
632  }
633 
637  template<typename GFSV, typename GC, typename C>
638  void set_trivial_rows(const GFSV& gfsv, GC& globalcontainer, const C& c) const
639  {
640  typedef typename C::const_iterator global_row_iterator;
641  for (global_row_iterator cit = c.begin(); cit != c.end(); ++cit)
642  globalcontainer.clear_row(cit->first,1);
643  }
644 
645  template<typename GFSV, typename GC>
646  void set_trivial_rows(const GFSV& gfsv, GC& globalcontainer, const EmptyTransformation& c) const
647  {
648  }
649 
650  template<typename GFSV, typename GC>
651  void handle_dirichlet_constraints(const GFSV& gfsv, GC& globalcontainer) const
652  {
653  globalcontainer.flush();
654  set_trivial_rows(gfsv,globalcontainer,*pconstraintsv);
655  globalcontainer.finalize();
656  }
657 
658  /* constraints */
659  const CU* pconstraintsu;
660  const CV* pconstraintsv;
661  static CU emptyconstraintsu;
662  static CV emptyconstraintsv;
663  };
664 
665  template<typename B, typename CU, typename CV>
667  template<typename B, typename CU, typename CV>
669 
670  } // namespace PDELab
671 } // namespace Dune
672 
673 #endif // DUNE_PDELAB_GRIDOPERATOR_COMMON_ASSEMBLERUTILITIES_HH
For backward compatibility – Do not use this!
Definition: adaptivity.hh:28
Definition: constraintstransformation.hh:112
Definition: assemblerutilities.hh:23
GO::Traits::Range Residual
The type of the range (residual).
Definition: assemblerutilities.hh:60
MatrixBackend::template Pattern< Jacobian, TestGridFunctionSpace, TrialGridFunctionSpace > MatrixPattern
The matrix pattern.
Definition: assemblerutilities.hh:74
GO::Traits::TrialGridFunctionSpace TrialGridFunctionSpace
The trial grid function space.
Definition: assemblerutilities.hh:26
GO::Traits::Jacobian Jacobian
The type of the jacobian.
Definition: assemblerutilities.hh:67
GO::Traits::DomainField DomainField
The field type of the domain (solution).
Definition: assemblerutilities.hh:44
GO::Traits::JacobianField JacobianField
The field type of the jacobian.
Definition: assemblerutilities.hh:64
GO::Traits::TestGridFunctionSpace TestGridFunctionSpace
The test grid function space.
Definition: assemblerutilities.hh:29
GO::BorderDOFExchanger BorderDOFExchanger
The helper class to exchange data on the processor boundary.
Definition: assemblerutilities.hh:77
GO::Traits::MatrixBackend MatrixBackend
The matrix backend of the grid operator.
Definition: assemblerutilities.hh:40
GO::Traits::Domain Solution
The type of the domain (solution).
Definition: assemblerutilities.hh:50
GO::Traits::RangeField RangeField
The field type of the range (residual).
Definition: assemblerutilities.hh:54
GO::Traits::Range Range
The type of the range (residual).
Definition: assemblerutilities.hh:57
GO::Traits::Domain Domain
The type of the domain (solution).
Definition: assemblerutilities.hh:47
GO::Traits::TrialGridFunctionSpaceConstraints TrialGridFunctionSpaceConstraints
The type of the trial grid function space constraints.
Definition: assemblerutilities.hh:33
GO::Traits::TestGridFunctionSpaceConstraints TestGridFunctionSpaceConstraints
The type of the test grid function space constraints.
Definition: assemblerutilities.hh:36
Entry in sparsity pattern.
Definition: assemblerutilities.hh:98
SparsityLink()
Standard constructor for uninitialized local index.
Definition: assemblerutilities.hh:101
void set(int i, int j)
Set both components.
Definition: assemblerutilities.hh:122
int i() const
Return first component.
Definition: assemblerutilities.hh:110
int j() const
Return second component.
Definition: assemblerutilities.hh:116
SparsityLink(int i, int j)
Initialize all components.
Definition: assemblerutilities.hh:105
Layout description for a sparse linear operator.
Definition: assemblerutilities.hh:137
void addLink(const LFSV &lfsv, std::size_t i, const LFSU &lfsu, std::size_t j)
Adds a link between DOF i of lfsv and DOF j of lfsu.
Definition: assemblerutilities.hh:155
Base class for local assembler.
Definition: assemblerutilities.hh:189
std::enable_if< AlwaysTrue< X >::value &&!std::is_same< CV, EmptyTransformation >::value >::type forwardtransform(X &x, const bool postrestrict=false) const
Transforms a vector from to . If postrestrict == true then is applied instead of the full transfor...
Definition: assemblerutilities.hh:229
void set_trivial_rows(const GFSV &gfsv, GC &globalcontainer, const C &c) const
insert dirichlet constraints for row and assemble T^T_U in constrained rows
Definition: assemblerutilities.hh:638
void add_entry(P &globalpattern, const LFSVIndices &lfsv_indices, Index i, const LFSUIndices &lfsu_indices, Index j) const
Adding matrix entry to pattern with respect to the constraints contributions. This assembles the entr...
Definition: assemblerutilities.hh:583
void etadd_symmetric(M &localcontainer, GCView &globalcontainer_view) const
Add local matrix to global matrix, and apply Dirichlet constraints in a symmetric fashion....
Definition: assemblerutilities.hh:438
std::enable_if< std::is_same< RI, CI >::value >::type add_diagonal_entry(Pattern &pattern, const RI &ri, const CI &ci) const
Definition: assemblerutilities.hh:565
LocalAssemblerBase(const CU &cu, const CV &cv)
construct AssemblerSpace, with constraints
Definition: assemblerutilities.hh:200
std::enable_if< AlwaysTrue< M >::value &&std::is_same< CV, EmptyTransformation >::value >::type scatter_jacobian(M &local_container, GCView &global_container_view, bool symmetric_mode) const
Definition: assemblerutilities.hh:421
const CU & trialConstraints() const
get the constraints on the trial grid function space
Definition: assemblerutilities.hh:205
void eread(const GCView &globalcontainer_view, LocalMatrix< T > &localcontainer) const
read local stiffness matrix for entity
Definition: assemblerutilities.hh:322
const CU * pconstraintsu
Definition: assemblerutilities.hh:659
B::size_type SizeType
Definition: assemblerutilities.hh:192
std::enable_if< AlwaysTrue< X >::value &&std::is_same< CV, EmptyTransformation >::value >::type backtransform(X &x, const bool prerestrict=false) const
Definition: assemblerutilities.hh:314
static CV emptyconstraintsv
Definition: assemblerutilities.hh:662
std::enable_if< AlwaysTrue< X >::value &&!std::is_same< CV, EmptyTransformation >::value >::type backtransform(X &x, const bool prerestrict=false) const
Transforms a vector from to . If prerestrict == true then is applied instead of the full transform...
Definition: assemblerutilities.hh:280
const CV * pconstraintsv
Definition: assemblerutilities.hh:660
std::enable_if< AlwaysTrue< M >::value &&!std::is_same< CV, EmptyTransformation >::value >::type scatter_jacobian(M &local_container, GCView &global_container_view, bool symmetric_mode) const
Scatter local jacobian to global container.
Definition: assemblerutilities.hh:355
std::enable_if< AlwaysTrue< X >::value &&std::is_same< CV, EmptyTransformation >::value >::type forwardtransform(X &x, const bool postrestrict=false) const
Definition: assemblerutilities.hh:265
void set_trivial_rows(const GFSV &gfsv, GC &globalcontainer, const EmptyTransformation &c) const
Definition: assemblerutilities.hh:646
void eadd(const LocalMatrix< T > &localcontainer, GCView &globalcontainer_view) const
write local stiffness matrix for entity
Definition: assemblerutilities.hh:340
void etadd(const M &localcontainer, GCView &globalcontainer_view) const
Definition: assemblerutilities.hh:473
static CU emptyconstraintsu
Definition: assemblerutilities.hh:661
void handle_dirichlet_constraints(const GFSV &gfsv, GC &globalcontainer) const
Definition: assemblerutilities.hh:651
void ewrite(const LocalMatrix< T > &localcontainer, GCView &globalcontainer_view) const
write local stiffness matrix for entity
Definition: assemblerutilities.hh:331
LocalAssemblerBase()
construct AssemblerSpace
Definition: assemblerutilities.hh:195
const CV & testConstraints() const
get the constraints on the test grid function space
Definition: assemblerutilities.hh:211
std::enable_if< !std::is_same< RI, CI >::value >::type add_diagonal_entry(Pattern &pattern, const RI &ri, const CI &ci) const
Definition: assemblerutilities.hh:575
A dense matrix for storing data associated with the degrees of freedom of a pair of LocalFunctionSpac...
Definition: localmatrix.hh:184
static const unsigned int value
Definition: gridfunctionspace/tags.hh:139