proj home

Files   Classes   Functions   Hierarchy  

simplexD1linked< INDX > Class Template Reference

A instance of a generalized simplex in 1D. More...

#include <simplexD1linked.h>

Collaboration diagram for simplexD1linked< INDX >:

List of all members.

Public Member Functions

 simplexD1linked ()
 Default Constructor: all fields set to 0.
 simplexD1linked (INDX const a, INDX const b, INDX const na=0, INDX const nb=0)
 Construct a line.
void construct (INDX const a, INDX const b, INDX const na=0, INDX const nb=0)
 Construct this line.
void togglelinedirection ()
 Swap the line direction.
INDX const piInverse (INDX const gpt) const
 Get the local point index.
boolc isonboundary () const
 Does the line have end points?
void setnull ()
 Set all fields to 0.
boolc isnull () const
 Are all the fields set to zero?
 operator stringc () const
 Serialize this object.
void serializeInverse (stringc &s)
 Read in/construct an object.

Public Attributes

INDX pi [2]
 Indexes to points or verticies.
INDX ni [2]
 Indexes to neighboring simplexes.


Detailed Description

template<typename INDX = uint>
class simplexD1linked< INDX >

A instance of a generalized simplex in 1D.

The neighbor link is defined : given neighbor k, the point opposite and hence not in contact with the neighboring simplex k has a local index which is the index to neigbor k.

This definition was choosen because it generalized to simplexes in any dimension, and is useful in algorithms. ie piInverse.

Definition at line 23 of file simplexD1linked.h.


Constructor & Destructor Documentation

template<typename INDX = uint>
simplexD1linked< INDX >::simplexD1linked (  )  [inline]

Default Constructor: all fields set to 0.

Definition at line 34 of file simplexD1linked.h.

00034 {};

template<typename INDX >
simplexD1linked< INDX >::simplexD1linked ( INDX const   a,
INDX const   b,
INDX const   na = 0,
INDX const   nb = 0 
) [inline]

Construct a line.

Definition at line 122 of file simplexD1linked.h.

00125 {
00126   pi[0] = a;
00127   pi[1] = b;
00128   ni[0] = na;
00129   ni[1] = nb;
00130 }


Member Function Documentation

template<typename INDX >
void simplexD1linked< INDX >::construct ( INDX const   a,
INDX const   b,
INDX const   na = 0,
INDX const   nb = 0 
) [inline]

Construct this line.

Definition at line 134 of file simplexD1linked.h.

00137 {
00138   pi[0] = a;
00139   pi[1] = b;
00140   ni[0] = na;
00141   ni[1] = nb;
00142 }

template<typename INDX = uint>
boolc simplexD1linked< INDX >::isnull (  )  const [inline]

Are all the fields set to zero?

Definition at line 85 of file simplexD1linked.h.

References simplexD1linked< INDX >::ni, and simplexD1linked< INDX >::pi.

00086   {
00087     if (pi[0]!=0) return false;
00088     if (pi[1]!=0) return false;
00089     if (ni[0]!=0) return false;
00090     if (ni[1]!=0) return false;
00091     return true;
00092   }

template<typename INDX = uint>
boolc simplexD1linked< INDX >::isonboundary (  )  const [inline]

Does the line have end points?

Definition at line 73 of file simplexD1linked.h.

References simplexD1linked< INDX >::ni.

00074   {
00075     if (ni[0]==0) return true;
00076     if (ni[1]==0) return true;
00077     return false;
00078   }

template<typename INDX >
simplexD1linked< INDX >::operator stringc (  )  const [inline]

Serialize this object.

Definition at line 113 of file simplexD1linked.h.

References simplexD1linked< INDX >::ni, and simplexD1linked< INDX >::pi.

00114 {
00115   stringstream ss;
00116   ss << pi[0] << " " << pi[1] << " " << ni[0] << " " << ni[1];
00117   return ss.str();
00118 }

template<typename INDX = uint>
INDX const simplexD1linked< INDX >::piInverse ( INDX const   gpt  )  const [inline]

Get the local point index.

Definition at line 61 of file simplexD1linked.h.

References simplexD1linked< INDX >::pi.

00062   {
00063     assert(gpt!=0);
00064 
00065     if (pi[0]==gpt) return 0;
00066     if (pi[1]==gpt) return 1;
00067 
00068     assert(false);
00069     return 3; // Return crap.
00070   }

template<typename INDX = uint>
void simplexD1linked< INDX >::serializeInverse ( stringc s  )  [inline]

Read in/construct an object.

Definition at line 98 of file simplexD1linked.h.

References simplexD1linked< INDX >::ni, and simplexD1linked< INDX >::pi.

Referenced by simplexD1linkedtest::test01().

00099   {
00100     stringstream w(s);
00101     w >> pi[0];
00102     w >> pi[1];
00103     w >> ni[0];
00104     w >> ni[1];
00105   }

template<typename INDX = uint>
void simplexD1linked< INDX >::setnull (  )  [inline]

Set all fields to 0.

Definition at line 81 of file simplexD1linked.h.

References simplexD1linked< INDX >::ni, and simplexD1linked< INDX >::pi.

00082     { pi[0] = pi[1] = ni[0] = ni[1] = 0; }

template<typename INDX = uint>
void simplexD1linked< INDX >::togglelinedirection (  )  [inline]

Swap the line direction.

Definition at line 48 of file simplexD1linked.h.

References simplexD1linked< INDX >::ni, and simplexD1linked< INDX >::pi.

00049   {
00050     INDX p0 = pi[0];
00051     INDX n0 = ni[0];
00052     pi[0] = pi[1];
00053     ni[0] = ni[1];
00054     pi[1] = p0;
00055     ni[1] = n0;
00056   }


Member Data Documentation

template<typename INDX = uint>
INDX simplexD1linked< INDX >::ni[2]

template<typename INDX = uint>
INDX simplexD1linked< INDX >::pi[2]


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

Generated on Fri Mar 4 00:50:16 2011 for Chelton Evans Source by  doxygen 1.5.8