Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Search for

# P0 Class Reference

`#include <P0.h>`

Inheritance diagram for P0:

List of all members.

## Public Member Functions
| P0 ()
virtual | ~P0 ()
virtual void | compute_basis_functions ()

## Detailed Description

Definition at line 6 of file P0.h.

## Constructor & Destructor Documentation

P0::P0 | ( |  | ) | `[inline]`

| Definition at line 8 of file P0.h.
    00008 {}

virtual P0::~P0 | ( |  | ) | `[inline, virtual]`

| Definition at line 9 of file P0.h.
    00009 {}

## Member Function Documentation

void P0::compute_basis_functions | ( |  | ) | `[virtual]`

| Reimplemented from StandardFE. Definition at line 3 of file P0.cpp. References StandardFE::dofs, Polygon::no_vertices(), StandardFE::Ns, StandardFE::p, and Polygon::vertex(). Referenced by main().
    00003                                   {
    00004
    00005   if ( p == NULL ) {
    00006     cout <<"You need to set a polygon before the basisfunctions can be computed"<<endl;
    00007     return;
    00008   }
    00009
    00010   // insert basis function
    00011   Ns.insert(Ns.end(), GiNaC::numeric(1));
    00012
    00013   // create and insert dof
    00014   GiNaC::lst midpoint = GiNaC::lst();
    00015     for (int d=0; d< p->vertex(1).nops(); d++) {
    00016       midpoint.append(GiNaC::numeric(0));
    00017     }
    00018   for (int i=1; i<= p->no_vertices(); i++) {
    00019     for (int d=0; d< p->vertex(i-1).nops(); d++) {
    00020       midpoint.let_op(d)  += p->vertex(i-1).op(d);
    00021     }
    00022   }
    00023
    00024   for (int d=0; d< p->vertex(1).nops(); d++) {
    00025     midpoint.let_op(d)  = midpoint.op(d)/p->no_vertices();
    00026   }
    00027
    00028   dofs.insert(dofs.end(), midpoint);
    00029 }

The documentation for this class was generated from the following files:

- P0.h
- P0.cpp