Changeset 12366


Ignore:
Timestamp:
06/05/12 09:11:56 (13 years ago)
Author:
utke
Message:

type rename

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/objects/Patch.cpp

    r12365 r12366  
    5252        }
    5353        else{
    54                 this->values=(double*)xmalloc(this->numcols*this->numrows*sizeof(double));
     54                this->values=xNew<IssmDouble>(this->numcols*this->numrows);
    5555                for(i=0;i<this->numrows;i++){
    5656                        for(j=0;j<this->numcols;j++){
     
    6464/*FUNCTION Patch::~Patch(){{{*/
    6565Patch::~Patch(){
    66         xfree((void**)&values);
     66        xDelete<IssmDouble>(values);
    6767}
    6868/*}}}*/
     
    7373
    7474        int i;
    75         double* row=NULL;
     75        IssmDouble* row=NULL;
    7676
    7777        /*point to the start of the row: */
     
    8989/*}}}*/
    9090/*FUNCTION Patch::fillresultinfo{{{*/
    91 void Patch::fillresultinfo(int count,int enum_type,int step, double time, int interpolation, double* nodal_values, int num_nodes){
     91void Patch::fillresultinfo(int count,int enum_type,int step, IssmDouble time, int interpolation, IssmDouble* nodal_values, int num_nodes){
    9292
    9393        int i;
    94         double* row=NULL;
     94        IssmDouble* row=NULL;
    9595
    9696        /*point to the start of the row: */
     
    101101         */
    102102        row[0]=enum_type;
    103         row[1]=(double)step;
     103        row[1]=(IssmDouble)step;
    104104        row[2]=time;
    105105        row[4]=interpolation;
     
    119119        int         total_numrows;
    120120        int         node_numrows;
    121         double     *total_values  = NULL;
     121        IssmDouble     *total_values  = NULL;
    122122        #ifdef _HAVE_MPI_
    123123        MPI_Status  status;
     
    136136
    137137        /*Now, allocate buffer to holds all the values, on node 0: */
    138         if(my_rank==0)total_values=(double*)xmalloc(this->numcols*total_numrows*sizeof(double));
     138        if(my_rank==0)total_values=xNew<IssmDouble>(this->numcols*total_numrows);
    139139
    140140        /*Start by copying node 0 values onto total_values: */
    141141        if(my_rank==0){
    142142                count=0;
    143                 memcpy(total_values+count,this->values,this->numcols*this->numrows*sizeof(double));
     143                xMemCpy<IssmDouble>(total_values+count,this->values,this->numcols*this->numrows);
    144144                count+=this->numrows*this->numcols;
    145145        }
     
    164164        if(my_rank==0){
    165165                this->numrows=total_numrows;
    166                 xfree((void**)&this->values);
     166                xDelete<IssmDouble>(this->values);
    167167                this->values=total_values;
    168168        }
     
    170170        else{
    171171                this->numrows=0;
    172                 xfree((void**)&this->values);
     172                xDelete<IssmDouble>(this->values);
    173173        }
    174174        #endif
Note: See TracChangeset for help on using the changeset viewer.