Last change
on this file was 16560, checked in by Mathieu Morlighem, 11 years ago |
merged trunk-jpl and trunk for revision 16554
|
File size:
1.3 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 |
|
---|
[1] | 10 | #include "./ContourToMeshx.h"
|
---|
| 11 |
|
---|
[15396] | 12 | int ContourToMeshx(double** pin_nod,double** pin_elem, double* index, double* x, double* y,Contours* contours,char* interptype,int nel,int nods, int edgevalue) {
|
---|
[1] | 13 |
|
---|
| 14 | /*Contour:*/
|
---|
[16560] | 15 | double value;
|
---|
[1] | 16 |
|
---|
| 17 | /*output: */
|
---|
[15396] | 18 | double* in_nod;
|
---|
| 19 | double* in_elem;
|
---|
| 20 | in_nod = xNewZeroInit<double>(nods);
|
---|
| 21 | in_elem = xNewZeroInit<double>(nel);
|
---|
[1] | 22 |
|
---|
[2591] | 23 | /*initialize thread parameters: */
|
---|
[16560] | 24 | ContourToMeshxThreadStruct gate;
|
---|
| 25 | gate.contours = contours;
|
---|
| 26 | gate.nods = nods;
|
---|
| 27 | gate.edgevalue = edgevalue;
|
---|
| 28 | gate.in_nod = in_nod;
|
---|
| 29 | gate.x = x;
|
---|
| 30 | gate.y = y;
|
---|
[1] | 31 |
|
---|
[2591] | 32 | /*launch the thread manager with ContourToMeshxt as a core: */
|
---|
[16560] | 33 | LaunchThread(ContourToMeshxt,(void*)&gate,_NUMTHREADS_);
|
---|
[2591] | 34 |
|
---|
[1] | 35 | /*Take care of the case where an element interpolation has been requested: */
|
---|
| 36 | if ((strcmp(interptype,"element")==0) || (strcmp(interptype,"element and node")==0)){
|
---|
[13975] | 37 | for(int n=0;n<nel;n++){
|
---|
[15396] | 38 | if ( (in_nod[ (int)*(index+3*n+0) -1] == 1) && (in_nod[ (int)*(index+3*n+1) -1] == 1) && (in_nod[ (int)*(index+3*n+2) -1] == 1) ){
|
---|
[16560] | 39 | value=1.; in_elem[n]=value;
|
---|
[1] | 40 | }
|
---|
| 41 | }
|
---|
| 42 | }
|
---|
| 43 |
|
---|
| 44 | /*Assign output pointers: */
|
---|
| 45 | *pin_nod=in_nod;
|
---|
| 46 | *pin_elem=in_elem;
|
---|
| 47 |
|
---|
[13975] | 48 | return 1;
|
---|
[1] | 49 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.