Go to the documentation of this file.
55 label nThreads = 3 * omp_get_num_procs();
56 if( pFacets.
size() < 1000 )
59 const label nThreads(1);
67 # pragma omp parallel num_threads(nThreads)
73 # pragma omp for schedule(static)
77 std::set<std::pair<label, label> > edgesAtPoint;
81 const label triI = pFacets(pI, pfI);
88 if( tri[(i+1)%3] >= pI )
91 std::make_pair(pI, tri[(i+1)%3])
93 if( tri[(i+2)%3] >= pI )
96 std::make_pair(pI, tri[(i+2)%3])
102 std::set<std::pair<label, label> >::const_iterator it;
103 for(it=edgesAtPoint.begin();it!=edgesAtPoint.end();++it)
104 edgesHelper.
append(
edge(it->first, it->second));
110 const label threadI = omp_get_thread_num();
112 const label threadI(0);
114 nEdgesForThread[threadI] = edgesHelper.
size();
117 # pragma omp critical
119 edgeI += edgesHelper.
size();
135 for(
label i=0;i<threadI;++i)
136 localStart += nEdgesForThread[i];
153 # pragma omp parallel for schedule(dynamic, 100)
162 const label fI = pointFaces(pI, pfI);
167 const edge e(tri[eI], tri[(eI+1)%3]);
171 faceEdges(fI, eI) = edgeI;
177 # ifdef DEBUGTriSurfAddressing
185 "void triSurfAddressing::calculateFacetEdges() const"
186 ) <<
"Invalid entry in triangle " << triI
189 const label edgeI = faceEdges(triI, feI);
194 "void triSurfAddressing::calculateFacetEdges() const"
195 ) <<
"Invalid entry in face " << triI <<
" "
231 forAll(facetEdges, facetI)
260 # pragma omp parallel for if( size > 1000 )
262 for(
label pI=0;pI<size;++pI)
267 normal += fNormals[pFacets(pI, pfI)];
279 (*pointNormalsPtr_)[pI] =
normal;
288 # pragma omp parallel for schedule(dynamic, 40)
293 v /= (
mag(v) + VSMALL);
294 (*facetNormalsPtr_)[fI] = v;
303 # pragma omp parallel for schedule(dynamic, 40)
318 pointFacetsPtr_(NULL),
320 facetEdgesPtr_(NULL),
321 edgeFacetsPtr_(NULL),
322 pointEdgesPtr_(NULL),
323 facetFacetsEdgesPtr_(NULL),
324 pointNormalsPtr_(NULL),
325 facetNormalsPtr_(NULL),
326 facetCentresPtr_(NULL)
const pointField & points_
const reference to the points
void append(const T &e)
Append an element at the end of the list.
const vectorField & facetNormals() const
return normals of facets
vectorField * pointNormalsPtr_
point normals
#define forAll(list, i)
Loop across all elements in list.
friend Ostream & operator(Ostream &, const LongList< T, Offset > &)
Template functions to aid in the implementation of demand driven data.
void calculateFacetFacetsEdges() const
calculate facet-faceys addressing
edgeLongList * edgesPtr_
edges in the triangulation
VRWGraph * edgeFacetsPtr_
labels of triangles connected to an edge
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
void calculatePointEdges() const
calculate point-edges addressing
label size() const
Size of the active part of the list.
dimensioned< scalar > mag(const dimensioned< Type > &)
vectorField * facetCentresPtr_
face centres
const LongList< labelledTri > & facets_
const reference to the facets
void calculateFacetCentres() const
calculate centres of facets
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
Field< vector > vectorField
Specialisation of Field<T> for vector.
void setSize(const label)
Reset size of List.
void deleteDemandDrivenData(DataPtr &dataPtr)
void clearAddressing()
delete all data
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
triSurfAddressing(const triSurfAddressing &)
Pre-declare SubField and related Field type.
VRWGraph * pointFacetsPtr_
facets connected to a point
label size() const
Returns the number of rows.
void clearGeometry()
delete geometry data
void setSize(const label)
Reset the number of rows.
#define forAllRow(graph, rowI, index)
const VRWGraph & pointFacets() const
return point-facets addressing
VRWGraph * facetEdgesPtr_
labels of edges in the triangles
label size() const
Return number of elements in table.
VRWGraph * facetFacetsEdgesPtr_
facets connected tp a facet via edges
errorManip< error > abort(error &err)
const double e
Elementary charge.
void reverseAddressing(const GraphType &origGraph)
void calculateEdges() const
calculate edges, facet-edges and edge-facets addressing
void calculateFacetEdges() const
calculate facet-edges addresing
label start() const
Return start vertex label.
void reverseAddressing(const label nRows, const GraphType &origGraph)
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void calculateEdgeFacets() const
calculate edge-facets addressing
const VRWGraph & facetEdges() const
return facet-edges addressing
bool insert(const Key &key)
Insert a new entry.
const LongList< edge > & edges() const
return edges
Triangle with additional region number.
vectorField * facetNormalsPtr_
face normals
void calculateFacetNormals() const
calculate normals of facets
void calculatePointFacets() const
calculate point-facets addressing
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
LongList< edge > edgeLongList
void setRowSize(const label rowI, const label newSize)
Reset the size of the given row.
const VRWGraph & edgeFacets() const
return edge-facets addressing
void calculatePointNormals() const
calculate point normals
A normal distribution model.
VRWGraph * pointEdgesPtr_
labels of edges connected to a point