19 template <
class ct,
int dim>
20 void PointProvider<ct, dim, 0>::
21 registerQuadratureImpl(
const QuadratureType& quad)
23 QuadratureKeyType key( quad.geometryType(), quad.id() );
25 if (points_.find( key ) == points_.end() )
28 if( ! threadPool_.singleThreadMode() )
30 DUNE_THROW(SingleThreadModeError,
"PointProvider::registerQuadrature: only call in single thread mode!");
33 PointIteratorType it =
36 GlobalPointVectorType(quad.nop()))
38 for (
size_t i = 0; i < quad.nop(); ++i)
39 it->second[i] = quad.point(i);
46 template <
class ct,
int dim>
47 const typename PointProvider<ct, dim, 0>::GlobalPointVectorType&
48 PointProvider<ct, dim, 0>::getPointsImpl(
const size_t id,
const GeometryType& elementGeo)
50 QuadratureKeyType key( elementGeo,
id );
52 typename PointContainerType::const_iterator pos = points_.find( key );
54 if( pos == points_.end() )
56 std::cerr <<
"Unable to find quadrature points in list (key = " << key <<
")." <<
std::endl;
57 for( pos = points_.begin(); pos != points_.end(); ++pos )
66 template <
class ct,
int dim>
67 const typename PointProvider<ct, dim, 1>::MapperVectorPairType&
73 MapperIteratorType it = mappers_.find( key );
74 if (it == mappers_.end())
77 for (
size_t i = 0; i < quad.
nop(); ++i)
79 pts[i] = quad.
point(i);
81 it = addEntryImpl(quad, pts, elementGeo);
87 template <
class ct,
int dim>
95 MapperIteratorType it = mappers_.find( key );
96 if (it == mappers_.end()) {
97 it = addEntryImpl(quad, pts, elementGeo);
103 template <
class ct,
int dim>
109 assert(points_.find(key) != points_.end());
110 return points_.find(key)->second;
113 template <
class ct,
int dim>
116 const LocalPointVectorType& pts,
120 if( ! threadPool_.singleThreadMode() )
126 QuadratureKeyType key ( elementGeo, quad.id() );
128 const auto &refElem = Dune::ReferenceElements<ct, dim>::general(elementGeo);
130 const int numLocalPoints = pts.size();
131 const int numFaces = refElem.size(codim);
132 const int numGlobalPoints = numFaces*numLocalPoints;
134 PointIteratorType pit =
136 GlobalPointVectorType(numGlobalPoints))).first;
137 MapperIteratorType mit =
139 std::make_pair(MapperVectorType(numFaces), MapperVectorType(numFaces) ))).first;
141 MapperIteratorType iit;
145 const size_t nItp = itps.
size();
146 for (
int face = 0; face < numFaces; ++face)
150 MapperType pMap(numLocalPoints);
151 MapperType itpMap(numLocalPoints);
153 MapperVectorPairType& map = mit->second;
155 for (
int pt = 0; pt < numLocalPoints; ++pt, ++globalNum)
158 pit->second[globalNum] =
159 refElem.template geometry<codim>(face).global( pts[pt] );
164 for(
size_t i=0; i<nItp; ++i )
166 if( (itps[ i ] - pit->second[globalNum]).two_norm() < 1e-12 )
175 pMap[pt] = globalNum;
178 map.first[face] = pMap;
181 map.second[face] = itpMap;
#define DUNE_THROW(E,...)
Exception thrown when a code segment that is supposed to be only accessed in single thread mode is ac...
Definition mpimanager.hh:43
Definition pointmapper.hh:19
Definition pointprovider.hh:25
static void registerQuadrature(const Quadrature &quadrature)
Definition registry.hh:96
size_t id() const
obtain the identifier of the integration point list
Definition quadratureimp.hh:122
const CoordinateType & point(size_t i) const
obtain coordinates of i-th integration point
Definition quadratureimp.hh:96
size_t nop() const
obtain the number of integration points
Definition quadratureimp.hh:106