7#include <dune/istl/operators.hh>
20template<
class Functional>
23 typedef typename Functional::AnsatzVars::VariableSet
Vars;
24 typedef typename Functional::Scalar
Scalar;
46template <
typename Scalar>
47std::ostream&
operator<<(std::ostream &s, std::vector<Scalar>
const&
vec)
50 for(
size_t i=0; i<
vec.size(); ++i)
51 s <<
" " <<
vec[i] << std::endl;
56template<
class Functional,
class DomainElement>
59 static bool inDomain(DomainElement
const& x){
return true; }
64 template <
class>
class Vector;
66 template<
class Implementation> Implementation&
getImpl(AbstractFunctionSpaceElement& v);
67 template<
class Implementation> Implementation
const&
getImpl(AbstractFunctionSpaceElement
const& v);
373 template<
typename Implementation>
376 typedef typename Implementation::DomainElement VectorImplementation;
378 typedef typename Implementation::Estimate
Estimate;
380 ErrorEstimator(std::unique_ptr<Implementation>& imp) : myImplementation(std::move(imp)) {}
385 VectorImplementation
const& ci = getImpl<VectorImplementation>(correction);
390 std::unique_ptr<Implementation> myImplementation;
393 template<
class ErrorEst,
class Gr
idMan>
400 template <
class Gr
idManager,
class Estimate>
405 : gridMan(gm), nMarked(0)
412 virtual int size() {
return gridMan.
grid().size(0); }
420 nMarked = cdmarks.getData().sum();
422 gridMan.
mark(cdmarks.getData());
445 boost::signals2::connection gridChange;
Interfaces for function space oriented algorithms.
Representation of an adaptive grid and a simple set of operations thereon.
boost::signals2::signal< void()> gridWillChange
Inform others that the grid will change.
Representation of an error estimate, i.e. the output of an error estimator.
Representation of an error estimator.
Abstract Vector for function space algorithms.
Implements AbstractAdaptiveGrid, uses a bulk criterion as a marking strategy.
virtual void adapt()
Change grid according to marked elements.
AdaptiveGrid(GridManager &gm)
virtual void flushMarks()
Remove all marks in the grid.
virtual void mark(AbstractErrorEstimate &estimate, double portion)
Mark elements, using an error estimate that hold error indicators.
virtual int size()
Number of patches.
Bridge class for an error estimator, implements AbstractErrorEstimator.
Implementation::Estimate Estimate
ErrorEstimator(std::unique_ptr< Implementation > &imp)
virtual std::unique_ptr< AbstractErrorEstimate > createEstimate(AbstractFunctionSpaceElement const &correction, AbstractLinearization const &lin) const
UnknownLinearization Linearization
Class that stores information for each cell of a grid.
bool preAdapt()
Calls grid.preAdapt().
bool adapt()
Refines each marked leaf cell of the grid and prolongates registered FE functions to the new leaf gri...
Grid const & grid() const
Returns a const reference on the owned grid.
void postAdapt()
Calls grid.postAdapt().
void flushMarks()
Remove all cell marks from the grid.
bool mark(int refCount, typename Grid::template Codim< 0 >::Entity const &cell)
Marks the given cell for refinement or coarsening.
Class that takes care of the transfer of data (of each FunctionSpaceElement) after modification of th...
Utility classes for the definition and use of variational functionals.
boost::signals2::signal< void(Status)> informAboutRefinement
A signal that is emitted thrice on grid modifications, once before adaptation takes place and twice a...
Status
The argument type of the signal that is emitted before and after grid adaptation.
std::unique_ptr< T > makeUP(T *t)
Convenience routine: makes an unique_ptr of the right type.
std::unique_ptr< ErrorEstimator< Est > > makeErrorEstimator(Est *est)
Convenience routine: makes an ErrorEstimator of the right type.
ErrorEst extendMarkings(ErrorEst const &, GridMan &)
Implementation & getImpl(AbstractFunctionSpaceElement &v)
Get the implementation of an AbstractFunctionSpaceElement.
Dune::FieldVector< Scalar, dim > Vector
std::ostream & operator<<(std::ostream &s, std::vector< Scalar > const &vec)
CellData< Grid, int >::CellDataVector markByBulkCriterion(CellData< Grid, T > &ic, double Theta)
Create a CellDataVector, in which the largest entities of *this are marked by 1, using the "bulk crit...
static void getMatrixBlock(MatrixAsTriplet< Scalar > &mat, Functional const &fu, Vars const &origin, int row, int col)
static Scalar getValue(Functional const &fu, Vars const &origin)
static void getRHSBlock(std::vector< Scalar > &rhs, Functional const &fu, Vars const &origin, int row)
Functional::Scalar Scalar
Functional::AnsatzVars::VariableSet Vars
static constexpr bool anyPresent
static bool inDomain(DomainElement const &x)