~njansson/dolfin/hpc

« back to all changes in this revision

Viewing changes to dolfin/mesh/MeshFunction.h

  • Committer: Anders Logg
  • Date: 2008-05-21 22:42:48 UTC
  • mfrom: (2668.6.1 trunk)
  • mto: (2668.8.3 trunk)
  • mto: This revision was merged to the branch mainline in revision 2670.
  • Revision ID: logg@simula.no-20080521224248-7baydkw3uy323fur
merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// Copyright (C) 2006-2007 Anders Logg.
 
1
// Copyright (C) 2006-2008 Anders Logg.
2
2
// Licensed under the GNU LGPL Version 2.1.
3
3
//
4
 
// Modified by Johan Hoffman 2007.
 
4
// Modified by Johan Hoffman, 2007.
5
5
//
6
6
// First added:  2006-05-22
7
 
// Last changed: 2007-11-30
 
7
// Last changed: 2008-05-21
8
8
 
9
9
#ifndef __MESH_FUNCTION_H
10
10
#define __MESH_FUNCTION_H
53
53
    /// Destructor
54
54
    ~MeshFunction()
55
55
    {
56
 
      if ( _values )
57
56
      delete [] _values;
58
57
    }
59
58
 
139
138
      _mesh = &mesh;
140
139
      _dim = dim;
141
140
      _size = size;
142
 
      if (_values)
143
 
        delete [] _values;
 
141
      delete [] _values;
144
142
      _values = new T[size];
145
143
      std::fill(_values, _values + size, static_cast<T>(0));
146
144
    }