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

Last change on this file since 23189 was 23189, checked in by Mathieu Morlighem, 6 years ago

merged trunk-jpl and trunk for revision 23187

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