~ubuntu-branches/ubuntu/natty/dolfin/natty

« back to all changes in this revision

Viewing changes to dolfin/function/Data.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Johannes Ring
  • Date: 2011-02-24 10:34:44 UTC
  • mfrom: (1.1.7 upstream) (14.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20110224103444-n3fwnmh32lfoske0
Tags: 0.9.10-1
* New upstream release. This release fixes bug "FTBFS: error:
  'SCOTCH_Dgraph' was not declared in this scope" (closes: #612602).
* debian/control:
  - Add libslepc3.1-dev and libboost-thread-dev to Build-Depends and
    Depends field in binary package libdolfin0-dev.
  - Bump build dependency on python-ufc to >= 2.0.0.
  - Remove Build-Depends-Indep field as upstream no longer ships the
    user manual.
  - Remove old fields Conflicts, Provides, and Replaces from
    libdolfin0-dev, libdolfin0, libdolfin0-dbg, and python-dolfin.
* Remove all patches as they are now incorporated upstream.
* Add dolfin-plot and dolfin-version to debian/dolfin-bin.install.
* Remove .doc-base file since the user manual is removed by upstream.
* Remove targets clean and install/dolfin-doc from debian/rules since
  they are no longer needed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// Copyright (C) 2009 Anders Logg.
2
 
// Licensed under the GNU LGPL Version 2.1.
3
 
//
4
 
// First added:  2009-03-11
5
 
// Last changed: 2010-01-26
6
 
 
7
 
#include <dolfin/mesh/Cell.h>
8
 
#include "Data.h"
9
 
 
10
 
using namespace dolfin;
11
 
 
12
 
//-----------------------------------------------------------------------------
13
 
Data::Data()
14
 
  : x(0, 0), _dolfin_cell(0), _ufc_cell(0), _facet(-1)
15
 
{
16
 
  // Do nothing
17
 
}
18
 
//-----------------------------------------------------------------------------
19
 
Data::~Data()
20
 
{
21
 
  // Do nothing
22
 
}
23
 
//-----------------------------------------------------------------------------
24
 
const Cell& Data::cell() const
25
 
{
26
 
  if (!_dolfin_cell)
27
 
    error("Current cell is unknown.");
28
 
 
29
 
  return *_dolfin_cell;
30
 
}
31
 
//-----------------------------------------------------------------------------
32
 
const ufc::cell& Data::ufc_cell() const
33
 
{
34
 
  if (!_ufc_cell)
35
 
    error("Current UFC cell is unknown.");
36
 
 
37
 
  return *_ufc_cell;
38
 
}
39
 
//-----------------------------------------------------------------------------
40
 
dolfin::uint Data::facet() const
41
 
{
42
 
  if (_facet < 0)
43
 
    error("Current facet is unknown.");
44
 
 
45
 
  return static_cast<uint>(_facet);
46
 
}
47
 
//-----------------------------------------------------------------------------
48
 
Point Data::normal() const
49
 
{
50
 
  return cell().normal(facet());
51
 
}
52
 
//-----------------------------------------------------------------------------
53
 
dolfin::uint Data::geometric_dimension() const
54
 
{
55
 
  assert(_dolfin_cell);
56
 
  return _dolfin_cell->mesh().geometry().dim();
57
 
}
58
 
//-----------------------------------------------------------------------------
59
 
bool Data::on_facet() const
60
 
{
61
 
  return _facet >= 0;
62
 
}
63
 
//-----------------------------------------------------------------------------
64
 
void Data::set(const Cell& dolfin_cell,
65
 
               const ufc::cell& ufc_cell,
66
 
               int local_facet)
67
 
{
68
 
  _dolfin_cell = &dolfin_cell;
69
 
  _ufc_cell = &ufc_cell;
70
 
  _facet = local_facet;
71
 
}
72
 
//-----------------------------------------------------------------------------
73
 
void Data::set(const ufc::cell& ufc_cell, const double* x)
74
 
{
75
 
  _ufc_cell = &ufc_cell;
76
 
 
77
 
  // Write comment about const-cast here
78
 
  const_cast<Array<double>*>(&(this->x))->update(ufc_cell.geometric_dimension, const_cast<double*>(x));
79
 
}
80
 
//-----------------------------------------------------------------------------
81
 
void Data::clear()
82
 
{
83
 
  //x.clear();
84
 
  _dolfin_cell = 0;
85
 
  _ufc_cell = 0;
86
 
  _facet = -1;
87
 
}
88
 
//-----------------------------------------------------------------------------