Changeset 1178


Ignore:
Timestamp:
06/30/09 10:35:49 (16 years ago)
Author:
Mathieu Morlighem
Message:

Initialization with default value

Location:
issm/trunk/src/mex
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/mex/InterpFromMesh2d/InterpFromMesh2d.cpp

    r1174 r1178  
    116116        /*Initialize output*/
    117117        data_prime=NewVec(nods_prime);
     118        for (i=0;i<nods_prime;i++) VecSetValue(data_prime,i,default_value,INSERT_VALUES);
    118119
     120        /*Loop over the elements*/
    119121        printf("\n   interpolation progress:   %5.2lf %%",0.0);
    120122        for (i=0;i<nels_data;i++){
     
    146148
    147149                        /*is the current point in the current element?*/
    148                         if ((area_1>0 || area_1==0) && (area_2>0 || area_2==0) && (area_3>0 || area_3==0)){
     150                        if (area_1>=0 && area_2>=0 && area_3>=0){
    149151
    150152                                /*Yes ! compute the value on the point*/
  • issm/trunk/src/mex/InterpFromMesh3d/InterpFromMesh3d.cpp

    r1174 r1178  
    121121        /*Initialize output*/
    122122        data_prime=NewVec(nods_prime);
    123 
     123        for (i=0;i<nods_prime;i++) VecSetValue(data_prime,i,default_value,INSERT_VALUES);
     124
     125        /*Loop over the elements*/
    124126        printf("\n   interpolation progress:   %5.2lf %%",0.0);
    125127        for (i=0;i<nels_data;i++){
     
    151153
    152154                        /*is the current point in the current 2d element?*/
    153                         if ((area_1>0 || area_1==0) && (area_2>0 || area_2==0) && (area_3>0 || area_3==0)){
     155                        if (area_1>=0 && area_2>=0 && area_3>=0){
    154156
    155157                                /*compute bottom and top height of the element at this 2d position*/
Note: See TracChangeset for help on using the changeset viewer.