Last change
on this file since 12706 was 12706, checked in by Mathieu Morlighem, 13 years ago |
merged trunk-jpl and trunk for revision 12703
|
File size:
1.6 KB
|
Rev | Line | |
---|
[1] | 1 | /*! \file ContourToMeshx.c
|
---|
| 2 | */
|
---|
| 3 |
|
---|
[2591] | 4 | #ifdef HAVE_CONFIG_H
|
---|
[9320] | 5 | #include <config.h>
|
---|
[2591] | 6 | #else
|
---|
| 7 | #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
|
---|
| 8 | #endif
|
---|
| 9 |
|
---|
| 10 |
|
---|
[1] | 11 | #include "./ContourToMeshx.h"
|
---|
| 12 |
|
---|
[12330] | 13 | int ContourToMeshx( Vector** pin_nod,Vector** pin_elem, double* index, double* x, double* y,DataSet* contours,char* interptype,int nel,int nods, int edgevalue) {
|
---|
[1] | 14 |
|
---|
| 15 | int noerr=1;
|
---|
| 16 | int i;
|
---|
| 17 | int m,n;
|
---|
| 18 |
|
---|
| 19 | /*Contour:*/
|
---|
| 20 | double* in_nod_serial;
|
---|
| 21 | double value;
|
---|
| 22 |
|
---|
[2591] | 23 | /*threading: */
|
---|
| 24 | ContourToMeshxThreadStruct gate;
|
---|
| 25 | int num=1;
|
---|
| 26 | #ifdef _MULTITHREADING_
|
---|
| 27 | num=_NUMTHREADS_;
|
---|
| 28 | #endif
|
---|
| 29 |
|
---|
| 30 |
|
---|
[1] | 31 | /*output: */
|
---|
[11995] | 32 | Vector* in_nod=NULL;
|
---|
| 33 | Vector* in_elem=NULL;
|
---|
[1] | 34 |
|
---|
[11995] | 35 | in_nod=new Vector(nods);
|
---|
| 36 | in_elem=new Vector(nel);
|
---|
[1] | 37 |
|
---|
[2591] | 38 | /*initialize thread parameters: */
|
---|
| 39 | gate.contours=contours;
|
---|
| 40 | gate.nods=nods;
|
---|
| 41 | gate.edgevalue=edgevalue;
|
---|
| 42 | gate.in_nod=in_nod;
|
---|
| 43 | gate.x=x;
|
---|
| 44 | gate.y=y;
|
---|
[1] | 45 |
|
---|
[2591] | 46 | /*launch the thread manager with ContourToMeshxt as a core: */
|
---|
| 47 | LaunchThread(ContourToMeshxt,(void*)&gate,num);
|
---|
| 48 |
|
---|
| 49 | /*Assemble in_nod: */
|
---|
[11995] | 50 | in_nod->Assemble();
|
---|
[2591] | 51 |
|
---|
[1] | 52 | /*Get in_nod serialised for next operation: */
|
---|
[11995] | 53 | in_nod_serial=in_nod->ToMPISerial();
|
---|
[1] | 54 |
|
---|
| 55 | /*Take care of the case where an element interpolation has been requested: */
|
---|
| 56 | if ((strcmp(interptype,"element")==0) || (strcmp(interptype,"element and node")==0)){
|
---|
| 57 | for (n=0;n<nel;n++){
|
---|
| 58 | if ( (in_nod_serial[ (int)*(index+3*n+0) -1] == 1) && (in_nod_serial[ (int)*(index+3*n+1) -1] == 1) && (in_nod_serial[ (int)*(index+3*n+2) -1] == 1) ){
|
---|
[11995] | 59 | value=1; in_elem->SetValue(n,value,INS_VAL);
|
---|
[1] | 60 | }
|
---|
| 61 | }
|
---|
| 62 | }
|
---|
| 63 |
|
---|
| 64 | /*Assemble vectors: */
|
---|
[11995] | 65 | in_elem->Assemble();
|
---|
[1] | 66 |
|
---|
| 67 | /*Assign output pointers: */
|
---|
| 68 | *pin_nod=in_nod;
|
---|
| 69 | *pin_elem=in_elem;
|
---|
| 70 |
|
---|
| 71 | /*Free ressources:*/
|
---|
[12706] | 72 | xDelete<double>(in_nod_serial);
|
---|
[1] | 73 |
|
---|
| 74 | return noerr;
|
---|
| 75 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.