Ice Sheet System Model  4.18
Code documentation
Public Member Functions | Data Fields
bamg::GeomEdge Class Reference

#include <GeomEdge.h>

Public Member Functions

GeomVertexoperator[] (int i)
 
const GeomVertexoperator[] (int i) const
 
GeomVertexoperator() (int i)
 
R2 F (double theta) const
 
int Cracked () const
 
int TgA () const
 
int TgB () const
 
int Mark () const
 
int Required ()
 
void SetCracked ()
 
void SetTgA ()
 
void SetTgB ()
 
void SetMark ()
 
void SetUnMark ()
 
void SetRequired ()
 
void Set (const GeomEdge &rec, const Geometry &Th, Geometry &ThNew)
 

Data Fields

GeomVertexv [2]
 
long ReferenceNumber
 
long CurveNumber
 
R2 tg [2]
 
GeomEdgeAdj [2]
 
int AdjVertexIndex [2]
 
int type
 

Detailed Description

Definition at line 11 of file GeomEdge.h.

Member Function Documentation

◆ operator[]() [1/2]

GeomVertex& bamg::GeomEdge::operator[] ( int  i)
inline

Definition at line 23 of file GeomEdge.h.

23 {return *v[i];};

◆ operator[]() [2/2]

const GeomVertex& bamg::GeomEdge::operator[] ( int  i) const
inline

Definition at line 24 of file GeomEdge.h.

24 { return *v[i];};

◆ operator()()

GeomVertex* bamg::GeomEdge::operator() ( int  i)
inline

Definition at line 25 of file GeomEdge.h.

25 {return v[i];};

◆ F()

R2 bamg::GeomEdge::F ( double  theta) const

Definition at line 20 of file GeomEdge.cpp.

20  {/*{{{*/
21  /*Original code from Frederic Hecht <hecht@ann.jussieu.fr> (BAMG v1.01, MeshGeom.cpp/F)*/
22  // parametrization of the curve edge
23 
24  R2 A=v[0]->r,B=v[1]->r;
25  double ca,cb,cta,ctb;
26 
27  //Check that theta is in [0 1]
28  _assert_(theta>-1e-12 && theta<1+1e-12);
29 
30  if (TgA()){
31  if (TgB()){ //Hermite interpolation
32  cb = theta*theta*(3-2*theta);
33  ca = 1-cb;
34  cta = (1-theta)*(1-theta)*theta;
35  ctb = (theta-1)*theta*theta ;
36  }
37  else {
38  double t = theta;
39  cb = t*t;
40  ca = 1-cb;
41  cta= t-cb;
42  ctb=0;
43  }
44  }
45  else{
46  if (TgB()){
47  double t = 1-theta;
48  ca = t*t;
49  cb = 1-ca;
50  ctb= -t+ca;
51  cta=0;
52  }
53  else { // lagrange P1
54  ca =(1-theta);
55  cb = theta;
56  cta=ctb=0;
57  }
58  }
59  return A*ca + B*cb + tg[0]*cta + tg[1]*ctb;
60  }

◆ Cracked()

int bamg::GeomEdge::Cracked ( ) const

Definition at line 17 of file GeomEdge.cpp.

17  {/*{{{*/
18  return type &1;
19  }/*}}}*/

◆ TgA()

int bamg::GeomEdge::TgA ( ) const

Definition at line 94 of file GeomEdge.cpp.

94  {/*{{{*/
95  return type &4;
96  }/*}}}*/

◆ TgB()

int bamg::GeomEdge::TgB ( ) const

Definition at line 97 of file GeomEdge.cpp.

97  {/*{{{*/
98  return type &8;
99  }/*}}}*/

◆ Mark()

int bamg::GeomEdge::Mark ( ) const

Definition at line 62 of file GeomEdge.cpp.

62  {/*{{{*/
63  return type &16;
64  }/*}}}*/

◆ Required()

int bamg::GeomEdge::Required ( )

Definition at line 65 of file GeomEdge.cpp.

