/usr/include/ufc.h is in ufc 2.0.5-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 | // This is UFC (Unified Form-assembly Code) v. 2.0.5.
// This code is released into the public domain.
//
// The FEniCS Project (http://www.fenicsproject.org/) 2006-2011.
#ifndef __UFC_H
#define __UFC_H
#define UFC_VERSION_MAJOR 2
#define UFC_VERSION_MINOR 0
#define UFC_VERSION_MAINTENANCE 5
#include <stdexcept>
const char UFC_VERSION[] = "2.0.5";
namespace ufc
{
/// Valid cell shapes
enum shape {interval, triangle, quadrilateral, tetrahedron, hexahedron};
/// This class defines the data structure for a finite element mesh.
class mesh
{
public:
/// Constructor
mesh(): topological_dimension(0), geometric_dimension(0), num_entities(0) {}
/// Destructor
virtual ~mesh() {}
/// Topological dimension of the mesh
unsigned int topological_dimension;
/// Geometric dimension of the mesh
unsigned int geometric_dimension;
/// Array of the global number of entities of each topological dimension
unsigned int* num_entities;
};
/// This class defines the data structure for a cell in a mesh.
class cell
{
public:
/// Constructor
cell(): cell_shape(interval),
topological_dimension(0), geometric_dimension(0),
entity_indices(0), coordinates(0), index(0), local_facet(-1),
mesh_identifier(-1) {}
/// Destructor
virtual ~cell() {}
/// Shape of the cell
shape cell_shape;
/// Topological dimension of the mesh
unsigned int topological_dimension;
/// Geometric dimension of the mesh
unsigned int geometric_dimension;
/// Array of global indices for the mesh entities of the cell
unsigned int** entity_indices;
/// Array of coordinates for the vertices of the cell
double** coordinates;
/// Cell index (short-cut for entity_indices[topological_dimension][0])
unsigned int index;
/// Local facet index
int local_facet;
/// Unique mesh identifier
int mesh_identifier;
};
/// This class defines the interface for a general tensor-valued function.
class function
{
public:
/// Constructor
function() {}
/// Destructor
virtual ~function() {}
/// Evaluate function at given point in cell
virtual void evaluate(double* values,
const double* coordinates,
const cell& c) const = 0;
};
/// This class defines the interface for a finite element.
class finite_element
{
public:
/// Constructor
finite_element() {}
/// Destructor
virtual ~finite_element() {}
/// Return a string identifying the finite element
virtual const char* signature() const = 0;
/// Return the cell shape
virtual shape cell_shape() const = 0;
/// Return the topological dimension of the cell shape
virtual unsigned int topological_dimension() const = 0;
/// Return the geometric dimension of the cell shape
virtual unsigned int geometric_dimension() const = 0;
/// Return the dimension of the finite element function space
virtual unsigned int space_dimension() const = 0;
/// Return the rank of the value space
virtual unsigned int value_rank() const = 0;
/// Return the dimension of the value space for axis i
virtual unsigned int value_dimension(unsigned int i) const = 0;
/// Evaluate basis function i at given point in cell
virtual void evaluate_basis(unsigned int i,
double* values,
const double* coordinates,
const cell& c) const = 0;
/// Evaluate all basis functions at given point in cell
virtual void evaluate_basis_all(double* values,
const double* coordinates,
const cell& c) const = 0;
/// Evaluate order n derivatives of basis function i at given point in cell
virtual void evaluate_basis_derivatives(unsigned int i,
unsigned int n,
double* values,
const double* coordinates,
const cell& c) const = 0;
/// Evaluate order n derivatives of all basis functions at given point in cell
virtual void evaluate_basis_derivatives_all(unsigned int n,
double* values,
const double* coordinates,
const cell& c) const = 0;
/// Evaluate linear functional for dof i on the function f
virtual double evaluate_dof(unsigned int i,
const function& f,
const cell& c) const = 0;
/// Evaluate linear functionals for all dofs on the function f
virtual void evaluate_dofs(double* values,
const function& f,
const cell& c) const = 0;
/// Interpolate vertex values from dof values
virtual void interpolate_vertex_values(double* vertex_values,
const double* dof_values,
const cell& c) const = 0;
/// Map coordinate xhat from reference cell to coordinate x in cell
virtual void map_from_reference_cell(double* x,
const double* xhat,
const cell& c) const = 0;
/// Map from coordinate x in cell to coordinate xhat in reference cell
virtual void map_to_reference_cell(double* xhat,
const double* x,
const cell& c) const = 0;
/// Return the number of sub elements (for a mixed element)
virtual unsigned int num_sub_elements() const = 0;
/// Create a new finite element for sub element i (for a mixed element)
virtual finite_element* create_sub_element(unsigned int i) const = 0;
/// Create a new class instance
virtual finite_element* create() const = 0;
};
/// This class defines the interface for a local-to-global mapping of
/// degrees of freedom (dofs).
class dofmap
{
public:
/// Constructor
dofmap() {}
/// Destructor
virtual ~dofmap() {}
/// Return a string identifying the dofmap
virtual const char* signature() const = 0;
/// Return true iff mesh entities of topological dimension d are needed
virtual bool needs_mesh_entities(unsigned int d) const = 0;
/// Initialize dofmap for mesh (return true iff init_cell() is needed)
virtual bool init_mesh(const mesh& mesh) = 0;
/// Initialize dofmap for given cell
virtual void init_cell(const mesh& m,
const cell& c) = 0;
/// Finish initialization of dofmap for cells
virtual void init_cell_finalize() = 0;
/// Return the topological dimension of the associated cell shape
virtual unsigned int topological_dimension() const = 0;
/// Return the geometric dimension of the associated cell shape
virtual unsigned int geometric_dimension() const = 0;
/// Return the dimension of the global finite element function space
virtual unsigned int global_dimension() const = 0;
/// Return the dimension of the local finite element function space for a cell
virtual unsigned int local_dimension(const cell& c) const = 0;
/// Return the maximum dimension of the local finite element function space
virtual unsigned int max_local_dimension() const = 0;
/// Return the number of dofs on each cell facet
virtual unsigned int num_facet_dofs() const = 0;
/// Return the number of dofs associated with each cell entity of dimension d
virtual unsigned int num_entity_dofs(unsigned int d) const = 0;
/// Tabulate the local-to-global mapping of dofs on a cell
virtual void tabulate_dofs(unsigned int* dofs,
const mesh& m,
const cell& c) const = 0;
/// Tabulate the local-to-local mapping from facet dofs to cell dofs
virtual void tabulate_facet_dofs(unsigned int* dofs,
unsigned int facet) const = 0;
/// Tabulate the local-to-local mapping of dofs on entity (d, i)
virtual void tabulate_entity_dofs(unsigned int* dofs,
unsigned int d, unsigned int i) const = 0;
/// Tabulate the coordinates of all dofs on a cell
virtual void tabulate_coordinates(double** coordinates,
const cell& c) const = 0;
/// Return the number of sub dofmaps (for a mixed element)
virtual unsigned int num_sub_dofmaps() const = 0;
/// Create a new dofmap for sub dofmap i (for a mixed element)
virtual dofmap* create_sub_dofmap(unsigned int i) const = 0;
/// Create a new class instance
virtual dofmap* create() const = 0;
};
/// This class defines the interface for the tabulation of the cell
/// tensor corresponding to the local contribution to a form from
/// the integral over a cell.
class cell_integral
{
public:
/// Constructor
cell_integral() {}
/// Destructor
virtual ~cell_integral() {}
/// Tabulate the tensor for the contribution from a local cell
virtual void tabulate_tensor(double* A,
const double * const * w,
const cell& c) const = 0;
/// Tabulate the tensor for the contribution from a local cell
/// using the specified reference cell quadrature points/weights
virtual void tabulate_tensor(double* A,
const double * const * w,
const cell& c,
unsigned int num_quadrature_points,
const double * const * quadrature_points,
const double* quadrature_weights) const = 0;
};
/// This class defines the interface for the tabulation of the
/// exterior facet tensor corresponding to the local contribution to
/// a form from the integral over an exterior facet.
class exterior_facet_integral
{
public:
/// Constructor
exterior_facet_integral() {}
/// Destructor
virtual ~exterior_facet_integral() {}
/// Tabulate the tensor for the contribution from a local exterior facet
virtual void tabulate_tensor(double* A,
const double * const * w,
const cell& c,
unsigned int facet) const = 0;
/// Tabulate the tensor for the contribution from a local exterior facet
/// using the specified reference cell quadrature points/weights
virtual void tabulate_tensor(double* A,
const double * const * w,
const cell& c,
unsigned int num_quadrature_points,
const double * const * quadrature_points,
const double* quadrature_weights) const = 0;
};
/// This class defines the interface for the tabulation of the
/// interior facet tensor corresponding to the local contribution to
/// a form from the integral over an interior facet.
class interior_facet_integral
{
public:
/// Constructor
interior_facet_integral() {}
/// Destructor
virtual ~interior_facet_integral() {}
/// Tabulate the tensor for the contribution from a local interior facet
virtual void tabulate_tensor(double* A,
const double * const * w,
const cell& c0,
const cell& c1,
unsigned int facet0,
unsigned int facet1) const = 0;
/// Tabulate the tensor for the contribution from a local interior facet
/// using the specified reference cell quadrature points/weights
virtual void tabulate_tensor(double* A,
const double * const * w,
const cell& c,
unsigned int num_quadrature_points,
const double * const * quadrature_points,
const double* quadrature_weights) const = 0;
};
/// This class defines the interface for the assembly of the global
/// tensor corresponding to a form with r + n arguments, that is, a
/// mapping
///
/// a : V1 x V2 x ... Vr x W1 x W2 x ... x Wn -> R
///
/// with arguments v1, v2, ..., vr, w1, w2, ..., wn. The rank r
/// global tensor A is defined by
///
/// A = a(V1, V2, ..., Vr, w1, w2, ..., wn),
///
/// where each argument Vj represents the application to the
/// sequence of basis functions of Vj and w1, w2, ..., wn are given
/// fixed functions (coefficients).
class form
{
public:
/// Constructor
form() {}
/// Destructor
virtual ~form() {}
/// Return a string identifying the form
virtual const char* signature() const = 0;
/// Return the rank of the global tensor (r)
virtual unsigned int rank() const = 0;
/// Return the number of coefficients (n)
virtual unsigned int num_coefficients() const = 0;
/// Return the number of cell domains
virtual unsigned int num_cell_domains() const = 0;
/// Return the number of exterior facet domains
virtual unsigned int num_exterior_facet_domains() const = 0;
/// Return the number of interior facet domains
virtual unsigned int num_interior_facet_domains() const = 0;
/// Create a new finite element for argument function i
virtual finite_element* create_finite_element(unsigned int i) const = 0;
/// Create a new dofmap for argument function i
virtual dofmap* create_dofmap(unsigned int i) const = 0;
/// Create a new cell integral on sub domain i
virtual cell_integral* create_cell_integral(unsigned int i) const = 0;
/// Create a new exterior facet integral on sub domain i
virtual exterior_facet_integral*
create_exterior_facet_integral(unsigned int i) const = 0;
/// Create a new interior facet integral on sub domain i
virtual interior_facet_integral*
create_interior_facet_integral(unsigned int i) const = 0;
};
}
#endif
|