/[escript]/trunk/escript/src/Data.cpp
ViewVC logotype

Diff of /trunk/escript/src/Data.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1092 by gross, Fri Apr 13 03:39:49 2007 UTC revision 1137 by gross, Thu May 10 08:11:31 2007 UTC
# Line 19  Line 19 
19  #include "DataEmpty.h"  #include "DataEmpty.h"
20  #include "DataArray.h"  #include "DataArray.h"
21  #include "DataArrayView.h"  #include "DataArrayView.h"
 #include "DataProf.h"  
22  #include "FunctionSpaceFactory.h"  #include "FunctionSpaceFactory.h"
23  #include "AbstractContinuousDomain.h"  #include "AbstractContinuousDomain.h"
24  #include "UnaryFuncs.h"  #include "UnaryFuncs.h"
# Line 214  Data::getShapeTuple() const Line 213  Data::getShapeTuple() const
213    }    }
214  }  }
215    
216    const
217    boost::python::str
218    Data::str() const
219    {
220      return boost::python::str(toString().c_str());
221    }
222    
223  void  void
224  Data::copy(const Data& other)  Data::copy(const Data& other)
225  {  {
# Line 266  Data::copy(const Data& other) Line 272  Data::copy(const Data& other)
272    throw DataException("Error - Copy not implemented for this Data type.");    throw DataException("Error - Copy not implemented for this Data type.");
273  }  }
274    
275    
276    void
277    Data::setToZero()
278    {
279      {
280        DataExpanded* temp=dynamic_cast<DataExpanded*>(m_data.get());
281        if (temp!=0) {
282           temp->setToZero();
283           return;
284        }
285      }
286      {
287        DataTagged* temp=dynamic_cast<DataTagged*>(m_data.get());
288        if (temp!=0) {
289          temp->setToZero();
290          return;
291        }
292      }
293      {
294        DataConstant* temp=dynamic_cast<DataConstant*>(m_data.get());
295        if (temp!=0) {
296          temp->setToZero();
297          return;
298        }
299      }
300      throw DataException("Error - Data can not be set to zero.");
301    }
302    
303  void  void
304  Data::copyWithMask(const Data& other,  Data::copyWithMask(const Data& other,
305                     const Data& mask)                     const Data& mask)
# Line 987  Data::Lsup() const Line 1021  Data::Lsup() const
1021    localValue = algorithm(abs_max_func,0);    localValue = algorithm(abs_max_func,0);
1022  #ifdef PASO_MPI  #ifdef PASO_MPI
1023    MPI_Allreduce( &localValue, &globalValue, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD );    MPI_Allreduce( &localValue, &globalValue, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD );
1024    return globalValue;   return globalValue;
1025  #else  #else
1026    return localValue;    return localValue;
1027  #endif  #endif

Legend:
Removed from v.1092  
changed lines
  Added in v.1137

  ViewVC Help
Powered by ViewVC 1.1.26