65  {/*{{{*/
66  return type &64;
67  }/*}}}*/

◆ SetCracked()

void bamg::GeomEdge::SetCracked ( )

Definition at line 76 of file GeomEdge.cpp.

76  { /*{{{*/
77  type |= 1;/*=>1st digit to 1*/
78  }/*}}}*/

◆ SetTgA()

void bamg::GeomEdge::SetTgA ( )

Definition at line 79 of file GeomEdge.cpp.

79  { /*{{{*/
80  type |=4; /*=>2d digit to 1*/
81  }/*}}}*/

◆ SetTgB()

void bamg::GeomEdge::SetTgB ( )

Definition at line 82 of file GeomEdge.cpp.

82  { /*{{{*/
83  type |=8; /*=> 3d digit to 1*/
84  }/*}}}*/

◆ SetMark()

void bamg::GeomEdge::SetMark ( )

Definition at line 85 of file GeomEdge.cpp.

85  { /*{{{*/
86  type |=16;/*=> 4th digiy to 1*/
87  }/*}}}*/

◆ SetUnMark()

void bamg::GeomEdge::SetUnMark ( )

Definition at line 88 of file GeomEdge.cpp.

88  { /*{{{*/
89  type &= 1007 /* 1023-16 = 000111110111 => 4th digit to 0*/;
90  }/*}}}*/

◆ SetRequired()

void bamg::GeomEdge::SetRequired ( )

Definition at line 91 of file GeomEdge.cpp.

91  { /*{{{*/
92  type |= 64;/*=>6th digit to 1*/
93  }/*}}}*/

◆ Set()

void bamg::GeomEdge::Set ( const GeomEdge rec,
const Geometry Th,
Geometry ThNew 
)

Definition at line 68 of file GeomEdge.cpp.

68  { /*{{{*/
69  *this = rec;
70  v[0] = GhNew.vertices + Gh.GetId(v[0]);
71  v[1] = GhNew.vertices + Gh.GetId(v[1]);
72  if (Adj[0]) Adj[0] = GhNew.edges + Gh.GetId(Adj[0]);
73  if (Adj[1]) Adj[1] = GhNew.edges + Gh.GetId(Adj[1]);
74  }

Field Documentation

◆ v

GeomVertex* bamg::GeomEdge::v[2]

Definition at line 14 of file GeomEdge.h.

◆ ReferenceNumber

long bamg::GeomEdge::ReferenceNumber

Definition at line 15 of file GeomEdge.h.

◆ CurveNumber

long bamg::GeomEdge::CurveNumber

Definition at line 16 of file GeomEdge.h.

◆ tg

R2 bamg::GeomEdge::tg[2]

Definition at line 17 of file GeomEdge.h.

◆ Adj

GeomEdge* bamg::GeomEdge::Adj[2]

Definition at line 18 of file GeomEdge.h.

◆ AdjVertexIndex

int bamg::GeomEdge::AdjVertexIndex[2]

Definition at line 19 of file GeomEdge.h.

◆ type

int bamg::GeomEdge::type

Definition at line 20 of file GeomEdge.h.


The documentation for this class was generated from the following files:
_assert_
#define _assert_(ignore)
Definition: exceptions.h:37
bamg::GeomEdge::type
int type
Definition: GeomEdge.h:20
bamg::BamgVertex::r
R2 r
Definition: BamgVertex.h:21
bamg::GeomEdge::TgB
int TgB() const
Definition: GeomEdge.cpp:97
bamg::GeomEdge::v
GeomVertex * v[2]
Definition: GeomEdge.h:14
bamg::GeomEdge::tg
R2 tg[2]
Definition: GeomEdge.h:17
bamg::GeomEdge::Adj
GeomEdge * Adj[2]
Definition: GeomEdge.h:18
bamg::GeomEdge::TgA
int TgA() const
Definition: GeomEdge.cpp:94
bamg::R2
P2< double, double > R2
Definition: typedefs.h:12