1
// Copyright (C) 2009 Anders Logg.
2
// Licensed under the GNU LGPL Version 2.1.
4
// First added: 2009-03-11
5
// Last changed: 2010-01-26
7
#include <dolfin/mesh/Cell.h>
10
using namespace dolfin;
12
//-----------------------------------------------------------------------------
14
: x(0, 0), _dolfin_cell(0), _ufc_cell(0), _facet(-1)
18
//-----------------------------------------------------------------------------
23
//-----------------------------------------------------------------------------
24
const Cell& Data::cell() const
27
error("Current cell is unknown.");
31
//-----------------------------------------------------------------------------
32
const ufc::cell& Data::ufc_cell() const
35
error("Current UFC cell is unknown.");
39
//-----------------------------------------------------------------------------
40
dolfin::uint Data::facet() const
43
error("Current facet is unknown.");
45
return static_cast<uint>(_facet);
47
//-----------------------------------------------------------------------------
48
Point Data::normal() const
50
return cell().normal(facet());
52
//-----------------------------------------------------------------------------
53
dolfin::uint Data::geometric_dimension() const
56
return _dolfin_cell->mesh().geometry().dim();
58
//-----------------------------------------------------------------------------
59
bool Data::on_facet() const
63
//-----------------------------------------------------------------------------
64
void Data::set(const Cell& dolfin_cell,
65
const ufc::cell& ufc_cell,
68
_dolfin_cell = &dolfin_cell;
69
_ufc_cell = &ufc_cell;
72
//-----------------------------------------------------------------------------
73
void Data::set(const ufc::cell& ufc_cell, const double* x)
75
_ufc_cell = &ufc_cell;
77
// Write comment about const-cast here
78
const_cast<Array<double>*>(&(this->x))->update(ufc_cell.geometric_dimension, const_cast<double*>(x));
80
//-----------------------------------------------------------------------------
88
//-----------------------------------------------------------------------------