133 boost::fusion::result_of::size<ErrorDescriptions>::type::value> >& ind,
134 ErrorDescriptions
const& varDesc,
137 TestFunctions
const& tf,
138 Spaces
const& spaces,
139 TestSpaces
const& testSpaces)
142 using namespace Dune;
148 typedef typename Grid::ctype CoordType;
149 int const dim = Grid::dimension;
151 IndexSet const& indexSet = at_c<0>(spaces)->grid().leafIndexSet();
153 ind.resize(indexSet.size(0));
155 for(
int i=0; i<ind.size(); ++i)
156 for(
int j=0; j<ind[i].N(); ++j)
161 SfCache sfCache,sfCacheN,sfCacheT;
165 typedef typename result_of::as_vector<
166 typename result_of::transform<Spaces, GetEvaluators<SfCache> >
::type
169 typedef typename result_of::as_vector<
170 typename result_of::transform<TestSpaces, GetEvaluators<SfCache> >
::type
178 typedef typename IndexSet::template Codim<0>::template Partition<All_Partition>::Iterator CellIterator;
179 typedef typename CellIterator::Entity::LeafIntersectionIterator LII;
180 typedef typename CellIterator::Entity Entity;
182 typename F::DomainCache domainCache(f.createDomainCache(2));
183 typename FS::DomainCache domainCacheSimpl(fs.createDomainCache(2+8));
184 typename FS::DomainCache domainCacheNeigh(fs.createDomainCache(2+8));
185 typename FS::BoundaryCache boundaryCache(fs.createBoundaryCache(6));
189 CellIterator end = indexSet.template end<0,All_Partition>();
190 for (CellIterator ci=indexSet.template begin<0,All_Partition>(); ci!=end; ++ci) {
192 domainCache.moveTo(*ci);
193 domainCacheSimpl.moveTo(*ci);
197 int shapeFunctionMaxOrder =
maxOrder(evaluators);
198 shapeFunctionMaxOrder = std::max(shapeFunctionMaxOrder,
maxOrder(testEvaluators));
199 int p = f.integrationOrder(*ci,shapeFunctionMaxOrder,
false);
200 int pb = f.integrationOrder(*ci,shapeFunctionMaxOrder,
true);
201 pb=shapeFunctionMaxOrder+2;
204 GeometryType gti = ci->type();
206 QuadratureRule<CoordType, dim>
const& qri=QuadratureRules<CoordType,dim>::rule(gti,p);
208 size_t nQuadPosi = qri.size();
209 for (
size_t g=0; g<nQuadPosi; ++g) {
214 domainCache.evaluateAt(quadPos,evaluators);
215 CoordType weightTimesDetJac(ci->geometry().integrationElement(quadPos));
216 weightTimesDetJac *= qri[g].weight();
218 (ind[indexSet.index(*ci)],weightTimesDetJac,testEvaluators, tf,domainCache));
221 LII faceEnd = ci->ileafend();
222 for (LII face=ci->ileafbegin(); face!=faceEnd; ++face) {
223 if(face.neighbor()) {
225 typename LII::EntityPointer o=face.outside();
226 domainCacheNeigh.moveTo(*o);
229 }
else if(face.boundary())
231 boundaryCache.moveTo(face);
233 GeometryType gt=face.intersectionSelfLocal().type();
234 QuadratureRule<CoordType, dim-1>
const&
qr=QuadratureRules<CoordType,dim-1>::rule(gt,pb);
235 size_t nQuadPos=
qr.size();
236 for(
size_t g=0; g<nQuadPos; ++g){
237 FieldVector<CoordType, dim-1>
const& quadPos =
qr[g].position();
241 domainCacheSimpl.evaluateAt(quadPosInSelf,evaluators);
243 outerNormal *=
qr[g].weight();
249 domainCacheNeigh.evaluateAt(quadPosInNeigh,evaluatorsNeigh);
252 typename FS::DomainCache>(ind[indexSet.index(*ci)],outerNormal,testEvaluators, tf,domainCacheSimpl,domainCacheNeigh));
254 }
else if(face.boundary())
256 boundaryCache.evaluateAt(quadPos,evaluators);
258 CoordType weightTimesDetJac = face.intersectionGlobal().integrationElement(quadPos);
259 weightTimesDetJac *=
qr[g].weight();
262 typename FS::DomainCache,
typename FS::BoundaryCache>(ind[indexSet.index(*ci)],outerNormal, weightTimesDetJac,
263 testEvaluators, tf,domainCacheSimpl,boundaryCache));
void residualTimesTestFunction(std::vector< Dune::FieldVector< typename SpaceType< Spaces, 0 >::type::RT, boost::fusion::result_of::size< ErrorDescriptions >::type::value > > &ind, ErrorDescriptions const &varDesc, F const &f, FS const &fs, TestFunctions const &tf, Spaces const &spaces, TestSpaces const &testSpaces)
Evaluates strong residual, applied to some test-function <f(x), tf>