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: FacesPartitioning.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 |
|
---|
10 | void FacesPartitioning(bool** pmy_faces,IoModel* iomodel){
|
---|
11 |
|
---|
12 | /*Intermediaries*/
|
---|
13 | int el1,el2;
|
---|
14 | bool my_face;
|
---|
15 |
|
---|
16 | /*Check Iomodel properties*/
|
---|
17 | if(iomodel->meshtype!=Mesh2DhorizontalEnum) _error_("only 2d model are supported");
|
---|
18 |
|
---|
19 | /*Get faces and elements*/
|
---|
20 | CreateFaces(iomodel);
|
---|
21 |
|
---|
22 | /*output: */
|
---|
23 | bool* my_faces=xNew<bool>(iomodel->numberoffaces);
|
---|
24 |
|
---|
25 | for(int i=0;i<iomodel->numberoffaces;i++){
|
---|
26 |
|
---|
27 | /*Get left and right elements*/
|
---|
28 | el1=iomodel->faces[4*i+2]-1; //faces are [node1 node2 elem1 elem2]
|
---|
29 | el2=iomodel->faces[4*i+3]-1; //faces are [node1 node2 elem1 elem2]
|
---|
30 |
|
---|
31 | /*Check whether we should include this face (el2 is -2 for boundary faces)*/
|
---|
32 | my_face = iomodel->my_elements[el1];
|
---|
33 | if(!my_face && el2>=0){
|
---|
34 | my_face = iomodel->my_elements[el2];
|
---|
35 | }
|
---|
36 |
|
---|
37 | my_faces[i] = my_face;
|
---|
38 | }
|
---|
39 |
|
---|
40 | /*Free data and assign output pointers */
|
---|
41 | *pmy_faces=my_faces;
|
---|
42 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.