@@ -97,6 +97,7 @@ static void loadElementProperties(std::map<int, ElementProperty>& meshElementPro
9797 * \param element The parent element.
9898 * \param nodesTagsEdge Node tags per edge of the element.
9999 * \param determinant1D Determinant associated with the edge of the element.
100+ * \param nNodesElement Number of nodes of the parent element.
100101 */
101102static void addEdge (Element2D& element, std::vector<int > nodesTagsEdge,
102103 std::vector<double > determinant1D, unsigned int nNodesElement)
@@ -122,10 +123,9 @@ static void addEdge(Element2D& element, std::vector<int> nodesTagsEdge,
122123
123124
124125/* *
125- * \brief Compute the outward normal of an edge
126- * \param element the parent element
127- * \param nodesTagsEdge Node tags per edge of the element
128- * \param baryCenter Barycenter of the parent element
126+ * \brief Compute the outward normal of an edge.
127+ * \param edge The edge of which the normal is computed.
128+ * \param baryCenter Barycenter of the parent element.
129129 */
130130static void computeEdgeNormalCoord (Edge& edge,
131131 const std::vector<double >& baryCenter)
@@ -170,10 +170,10 @@ static void computeEdgeNormalCoord(Edge& edge,
170170}
171171
172172/* *
173- * \brief Compute the outward normal of an edge
173+ * \brief Find the second position of the edge in the entity.
174174 * \param entity The parent entity.
175175 * \param currentEdge The edge of which you want to find the neighbor.
176- * \param edgePos Index of the edge in his element.
176+ * \param edgePos Index of the edge in its element.
177177 */
178178static void findInFrontEdge (Entity2D& entity, Edge& currentEdge, unsigned int edgePos)
179179{
@@ -213,6 +213,11 @@ static void findInFrontEdge(Entity2D& entity, Edge& currentEdge, unsigned int ed
213213 }
214214}
215215
216+ /* *
217+ * \brief Check if an edge lies on a boundary (and which one)
218+ * \param nodesTagBoundaries Map which stores the tags of the nodes belonging to a certain boundary.
219+ * \param edge The edge which we check if it is a boundary.
220+ */
216221static bool IsBounbdary (const std::map<std::string, std::vector<int >>& nodesTagBoundaries, Edge& edge)
217222{
218223 for (std::pair<std::string, std::vector<int >> nodeTagBoundary : nodesTagBoundaries)
@@ -247,8 +252,9 @@ static bool IsBounbdary(const std::map<std::string, std::vector<int>>& nodesTagB
247252 * \param nGP1D Number of Gauss point for integration.
248253 * \param offsetInU Offset of the element in the u unknown vector.
249254 * \param nodesTagsPerEdge Node tags of the element, per edge.
250- * \param intScheme Integration scheme for the basis functions evaluation.
251- * \param basisFuncType The type of basis function you will use.
255+ * \param elementBarycenter Element barycenter coordinate.
256+ * \param nodesTagBoundaries Map which stores the tags of the nodes belonging to a certain boundary.
257+ * \param element2DProperty Structure containing informations about a certain element type.
252258 */
253259static void addElement (Entity2D& entity, int elementTag, int eleType2D,
254260 int eleType1D, std::vector<double > jacobians2D,
@@ -257,9 +263,8 @@ static void addElement(Entity2D& entity, int elementTag, int eleType2D,
257263 unsigned int nGP1D, unsigned int offsetInU,
258264 const std::vector<int >& nodesTagsPerEdge,
259265 const std::vector<double >& elementBarycenter,
260- const std::string& intScheme,
261- const std::string& basisFuncType,
262- const std::map<std::string, std::vector<int >>& nodesTagBoundary)
266+ const std::map<std::string, std::vector<int >>& nodesTagBoundaries,
267+ const ElementProperty& element2DProperty)
263268{
264269 Element2D element;
265270 element.elementTag = elementTag;
@@ -270,7 +275,6 @@ static void addElement(Entity2D& entity, int elementTag, int eleType2D,
270275
271276 element.determinant2D = std::move (determinants2D);
272277 element.jacobian2D = std::move (jacobians2D);
273- unsigned int nNodesElement = nodesTagsPerEdge.size ()/2 ; // Use elementProp map ?
274278
275279 for (unsigned int i = 0 ; i < nodesTagsPerEdge.size ()/2 ; ++i)
276280 {
@@ -279,16 +283,16 @@ static void addElement(Entity2D& entity, int elementTag, int eleType2D,
279283
280284 std::vector<double > determinantsEdge1D (determinants1D.begin () + nGP1D*i, determinants1D.begin () + nGP1D*(i + 1 ));
281285
282- addEdge (element, std::move (nodesTagsEdge), std::move (determinantsEdge1D), nNodesElement );
286+ addEdge (element, std::move (nodesTagsEdge), std::move (determinantsEdge1D), element2DProperty. numNodes );
283287 if (entity.elements .size () != 0 )
284288 {
285- if (!IsBounbdary (nodesTagBoundary , element.edges [i]))
289+ if (!IsBounbdary (nodesTagBoundaries , element.edges [i]))
286290 findInFrontEdge (entity, element.edges [i], i);
287291
288292 }
289293 else
290294 {
291- IsBounbdary (nodesTagBoundary , element.edges [i]);
295+ IsBounbdary (nodesTagBoundaries , element.edges [i]);
292296 }
293297
294298 computeEdgeNormalCoord (element.edges [i], elementBarycenter);
@@ -396,8 +400,9 @@ static void addEntity(Mesh2D& mesh, const std::pair<int, int>& entityHandle, uns
396400 std::move (determinantElement1D),
397401 nGP1D, currentOffset,
398402 nodesTagPerEdgeElement,
399- elementBarycenter, intScheme, basisFuncType,
400- mesh.nodesTagBoundary );
403+ elementBarycenter,
404+ mesh.nodesTagBoundary ,
405+ mesh.elementProperties2D [eleType2D]);
401406
402407 currentOffset += nodesTagPerEdgeElement.size ()/2 ;
403408 }
0 commit comments