source: issm/trunk/src/c/modules/ModelProcessorx/FacesPartitioning.cpp@ 17806

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

merged trunk-jpl and trunk for revision 17804

File size: 1.2 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
10void FacesPartitioning(bool** pmy_faces,IoModel* iomodel){
11
12 /*Intermediaries*/
13 int elementnbf;
14
15 /*Get faces and elements*/
16 CreateFaces(iomodel);
17 _assert_(iomodel->elementtofaceconnectivity);
18
19 /*Mesh dependent variables*/
20 if(iomodel->domaintype==Domain2DhorizontalEnum){
21 elementnbf = 3;
22 }
23 else if(iomodel->domaintype==Domain2DverticalEnum){
24 elementnbf = 3;
25 }
26 else if(iomodel->domaintype==Domain3DEnum){
27 elementnbf = 5;
28 }
29 else{
30 _error_("mesh dimension not supported yet");
31 }
32 /*output: */
33 bool* my_faces=xNewZeroInit<bool>(iomodel->numberoffaces);
34
35 for(int i=0;i<iomodel->numberofelements;i++){
36 if(iomodel->my_elements[i]){
37 for(int j=0;j<elementnbf;j++){
38 _assert_(iomodel->elementtofaceconnectivity[i*elementnbf+j] >= 0);
39 _assert_(iomodel->elementtofaceconnectivity[i*elementnbf+j] < iomodel->numberoffaces);
40 my_faces[iomodel->elementtofaceconnectivity[i*elementnbf+j]] = true;
41 }
42 }
43 }
44
45 /*Free data and assign output pointers */
46 *pmy_faces=my_faces;
47}
Note: See TracBrowser for help on using the repository browser.