KASKADE 7 development version
goalOrientedErrorEstimator.hh
Go to the documentation of this file.
1/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2/* */
3/* This file is part of the library KASKADE 7 */
4/* https://www.zib.de/research/projects/kaskade7-finite-element-toolbox */
5/* */
6/* Copyright (C) 2002-2012 Zuse Institute Berlin */
7/* */
8/* KASKADE 7 is distributed under the terms of the ZIB Academic License. */
9/* see $KASKADE/academic.txt */
10/* */
11/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
12
13#ifndef GOAL_ORIENTED_ERROR_ESTIMATOR_HH
14#define GOAL_ORIENTED_ERROR_ESTIMATOR_HH
15
16#include <cmath>
17#include <iostream>
18#include <type_traits>
19#include <utility>
20
21#include <boost/fusion/include/at_c.hpp>
22#include <boost/mpl/at.hpp>
23
28#include "fem/variables.hh"
29#include "linalg/direct.hh"
30#include "utilities/enums.hh"
31
32namespace Kaskade
33{
34 bool biggerThanAbs(const std::pair<double,int>& x1, const std::pair<double,int>& x2)
35 {
36 return fabs(x1.first)>fabs(x2.first);
37 }
38
39 double add(const double& x1, const std::pair<double,int>& x2)
40 {
41 return x1+x2.first;
42 }
43
44 template <template <class,class> class TemplateFunctional, class OriginalVariableSetDescription, class ExtensionVariableSetDescription, class ExtensionSpace>
46 {
47 static constexpr int noOfVariables = ExtensionVariableSetDescription::noOfVariables;
48
49 // define functional types
50 typedef TemplateFunctional<OriginalVariableSetDescription,OriginalVariableSetDescription> F_hh;
51 typedef TemplateFunctional<OriginalVariableSetDescription,ExtensionVariableSetDescription> F_he;
52 typedef TemplateFunctional<ExtensionVariableSetDescription,OriginalVariableSetDescription> F_eh;
53 typedef TemplateFunctional<ExtensionVariableSetDescription,ExtensionVariableSetDescription> F_ee;
54
55 static constexpr int yIdx = F_hh::yIdx;
56 static constexpr int uIdx = F_hh::uIdx;
57 static constexpr int pIdx = F_hh::lIdx;
58
59 // define an assembler for each functional
64
65 typedef typename OriginalVariableSetDescription::VariableSet VariableSet;
66 typedef typename ExtensionVariableSetDescription::VariableSet ExtensionVariableSet;
67
68 typedef typename ExtensionVariableSetDescription::GridView::template Codim<0>::Iterator CellIterator;
69
70 public:
71 typedef typename F_hh::Scalar Scalar;
72 static constexpr int dim = VariableSet::Descriptions::Grid::dimension;
73
74 // error estimator and corresponding assembler
75 typedef HierarchicErrorEstimator<LinearizationAt<F_hh>,ExtensionVariableSetDescription,ExtensionVariableSetDescription,HierarchicErrorEstimatorDetail::TakeAllD2<LinearizationAt<F_hh> > > ErrorEstimator;
77
78 // coefficient vectors
79 typedef typename OriginalVariableSetDescription::template CoefficientVectorRepresentation<>::type Vector;
80 typedef typename OriginalVariableSetDescription::template CoefficientVectorRepresentation<> VectorCreator;
81 typedef typename OriginalVariableSetDescription::template CoefficientVectorRepresentation<uIdx,uIdx+1>::type UVector;
82 typedef typename OriginalVariableSetDescription::template CoefficientVectorRepresentation<yIdx,yIdx+1>::type YVector;
83 typedef typename OriginalVariableSetDescription::template CoefficientVectorRepresentation<uIdx,uIdx+1> UVectorCreator;
84 typedef typename OriginalVariableSetDescription::template CoefficientVectorRepresentation<yIdx,yIdx+1> YVectorCreator;
85
86 // coefficient vectors in extended space
87 typedef typename ExtensionVariableSetDescription::template CoefficientVectorRepresentation<>::type ExtensionVector;
88 typedef typename ExtensionVariableSetDescription::template CoefficientVectorRepresentation<uIdx,uIdx+1>::type UExtensionVector;
89 typedef typename ExtensionVariableSetDescription::template CoefficientVectorRepresentation<yIdx,yIdx+1>::type YExtensionVector;
90 typedef typename ExtensionVariableSetDescription::template CoefficientVectorRepresentation<> ExtensionVectorCreator;
91 typedef typename ExtensionVariableSetDescription::template CoefficientVectorRepresentation<uIdx,uIdx+1> UExtensionVectorCreator;
92 typedef typename ExtensionVariableSetDescription::template CoefficientVectorRepresentation<yIdx,yIdx+1> YExtensionVectorCreator;
93
94 GoalOrientedErrorEstimator(ExtensionVariableSetDescription& extensionVariableSetDescription_, ExtensionSpace& extensionSpace_, Scalar fraction_=0.8, size_t maxNoOfCells_=5000, bool onlyLowerTriangle_=false)
95 : extensionVariableSetDescription(extensionVariableSetDescription_), extensionSpace(extensionSpace_), extensionAssembler(extensionVariableSetDescription.spaces),
96 fraction(fraction_), maxNoOfCells(maxNoOfCells_), onlyLowerTriangle(onlyLowerTriangle_)
97 {}
98
100
101 void operator()(AbstractVector const& x_, AbstractVector const& dx_, int step)
102 {
103 if(extensionSpace.gridManager().grid().size(0) > maxNoOfCells)
104 {
105 std::cout << "Skipping error estimation." << std::endl;
106 return;
107 }
108
109 std::cout << "Starting error estimation." << std::endl;
110
111 Bridge::Vector<VariableSet> const& x = dynamic_cast<const Bridge::Vector<VariableSet>&>(x_);
112 Bridge::Vector<VariableSet> const& dx = dynamic_cast<const Bridge::Vector<VariableSet>&>(dx_);
113
114 //OriginalVariableSetDescription const& variableSetDescription = x.get().descriptions;
115
116 using namespace boost::fusion;
117
119 DirectType directType = DirectType::UMFPACK;
120
121 std::cout << "computing residual in extension space." << std::endl;
122 //ExtensionAssembler extensionAssembler(extensionVariableSetDescription.spaces);
123 extensionAssembler.assemble(ErrorEstimator(LinearizationAt<F_hh>(*f_hh,x.get()),dx.get()));
124 AssembledGalerkinOperator<ExtensionAssembler,0,noOfVariables,0,noOfVariables> H_ee(extensionAssembler); // in space extension
125 ExtensionVector rhs_e(extensionAssembler.rhs());
126 rhs_e *= -1;
127 ExtensionVector dx_e(ExtensionVectorCreator::init(extensionVariableSetDescription));
128 // compute correction in extension space
129 directInverseOperator(H_ee,directType,property).apply(rhs_e,dx_e);
130 // create all necessary assemblers
131 Assembler_hh assembler_hh(x.get().descriptions.spaces);
132 Assembler_ee assembler_ee(extensionVariableSetDescription.spaces);
133 Assembler_eh assembler_eh(extensionVariableSetDescription.spaces);
134 Assembler_he assembler_he(extensionVariableSetDescription.spaces);
135
136 assembler_hh.assemble(linearization(*f_hh,x.get()));
137 assembler_he.assemble(linearization(*f_he,x.get()));
138 ExtensionVariableSet x_e(extensionVariableSetDescription);
139 x_e *= 0;
140 assembler_eh.assemble(linearization(*f_eh,x_e));
141 assembler_ee.assemble(linearization(*f_ee,x_e));
142
143 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
144 std::cout << "computing weight functions 1" << std::endl;
145 // compute weight function for state variable
146 // 1. get rhs
147 YVector tmpRhs_h(YVectorCreator::init(x.get().descriptions));
148 YExtensionVector tmpRhs_e(YExtensionVectorCreator::init(extensionVariableSetDescription));
149
150 UVector du_h( at_c<uIdx>(dx.get().data).coefficients() );
151 UExtensionVector du_e( at_c<uIdx>(dx_e.data) );
152
153 {
158
159 B_hh.apply(du_h, tmpRhs_h);
160 B_eh.applyscaleadd(1.0, du_e, tmpRhs_h);
161 tmpRhs_h *= -1;
162 B_he.apply(du_h, tmpRhs_e);
163 B_ee.applyscaleadd(1.0, du_e, tmpRhs_e);
164 tmpRhs_e *= -1;
165 }
166
167 // 2. compute weight
172 YVector wy_h(YVectorCreator::init(x.get().descriptions));
173 wy_h *= 0;
174 YExtensionVector wy_e(YExtensionVectorCreator::init(extensionVariableSetDescription));
175
176 //JacobiPreconditioner<AssembledGalerkinOperator<Assembler_hh,pIdx,pIdx+1,yIdx,yIdx+1> >(A_hh).apply(tmpRhs_h,wy_h);
177 //A_hh.apply(tmpRhs_h, wy_h);
179 ds_hh.apply(tmpRhs_h, wy_h);
180 A_he.applyscaleadd(-1.0,wy_h,tmpRhs_e);
181 //JacobiPreconditioner<AssembledGalerkinOperator<Assembler_ee,pIdx,pIdx+1,yIdx,yIdx+1> >(A_ee).apply(tmpRhs_e,wy_e);
182 directInverseOperator(A_ee,directType,property).apply(tmpRhs_e, wy_e);
183
184 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
185 std::cout << "computing weight functions 2" << std::endl;
186 // compute weight function for adjoint variable
187 // 1. get rhs
188 {
193 H_hh.apply(wy_h,tmpRhs_h);
194 H_eh.applyscaleadd(1.0,wy_e,tmpRhs_h);
195 tmpRhs_h *= -1;
196 H_he.apply(wy_h,tmpRhs_e);
197 H_ee.applyscaleadd(1.0,wy_e,tmpRhs_e);
198 tmpRhs_e *= -1;
199 }
200
201 // 2. compute weight
202 YVector wp_h(YVectorCreator::init(x.get().descriptions));
203 YExtensionVector wp_e(YExtensionVectorCreator::init(extensionVariableSetDescription));
204 {
205 //JacobiPreconditioner<AssembledGalerkinOperator<Assembler_hh,pIdx,pIdx+1,yIdx,yIdx+1> >(A_hh).apply(tmpRhs_h,wp_h);
206 directInverseOperator(A_hh,directType,property).apply(tmpRhs_h, wp_h);
207 A_he.applyscaleadd(-1.0,wp_h, tmpRhs_e);
208 //JacobiPreconditioner<AssembledGalerkinOperator<Assembler_ee,pIdx,pIdx+1,yIdx,yIdx+1> >(A_ee).apply(tmpRhs_e,wp_e);
209 directInverseOperator(A_ee,directType,property).apply(tmpRhs_e, wp_e);
210 }
211
212 Scalar estimatedError = 0.5 * ( at_c<0>(wy_e.data)*at_c<yIdx>(rhs_e.data)
213 + at_c<0>(du_e.data)*at_c<uIdx>(rhs_e.data)
214 + at_c<0>(wp_e.data)*at_c<pIdx>(rhs_e.data) );
215
216 std::cout << "estimated error: " << estimatedError << std::endl;
217
218 // get number of cells corresponding to edges resp. edge shape functions used in the error estimator
219 CellIterator cend = extensionVariableSetDescription.gridView.template end<0>();
220 std::vector<size_t> neighBoringCells(extensionVariableSetDescription.gridView.size(dim-1),0);
221 for(CellIterator ci = extensionVariableSetDescription.gridView.template begin<0>(); ci!=cend; ++ci)
222 {
223 // iterate over cells edges
224 for(int edgeIdInEntity=0; edgeIdInEntity<3; ++edgeIdInEntity)
225 {
226 int id = extensionVariableSetDescription.gridView.indexSet().subIndex(*ci, edgeIdInEntity, dim-1);
227 if(id < neighBoringCells.size())
228 neighBoringCells[id]++;
229 }
230 }
231// for(size_t i=0; i<neighBoringCells.size(); ++i) if(neighBoringCells[i]==0) std::cout << "missing cells at edge id: " << i << std::endl;
232//
233 // estimate cell-wise error distribution
234 typename ExtensionVariableSetDescription::VariableSet mySol(extensionVariableSetDescription);
235 mySol *= 0;
236 std::vector<Scalar> edgeErrorIndicators(at_c<yIdx>(dx_e.data).N());
237 std::cout << "edgeErrorIndicators: " << edgeErrorIndicators.size() << std::endl;
238 std::cout << "mySol: " << boost::fusion::at_c<1>(mySol.data).coefficients().N() << std::endl;
239 for(size_t i=0; i<edgeErrorIndicators.size(); ++i)
240 {
241 edgeErrorIndicators[i] = 0.5 * ( at_c<0>(wy_e.data)[i]*at_c<yIdx>(rhs_e.data)[i] + at_c<0>(du_e.data)[0]*at_c<uIdx>(rhs_e.data)[0] + at_c<0>(wp_e.data)[i]*at_c<pIdx>(rhs_e.data)[i] );
242 boost::fusion::at_c<1>(mySol.data).coefficients()[i][0] = edgeErrorIndicators[i];
243 edgeErrorIndicators[i] /= neighBoringCells[i];
244 }
245
246 errorDistribution.clear();
247 errorDistribution.resize(extensionVariableSetDescription.gridView.size(0),std::make_pair(0.0,0));
248 auto const& is = extensionSpace.gridManager().grid().leafIndexSet();
249//
250// typedef ErrorDistribution<F_hh,ExtensionVariableSetDescription> EnergyError;
251// EnergyError energyError(*f_hh,x.get(),mySol);
252// typedef VariationalFunctionalAssembler<LinearizationAt<EnergyError> > EnergyErrorAssembler;
253// EnergyErrorAssembler eeAssembler(extensionSpace.gridManager(), energyError.getSpaces());
254//
255// eeAssembler.assemble(linearization(energyError,x.get()), EnergyErrorAssembler::RHS);
256// typename EnergyError::ErrorVector distError( eeAssembler.rhs() );
257// //if(!nearMinimizer_) distError *= 0;
258// typename EnergyError::AnsatzVars::VariableSet mde( energyError.getVariableSetDescription() );
259// mde = distError;
260
261 for (CellIterator ci=extensionVariableSetDescription.gridView.template begin<0>(); ci!=cend; ++ci)
262// errorDistribution[is.index(*ci)] = std::make_pair( fabs(boost::fusion::at_c<0>(mde.data).value(*ci,Dune::FieldVector<Scalar,dim>(0.3))) , is.index(*ci));
263 {
264 size_t index = is.index(*ci);
265 errorDistribution[index] = std::make_pair(0,index);
266 size_t nEdges = (dim==2) ? 3 : 6;
267 for(int edgeIdInEntity=0; edgeIdInEntity<nEdges; ++edgeIdInEntity)
268 {
269 typedef typename ExtensionVariableSetDescription::GridView::Grid Grid;
270// std::cout << "edgeInInEntity: " << edgeIdInEntity << std::endl;
271 size_t globalEdgeId = Dune::GenericReferenceElements<typename Grid::ctype,Grid::dimension>::simplex().subEntity(edgeIdInEntity,Grid::dimension-1,0,Grid::dimension);
272 //size_t globalEdgeId = is.subIndex(*ci, edgeIdInEntity, dim-1);
273 errorDistribution[index].first += edgeErrorIndicators[globalEdgeId];
274 }
275 }
276
277 totalError = std::accumulate(errorDistribution.begin(), errorDistribution.end(), 0.0, add);
278 // typedef FEFunctionSpace<DiscontinuousLagrangeMapper<Scalar,typename ExtensionSpace::GridView> > AnsatzSpace;
279 // typedef boost::fusion::vector<AnsatzSpace const*> AnsatzSpaces;
280 // typedef Variable<SpaceIndex<0>,Components<1>,VariableId<0> > AnsatzVariableInformation;
281 // typedef boost::fusion::vector<AnsatzVariableInformation> VariableDescriptions;
282 // typedef VariableSetDescription<AnsatzSpaces,VariableDescriptions> AnsatzVars;
283 // AnsatzSpace discontinuousSpace(extensionSpace.gridManager(),extensionSpace.gridManager().grid().leafGridView(),0);
284 // AnsatzSpaces discontinuousSpaces(&discontinuousSpace);
285 // std::string dname[] = { "error" };
286 // AnsatzVars errorRepVarSetDesc(discontinuousSpaces,dname);
287 // typename AnsatzVars::VariableSet discontinuousErrorRepresentation(errorRepVarSetDesc);
288 //
289 // std::cout << "before transfer" << std::endl;
290 // spaceTransfer(boost::fusion::at_c<0>(discontinuousErrorRepresentation.data),
291 // boost::fusion::at_c<0>(edgeErrorElement.data));
292 // std::cout << "after" << std::endl;
293 //
295 //
296 // for(CellIterator ci = extensionVariableSetDescription.gridView.template begin<0>(); ci!=cend; ++ci)
297 // {
300 // typedef typename ExtensionSpace::Mapper::GlobalIndexRange IndexMapper;
301 // Scalar err = 0;
302 // IndexMapper mapper = extensionSpace.mapper().globalIndices(*ci);
303 // typename IndexMapper::iterator iend = mapper.end();
304 // size_t index = extensionVariableSetDescription.gridView.indexSet().index(*ci);
305 // std::cout << "index: " << index << std::endl;
306 // if(index==2)
307 // {
308 // for(typename IndexMapper::iterator iter=mapper.begin(); iter!=iend; ++iter)
309 // {
310 // std::cout << "it: " << *iter << std::endl;
311 // std::cout << "err: " << err << std::endl;
312 // std::cout << "eei: " << edgeErrorIndicators[*iter] << std::endl;
314 //
315 // err += edgeErrorIndicators[*iter];//neighBoringCells[*iter];
316 // }
317 // }
318 // else
319 // for(typename IndexMapper::iterator iter=mapper.begin(); iter!=iend; ++iter) err += edgeErrorIndicators[*iter];///neighBoringCells[*iter];
320 //
322 //
323 // errorDistribution[index] = std::make_pair(err,index);
324 // if(std::isinf(err))
325 // {
326 // std::cout << "err: inf at index " << index << std::endl;
327 // exit(-1);
328 // }
329 // if(std::isnan(err))
330 // {
331 // std::cout << "err: nan at index " << index << std::endl;
332 // exit(-1);
333 // }
334 // }
335 // std::cout << "total error " << std::endl;
336 // totalError = std::accumulate(errorDistribution.begin(), errorDistribution.end(), 0.0, add);
337 // std::cout << "total error done" << std::endl;
347
348 }
349
350 template <typename... Args>
351 void initializeFunctionals(Args... args)
352 {
353 f_hh.reset(new F_hh(args...));
354 f_eh.reset(new F_eh(args...));
355 f_he.reset(new F_he(args...));
356 f_ee.reset(new F_ee(args...));
357 }
358
359 bool nearMinimizer() const { return true; }
360
362 {
363 if(extensionSpace.gridManager().grid().size(0) > maxNoOfCells)
364 {
365 std::cout << "ERROR ESTIMATOR: Grid has more than " << maxNoOfCells << " cells -> No more refinement." << std::endl;
366 return;
367 }
368
369 std::sort(errorDistribution.begin(), errorDistribution.end(), biggerThanAbs);
370
371 double errLevel = errorDistribution[3*errorDistribution.size()/4].first;
372 auto const& is = extensionSpace.gridManager().grid().leafIndexSet();
373
374 CellIterator cend = extensionVariableSetDescription.gridView.template end<0>();
375 for (CellIterator ci=extensionVariableSetDescription.gridView.template begin<0>(); ci!=cend; ++ci) // iterate over cells
376 if(errorDistribution[is.index(*ci)].first > errLevel) extensionSpace.gridManager().mark(1,*ci);
377
378// Scalar bulkCriterionTolerance = fraction*totalError;
379// std::cout << "totalError: " << totalError << std::endl;
380// std::cout << "bulkCriterionTolerance: " << bulkCriterionTolerance << std::endl;
381// Scalar bulkErrorSquared = 0;
382//
383// std::vector<std::pair<Scalar,size_t> > bulkErrorDistribution;
384// auto const& is = extensionSpace.gridManager().grid().leafIndexSet();
385// CellIterator cend = extensionVariableSetDescription.gridView.template end<0>();
386//
387// while(bulkErrorSquared < bulkCriterionTolerance)
388// {
389// bulkErrorDistribution.push_back(errorDistribution[bulkErrorDistribution.size()]);
390// bulkErrorSquared += bulkErrorDistribution.back().first;
391// }
392//
393// std::cout << "number of candidates for refinement: " << bulkErrorDistribution.size() << std::endl;
394//
395//
396//
397// // Refine mesh.
398// for (CellIterator ci=extensionVariableSetDescription.gridView.template begin<0>(); ci!=cend; ++ci) // iterate over cells
399// {
400// for(int i=0; i<bulkErrorDistribution.size(); ++i) // iterate over chosen part of the error distribution
401// if(is.index(*ci) == bulkErrorDistribution[i].second)
402// extensionSpace.gridManager().mark(1,*ci);
403// }
404
405 extensionSpace.gridManager().adaptAtOnce();
406 }
407
409 {
410 return fabs(totalError);
411 }
412
413 size_t gridSize() const final
414 {
415 return extensionSpace.gridManager().grid().size(0);
416 }
417
418 private:
419 //OriginalVariableSetDescription const& variableSetDescription;
420 ExtensionVariableSetDescription& extensionVariableSetDescription;
421 ExtensionSpace& extensionSpace;
422 ExtensionAssembler extensionAssembler;
423 Scalar fraction;
424 Scalar totalError;
425 size_t maxNoOfCells;
426 bool onlyLowerTriangle;
427 std::vector<std::pair<double,size_t> > errorDistribution;
428 // std::vector<Scalar> errorDistribution;
429 std::unique_ptr<F_hh> f_hh;
430 std::unique_ptr<F_eh> f_eh;
431 std::unique_ptr<F_he> f_he;
432 std::unique_ptr<F_ee> f_ee;
433 };
434}
435
436#endif
An adaptor presenting a Dune::LinearOperator <domain_type,range_type> interface to a contiguous sub-b...
virtual void apply(Domain const &x, Range &b) const
compute
virtual void applyscaleadd(Scalar alpha, Domain const &x, Range &b) const
Compute .
Mathematical Vector that supports copy-on-write, implements AbstractFunctionSpaceElement.
Implementation const & get() const
Access to the data.
VariationalFunctionalAssembler< ErrorEstimator > ExtensionAssembler
ExtensionVariableSetDescription::template CoefficientVectorRepresentation< uIdx, uIdx+1 > UExtensionVectorCreator
ExtensionVariableSetDescription::template CoefficientVectorRepresentation ::type ExtensionVector
OriginalVariableSetDescription::template CoefficientVectorRepresentation ::type Vector
OriginalVariableSetDescription::template CoefficientVectorRepresentation VectorCreator
OriginalVariableSetDescription::template CoefficientVectorRepresentation< yIdx, yIdx+1 > YVectorCreator
ExtensionVariableSetDescription::template CoefficientVectorRepresentation< uIdx, uIdx+1 >::type UExtensionVector
ExtensionVariableSetDescription::template CoefficientVectorRepresentation ExtensionVectorCreator
ExtensionVariableSetDescription::template CoefficientVectorRepresentation< yIdx, yIdx+1 > YExtensionVectorCreator
OriginalVariableSetDescription::template CoefficientVectorRepresentation< yIdx, yIdx+1 >::type YVector
OriginalVariableSetDescription::template CoefficientVectorRepresentation< uIdx, uIdx+1 > UVectorCreator
void operator()(AbstractVector const &x_, AbstractVector const &dx_, int step)
ExtensionVariableSetDescription::template CoefficientVectorRepresentation< yIdx, yIdx+1 >::type YExtensionVector
GoalOrientedErrorEstimator(ExtensionVariableSetDescription &extensionVariableSetDescription_, ExtensionSpace &extensionSpace_, Scalar fraction_=0.8, size_t maxNoOfCells_=5000, bool onlyLowerTriangle_=false)
HierarchicErrorEstimator< LinearizationAt< F_hh >, ExtensionVariableSetDescription, ExtensionVariableSetDescription, HierarchicErrorEstimatorDetail::TakeAllD2< LinearizationAt< F_hh > > > ErrorEstimator
OriginalVariableSetDescription::template CoefficientVectorRepresentation< uIdx, uIdx+1 >::type UVector
Defines assembly of hierarchically extended problems for defining DLY style error estimators.
Dune::LinearOperator interface for inverse operators.
Definition: direct.hh:553
virtual void apply(Domain const &x, Range &y) const
Definition: direct.hh:564
Proxy class for the linearization of a nonlinear functional.
A class for assembling Galerkin representation matrices and right hand sides for variational function...
TestVariableSetDescription::template CoefficientVectorRepresentation< first, last >::type rhs() const
Returns a contiguous subrange of the rhs coefficient vectors.
void assemble(F const &f, unsigned int flags=Assembler::EVERYTHING, int nThreads=0, bool verbose=false)
Assembly without block filter or cell filter.
Error estimation via hierachic FEM.
DirectType
Available direct solvers for linear equation systems.
Definition: enums.hh:35
@ MUMPS
MUMPS sparse solver.
@ UMFPACK
UMFPack from SuiteSparse, using 32 bit integer indices.
MatrixProperties
Characterizations of sparse matrix properties.
Definition: enums.hh:76
InverseLinearOperator< DirectSolver< typename AssembledGalerkinOperator< GOP, firstRow, lastRow, firstCol, lastCol >::Domain, typename AssembledGalerkinOperator< GOP, firstRow, lastRow, firstCol, lastCol >::Range > > directInverseOperator(AssembledGalerkinOperator< GOP, firstRow, lastRow, firstCol, lastCol > const &A, DirectType directType, MatrixProperties properties)
Definition: direct.hh:618
bool biggerThanAbs(const std::pair< double, int > &x1, const std::pair< double, int > &x2)
double add(const double &x1, const std::pair< double, int > &x2)
Bridge classes that connect low level FE algorithms to higher level algorithms.
Variables and their descriptions.