source: issm/trunk/src/c/modules/ModelProcessorx/EdgesPartitioning.cpp@ 16560

Last change on this file since 16560 was 16560, checked in by Mathieu Morlighem, 11 years ago

merged trunk-jpl and trunk for revision 16554

File size: 1.0 KB
Line 
1/*!\file: EdgesPartitioning.cpp
2 * \brief: partition elements and nodes and vertices
3 */
4
5#include <string.h>
6#include "../../classes/classes.h"
7#include "../../shared/shared.h"
8#include "./ModelProcessorx.h"
9
10void EdgesPartitioning(bool** pmy_edges,IoModel* iomodel){
11
12 /*Intermediaries*/
13 int elementnbe;
14
15 /*Get edges and elements*/
16 CreateEdges(iomodel);
17 _assert_(iomodel->elementtoedgeconnectivity);
18
19 /*Mesh dependent variables*/
20 if(iomodel->meshtype==Mesh2DhorizontalEnum){
21 elementnbe = 3;
22 }
23 else if(iomodel->meshtype==Mesh2DverticalEnum){
24 elementnbe = 3;
25 }
26 else if(iomodel->meshtype==Mesh3DEnum){
27 elementnbe = 9;
28 }
29 else{
30 _error_("mesh dimension not supported yet");
31 }
32 /*output: */
33 bool* my_edges=xNewZeroInit<bool>(iomodel->numberofedges);
34
35 for(int i=0;i<iomodel->numberofelements;i++){
36 if(iomodel->my_elements[i]){
37 for(int j=0;j<elementnbe;j++){
38 my_edges[iomodel->elementtoedgeconnectivity[i*elementnbe+j]] = true;
39 }
40 }
41 }
42
43 /*Free data and assign output pointers */
44 *pmy_edges=my_edges;
45}
Note: See TracBrowser for help on using the repository browser.