CppNoddy  0.90
Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | List of all members
CppNoddy::TwoD_TVDLF_Mesh Class Reference

#include <TwoD_TVDLF_Mesh.h>

Public Member Functions

 TwoD_TVDLF_Mesh (const DenseVector< double > &X, const DenseVector< double > &Y, TwoD_Hyperbolic_System *ptr, fn_ptr init_ptr)
 Constructor for the Finite Volume Mesh using linear elements. More...
 
virtual ~TwoD_TVDLF_Mesh ()
 Empty desctructor. More...
 
void dump_gnu (std::string filename)
 Dump the data to a given filename in a gnuplot format. More...
 
void dump_nodes_x (std::string filename) const
 Dump the x-nodal positions to a given filename. More...
 
void dump_nodes_y (std::string filename) const
 Dump the y-nodal positions to a given filename. More...
 
void dump_data (std::string filename)
 Dump the data over the nodal positions to a given filename. More...
 
void set_limiter (const unsigned &id)
 Set the limiter type to be applied in the slope values. More...
 
double update (const double &CFL, const double &max_dt=std::numeric_limits< long double >::max())
 Update the mesh object. More...
 
void update_to (const double &CFL, const double &t_end)
 Update the mesh object to a set time level. More...
 
DenseVector< double > integrate (std::string mesh_colour="black")
 Integrate the concentration values across the entire mesh. More...
 
elt_iter get_elt_iter_from_x (const DenseVector< double > &x, std::string mesh_colour="black")
 Given a global coordinate, return a pointer to the elt that contains that point. More...
 
DenseVector< double > get_point_values (const DenseVector< double > &x)
 Get the vector of unknowns at a point in the 2D mesh. More...
 
const double & get_time () const
 Get a const reference to the time value for the current mesh. More...
 
virtual void actions_before_time_step1 (const double &time_step)
 A virtual method that is run before the first time update. More...
 
virtual void actions_before_time_step2 (const double &time_step)
 A virtual method that is run before the second time update. More...
 

Public Attributes

vector_of_elts BLACK_ELTS
 An STL vector of linear elements – the black mesh. More...
 
vector_of_elts RED_ELTS
 An STL vector of linear elements – the red mesh. More...
 

Protected Types

typedef std::vector< TwoD_TVDLF_Eltvector_of_elts
 iterators for the vector of elements More...
 
typedef vector_of_elts::const_iterator celt_iter
 
typedef vector_of_elts::iterator elt_iter
 
typedef std::vector< TwoD_TVDLF_Elt * > vector_of_boundary_elts
 
typedef vector_of_boundary_elts::iterator bdry_elt_iter
 
typedef void(* fn_ptr) (const double &, const double &, DenseVector< double > &)
 function pointer used in the initial conditions More...
 

Protected Member Functions

elt_iter get_elt_iter_from_elt_iter (elt_iter e, std::string target_colour, int corner_index)
 Given an element in the INITIAL STRUCTURED MESH, this method will return an iterator to an element in the other mesh that overlaps the corner specified by corner_index. More...
 
vector_of_eltsget_elts_from_colour (std::string mesh_colour)
 Given a choice of black or red mesh, return a pointer to the appropriate vector of elements. More...
 
std::size_t get_number_elts_in_x (std::string mesh_colour)
 Given a choice of black or red mesh, return the number of elements in the x-direction. More...
 
void calc_slopes (vector_of_elts *elt_vector)
 Use the appropriate limiter to approximate the slope in each element in the mesh. More...
 
DenseVector< double > east_diff (elt_iter e) const
 Compute a finite difference approximation of the derivative in the compass direction. More...
 
DenseVector< double > west_diff (elt_iter e) const
 Compute a finite difference approximation of the derivative in the compass direction. More...
 
DenseVector< double > north_diff (elt_iter e) const
 Compute a finite difference approximation of the derivative in the compass direction. More...
 
DenseVector< double > south_diff (elt_iter e) const
 Compute a finite difference approximation of the derivative in the compass direction. More...
 
DenseVector< double > NS_diff (elt_iter e)
 Compute a finite difference approximation of the derivative in the compass direction. More...
 
DenseVector< double > EW_diff (elt_iter e)
 Compute a finite difference approximation of the derivative in the compass direction. More...
 
int sgn (double a) const
 Sign of a double. More...
 
DenseVector< double > minmod (DenseVector< double > A, DenseVector< double > B) const
 A vector version of the minmod operator. More...
 
DenseVector< double > maxmod (DenseVector< double > A, DenseVector< double > B) const
 A vector version of the maxmod operator. More...
 
void boundary_diff (elt_iter e, const int &face_index, DenseVector< double > &diff) const
 Given an element iterator and the local coordinate this will return zero for any components specified as inflow boundary conditions in line with Levy & Tadmor (1997) and set the centre nodal value to the edge value. More...
 
void set_boundary_Q (vector_of_elts *elts)
 Loops over all boundary elements and sets the Q values in each one to be the value specified by the edge_values method. More...
 

Protected Attributes

unsigned LIMITER
 Slope limiter method. More...
 
std::size_t ORDER_OF_SYSTEM
 order of the conservative system More...
 
std::size_t NX
 number of faces in the x & y directions More...
 
std::size_t NY
 
double MESH_TIME
 the time level of the mesh More...
 
fn_ptr p_Q_INIT
 function pointer to a funnction that defines the initial distribution More...
 

Detailed Description

Definition at line 20 of file TwoD_TVDLF_Mesh.h.

Member Typedef Documentation

typedef vector_of_boundary_elts::iterator CppNoddy::TwoD_TVDLF_Mesh::bdry_elt_iter
protected

Definition at line 29 of file TwoD_TVDLF_Mesh.h.

typedef vector_of_elts::const_iterator CppNoddy::TwoD_TVDLF_Mesh::celt_iter
protected

Definition at line 25 of file TwoD_TVDLF_Mesh.h.

typedef vector_of_elts::iterator CppNoddy::TwoD_TVDLF_Mesh::elt_iter
protected

Definition at line 26 of file TwoD_TVDLF_Mesh.h.

typedef void( * CppNoddy::TwoD_TVDLF_Mesh::fn_ptr) (const double &, const double &, DenseVector< double > &)
protected

function pointer used in the initial conditions

Definition at line 32 of file TwoD_TVDLF_Mesh.h.

Definition at line 28 of file TwoD_TVDLF_Mesh.h.

iterators for the vector of elements

Definition at line 24 of file TwoD_TVDLF_Mesh.h.

Constructor & Destructor Documentation

CppNoddy::TwoD_TVDLF_Mesh::TwoD_TVDLF_Mesh ( const DenseVector< double > &  X,
const DenseVector< double > &  Y,
TwoD_Hyperbolic_System ptr,
fn_ptr  init_ptr 
)

Constructor for the Finite Volume Mesh using linear elements.

Parameters
XA vector of nodal locations at which the element FACES will positioned
YA vector of nodal locations at which the element FACES will positioned
ptrA pointer to the hyperbolic system applied to this mesh
init_ptrA pointer to a function that defines the initial conditions

Definition at line 16 of file TwoD_TVDLF_Mesh.cpp.

References BLACK_ELTS, calc_slopes(), get_elt_iter_from_elt_iter(), LIMITER, MESH_TIME, NX, NY, ORDER_OF_SYSTEM, p_Q_INIT, RED_ELTS, CppNoddy::Example::s, and CppNoddy::DenseVector< _Type >::size().

19  {
20 
21 #ifdef DEBUG
22  std::cout << "DEBUG: Starting construction of a TwoD_TVDLF_Mesh object. \n";
23 #endif
24  MESH_TIME = 0.0;
25  NX = X.size();
26  NY = Y.size();
27  if ( std::min( NX - 1, NY - 1 ) <= 1 )
28  {
29  std::string problem;
30  problem = " The TwoD_TVDLF_Mesh object is trying to construct itself \n";
31  problem += " with just one element in one of the directions! \n";
32  throw ExceptionRuntime( problem );
33  }
34 
35 #ifdef DEBUG
36  std::cout << "DEBUG: configuration of the black mesh \n";
37 #endif
38 
39  // reserve appropriate space to avoid re-allocation later
40  BLACK_ELTS.reserve( ( NX - 1 ) * ( NY - 1 ) );
41  RED_ELTS.reserve( NX * NY );
42 
43  // set up the fn ptr to the initial conditions fn
44  p_Q_INIT = init_ptr;
45  // default limiter
46  LIMITER = 0;
47  // store the order of the conservative system here for simplicity
48  ORDER_OF_SYSTEM = ptr -> get_order();
49 
50  // face index of edges
51  std::set<int> faces_s;
52  faces_s.insert( 0 );
53  std::set<int> faces_e;
54  faces_e.insert( 1 );
55  std::set<int> faces_n;
56  faces_n.insert( 2 );
57  std::set<int> faces_w;
58  faces_w.insert( 3 );
59  // face indices of corners
60  std::set<int> faces_se( faces_s );
61  faces_se.insert( 1 );
62  std::set<int> faces_ne( faces_n );
63  faces_ne.insert( 1 );
64  std::set<int> faces_nw( faces_n );
65  faces_nw.insert( 3 );
66  std::set<int> faces_sw( faces_s );
67  faces_sw.insert( 3 );
68  // set up the black elements
69  {
70  // southern row
71  BLACK_ELTS.push_back( TwoD_TVDLF_Elt( X[0], X[1], Y[0], Y[1], ptr, true, faces_sw ) );
72  for ( std::size_t i = 1; i <= NX - 3; ++i )
73  {
74  BLACK_ELTS.push_back( TwoD_TVDLF_Elt( X[i], X[i+1], Y[0], Y[1], ptr, true, faces_s ) );
75  }
76  BLACK_ELTS.push_back( TwoD_TVDLF_Elt( X[NX-2], X[NX-1], Y[0], Y[1], ptr, true, faces_se ) );
77  // interior elts
78  for ( std::size_t j = 1; j <= NY - 3; ++j )
79  {
80  BLACK_ELTS.push_back( TwoD_TVDLF_Elt( X[0], X[1], Y[j], Y[j+1], ptr, true, faces_w ) );
81  for ( std::size_t i = 1; i <= NX - 3; ++i )
82  {
83  BLACK_ELTS.push_back( TwoD_TVDLF_Elt( X[i], X[i+1], Y[j], Y[j+1], ptr ) );
84  }
85  BLACK_ELTS.push_back( TwoD_TVDLF_Elt( X[NX-2], X[NX-1], Y[j], Y[j+1], ptr, true, faces_e ) );
86  }
87  // northern row
88  BLACK_ELTS.push_back( TwoD_TVDLF_Elt( X[0], X[1], Y[NY-2], Y[NY-1], ptr, true, faces_nw ) );
89  for ( std::size_t i = 1; i <= NX - 3; ++i )
90  {
91  BLACK_ELTS.push_back( TwoD_TVDLF_Elt( X[i], X[i+1], Y[NY-2], Y[NY-1], ptr, true, faces_n ) );
92  }
93  BLACK_ELTS.push_back( TwoD_TVDLF_Elt( X[NX-2], X[NX-1], Y[NY-2], Y[NY-1], ptr, true, faces_ne ) );
94  }
95 
96 #ifdef DEBUG
97  std::cout << "DEBUG: configuration of the red mesh \n";
98 #endif
99 
100  // set up the red elements
101  {
102  // southern row
103  RED_ELTS.push_back( TwoD_TVDLF_Elt( X[0], ( X[1] + X[0] ) / 2, Y[0], ( Y[0] + Y[1] ) / 2, ptr, true, faces_sw ) );
104  for ( std::size_t i = 1; i <= NX - 2; ++i )
105  {
106  RED_ELTS.push_back( TwoD_TVDLF_Elt( ( X[i-1] + X[i] ) / 2, ( X[i] + X[i+1] ) / 2, Y[0], ( Y[0] + Y[1] ) / 2, ptr, true, faces_s ) );
107  }
108  RED_ELTS.push_back( TwoD_TVDLF_Elt( ( X[NX-2] + X[NX-1] ) / 2, X[NX-1], Y[0], ( Y[0] + Y[1] ) / 2, ptr, true, faces_se ) );
109  // interior elts
110  for ( std::size_t j = 1; j <= NY - 2; ++j )
111  {
112  RED_ELTS.push_back( TwoD_TVDLF_Elt( X[0], ( X[1] + X[0] ) / 2, ( Y[j-1] + Y[j] ) / 2, ( Y[j] + Y[j+1] ) / 2, ptr, true, faces_w ) );
113  for ( std::size_t i = 1; i <= NX - 2; ++i )
114  {
115  RED_ELTS.push_back( TwoD_TVDLF_Elt( ( X[i-1] + X[i] ) / 2, ( X[i] + X[i+1] ) / 2, ( Y[j-1] + Y[j] ) / 2, ( Y[j] + Y[j+1] ) / 2, ptr ) );
116  }
117  RED_ELTS.push_back( TwoD_TVDLF_Elt( ( X[NX-2] + X[NX-1] ) / 2, X[NX-1], ( Y[j-1] + Y[j] ) / 2, ( Y[j] + Y[j+1] ) / 2, ptr, true, faces_e ) );
118  }
119  // northern row
120  RED_ELTS.push_back( TwoD_TVDLF_Elt( X[0], ( X[1] + X[0] ) / 2, ( Y[NY-2] + Y[NY-1] ) / 2, Y[NY-1], ptr, true, faces_nw ) );
121  for ( std::size_t i = 1; i <= NX - 2; ++i )
122  {
123  RED_ELTS.push_back( TwoD_TVDLF_Elt( ( X[i-1] + X[i] ) / 2, ( X[i] + X[i+1] ) / 2, ( Y[NY-2] + Y[NY-1] ) / 2, Y[NY-1], ptr, true, faces_n ) );
124  }
125  RED_ELTS.push_back( TwoD_TVDLF_Elt( ( X[NX-2] + X[NX-1] ) / 2, X[NX-1], ( Y[NY-2] + Y[NY-1] ) / 2, Y[NY-1], ptr, true, faces_ne ) );
126  }
127 
128 #ifdef DEBUG
129  std::cout << "DEBUG: computing black to red projection \n";
130 #endif
131 
132  // Now we need to pre-compute the mesh projection from black-red-black.
133  // Each element needs to know which element in the other mesh contributes
134  // to it in the projection scheme. It also needs to know which of its faces
135  // the element contributes to in the flux computation.
136  // We assume the constructor is not required to be efficient & just brute
137  // force it here rather than working out all the index mappings by hand.
138  //
139  // loop through all the black elts
140  elt_iter eb = BLACK_ELTS.begin();
141  while ( eb != BLACK_ELTS.end() )
142  {
143  // local coordinates of the corners
144  DenseVector<double> ne( 2, 1.0 );
145  DenseVector<double> sw( -ne );
146  DenseVector<double> se( 2, 1.0 );
147  se[ 1 ] = -1.0;
148  DenseVector<double> nw( -se );
149  // global coordinates of the corners
150  DenseVector<double> bx_sw = eb -> get_x( sw );
151  DenseVector<double> bx_ne = eb -> get_x( ne );
152  DenseVector<double> bx_nw = eb -> get_x( nw );
153  DenseVector<double> bx_se = eb -> get_x( se );
154  // get an iterator to the red elt that contains each corner
155  // & add it as a contribution
156  //
157  // nw corner
158  {
159  //elt_iter er = get_elt_iter_from_x( bx_nw, "red" );
160  elt_iter er = get_elt_iter_from_elt_iter( eb, "red", 3 );
161  DenseVector<double> s = er -> get_s( bx_nw );
162  DenseVector<double> s1( 2, 0.0 );
163  s1[ 0 ] = s[ 0 ];
164  s1[ 1 ] = -1.0;
165  DenseVector<double> s2( 2, 0.0 );
166  s2[ 0 ] = 1.0;
167  s2[ 1 ] = s[ 1 ];
168  eb -> add_contribution( &( *er ), s1, s2, faces_nw );
169  }
170  // sw corner
171  {
172  //elt_iter er = get_elt_iter_from_x( bx_sw, "red" );
173  elt_iter er = get_elt_iter_from_elt_iter( eb, "red", 0 );
174  DenseVector<double> s = er -> get_s( bx_sw );
175  DenseVector<double> s1( 2, 0.0 );
176  s1[ 0 ] = s[ 0 ];
177  s1[ 1 ] = s[ 1 ];
178  DenseVector<double> s2( 2, 0.0 );
179  s2[ 0 ] = 1.0;
180  s2[ 1 ] = 1.0;
181  eb -> add_contribution( &( *er ), s1, s2, faces_sw );
182  }
183  // ne corner
184  {
185  //elt_iter er = get_elt_iter_from_x( bx_ne, "red" );
186  elt_iter er = get_elt_iter_from_elt_iter( eb, "red", 2 );
187  DenseVector<double> s = er -> get_s( bx_ne );
188  DenseVector<double> s1( 2, 0.0 );
189  s1[ 0 ] = -1.0;
190  s1[ 1 ] = -1.0;
191  DenseVector<double> s2( 2, 0.0 );
192  s2[ 0 ] = s[ 0 ];
193  s2[ 1 ] = s[ 1 ];
194  eb -> add_contribution( &( *er ), s1, s2, faces_ne );
195  }
196  // se corner
197  {
198  //elt_iter er = get_elt_iter_from_x( bx_se, "red" );
199  elt_iter er = get_elt_iter_from_elt_iter( eb, "red", 1 );
200  DenseVector<double> s = er -> get_s( bx_se );
201  DenseVector<double> s1( 2, 0.0 );
202  s1[ 0 ] = -1.0;
203  s1[ 1 ] = s[ 1 ];
204  DenseVector<double> s2( 2, 0.0 );
205  s2[ 0 ] = s[ 0 ];
206  s2[ 1 ] = 1.0;
207  eb -> add_contribution( &( *er ), s1, s2, faces_se );
208  }
209  ++eb;
210  }
211 
212 #ifdef DEBUG
213  std::cout << "DEBUG: computing red to black projection \n";
214 #endif
215 
216  // now we need to set up the projection from red to black elts.
217  // it's a little more tricky here as we have to avoid the external nodes.
218  elt_iter er = RED_ELTS.begin();
219  while ( er != RED_ELTS.end() )
220  {
221  // local coordinates of the corners
222  DenseVector<double> ne( 2, 1.0 );
223  DenseVector<double> sw( -ne );
224  DenseVector<double> se( 2, 1.0 );
225  se[ 1 ] = -1.0;
226  DenseVector<double> nw( -se );
227  // global coordinates of the corners
228  DenseVector<double> bx_sw = er -> get_x( sw );
229  DenseVector<double> bx_ne = er -> get_x( ne );
230  DenseVector<double> bx_nw = er -> get_x( nw );
231  DenseVector<double> bx_se = er -> get_x( se );
232  //
233  std::set<int> external = er -> get_external_faces();
234  if ( ( external.find( 2 ) == external.end() ) &&
235  ( external.find( 3 ) == external.end() ) )
236  {
237  // nw corner is internal
238  //elt_iter eb = get_elt_iter_from_x( bx_nw, "black" );
239  elt_iter eb = get_elt_iter_from_elt_iter( er, "black", 3 );
240  DenseVector<double> s = eb -> get_s( bx_nw );
241  DenseVector<double> s1( 2, 0.0 );
242  s1[ 0 ] = s[ 0 ];
243  s1[ 1 ] = -1.0;
244  DenseVector<double> s2( 2, 0.0 );
245  s2[ 0 ] = 1.0;
246  s2[ 1 ] = s[ 1 ];
247  er -> add_contribution( &( *eb ), s1, s2, faces_nw );
248  }
249  if ( ( external.find( 0 ) == external.end() ) &&
250  ( external.find( 3 ) == external.end() ) )
251  {
252  // sw corner is internal
253  //elt_iter eb = get_elt_iter_from_x( bx_sw, "black" );
254  elt_iter eb = get_elt_iter_from_elt_iter( er, "black", 0 );
255  DenseVector<double> s = eb -> get_s( bx_sw );
256  DenseVector<double> s1( 2, 0.0 );
257  s1[ 0 ] = s[ 0 ];
258  s1[ 1 ] = s[ 1 ];
259  DenseVector<double> s2( 2, 0.0 );
260  s2[ 0 ] = 1.0;
261  s2[ 1 ] = 1.0;
262  er -> add_contribution( &( *eb ), s1, s2, faces_sw );
263  }
264  if ( ( external.find( 1 ) == external.end() ) &&
265  ( external.find( 2 ) == external.end() ) )
266  {
267  // ne corner is internal
268  //elt_iter eb = get_elt_iter_from_x( bx_ne, "black" );
269  elt_iter eb = get_elt_iter_from_elt_iter( er, "black", 2 );
270  DenseVector<double> s = eb -> get_s( bx_ne );
271  DenseVector<double> s1( 2, 0.0 );
272  s1[ 0 ] = -1.0;
273  s1[ 1 ] = -1.0;
274  DenseVector<double> s2( 2, 0.0 );
275  s2[ 0 ] = s[ 0 ];
276  s2[ 1 ] = s[ 1 ];
277  er -> add_contribution( &( *eb ), s1, s2, faces_ne );
278  }
279  if ( ( external.find( 0 ) == external.end() ) &&
280  ( external.find( 1 ) == external.end() ) )
281  {
282  // se corner is internal
283  //elt_iter eb = get_elt_iter_from_x( bx_se, "black" );
284  elt_iter eb = get_elt_iter_from_elt_iter( er, "black", 1 );
285  DenseVector<double> s = eb -> get_s( bx_se );
286  DenseVector<double> s1( 2, 0.0 );
287  s1[ 0 ] = -1.0;
288  s1[ 1 ] = s[ 1 ];
289  DenseVector<double> s2( 2, 0.0 );
290  s2[ 0 ] = s[ 0 ];
291  s2[ 1 ] = 1.0;
292  er -> add_contribution( &( *eb ), s1, s2, faces_se );
293  }
294  ++er;
295  }
296 
297 #ifdef DEBUG
298  std::cout << "DEBUG: setting up pointers to NESW elts in black mesh\n";
299 #endif
300 
301  // we need to set the pointers to neighbouring elts in both meshes
302  eb = BLACK_ELTS.begin();
303  while ( eb != BLACK_ELTS.end() )
304  {
305  // the offset for computing N & S elts is no. of faces minus one
306  const std::size_t offset( NX - 1 );
307  // get a set of external faces
308  std::set< int > faces( eb -> get_external_faces() );
309  if ( eb -> face_is_internal( 0 ) )
310  {
311  // southern face is internal
312  eb -> set_ptrs( 0, &( *eb ) - offset );
313  }
314  if ( eb -> face_is_internal( 1 ) )
315  {
316  // eastern face is internal
317  eb -> set_ptrs( 1, &( *eb ) + 1 );
318  }
319  if ( eb -> face_is_internal( 2 ) )
320  {
321  // northern face is internal
322  eb -> set_ptrs( 2, &( *eb ) + offset );
323  }
324  if ( eb -> face_is_internal( 3 ) )
325  {
326  // western face is internal
327  eb -> set_ptrs( 3, &( *eb ) - 1 );
328  }
329  ++eb;
330  }
331 
332 #ifdef DEBUG
333  std::cout << "DEBUG: setting up pointers to NESW elts in red mesh\n";
334 #endif
335 
336  // we need to set the pointers to neighbouring elts in both meshes
337  er = RED_ELTS.begin();
338  while ( er != RED_ELTS.end() )
339  {
340  // the offset for computing N & S elts is no. of faces
341  // as the red mesh has an extra elt per row
342  const std::size_t offset( NX );
343  // get a set of external faces
344  std::set< int > faces( er -> get_external_faces() );
345  if ( er -> face_is_internal( 0 ) )
346  {
347  // southern face is internal
348  er -> set_ptrs( 0, &( *er ) - offset );
349  }
350  if ( er -> face_is_internal( 1 ) )
351  {
352  // eastern face is internal
353  er -> set_ptrs( 1, &( *er ) + 1 );
354  }
355  if ( er -> face_is_internal( 2 ) )
356  {
357  // northern face is internal
358  er -> set_ptrs( 2, &( *er ) + offset );
359  }
360  if ( er -> face_is_internal( 3 ) )
361  {
362  // western face is internal
363  er -> set_ptrs( 3, &( *er ) - 1 );
364  }
365  ++er;
366  }
367 
368 #ifdef DEBUG
369  std::cout << "DEBUG: initialising the black mesh \n";
370 #endif
371 
372  // now all that remains is to initialise the starting (black) mesh
373  eb = BLACK_ELTS.begin();
374  while ( eb != BLACK_ELTS.end() )
375  {
376  DenseVector<double> s( 2, 0.0 );
377  // compute to the east
378  s[ 0 ] = 1.0;
379  s[ 1 ] = 0.0;
380  DenseVector<double> xe( eb -> get_x( s ) );
381  DenseVector<double> Qe( ORDER_OF_SYSTEM, 0.0 );
382  p_Q_INIT( xe[0], xe[1], Qe );
383  // compute to the west
384  s[ 0 ] = -1.0;
385  s[ 1 ] = 0.0;
386  DenseVector<double> xw( eb -> get_x( s ) );
387  DenseVector<double> Qw( ORDER_OF_SYSTEM, 0.0 );
388  p_Q_INIT( xw[0], xw[1], Qw );
389  // compute to the north
390  s[ 0 ] = 0.0;
391  s[ 1 ] = 1.0;
392  DenseVector<double> xn( eb -> get_x( s ) );
393  DenseVector<double> Qn( ORDER_OF_SYSTEM, 0.0 );
394  p_Q_INIT( xn[0], xn[1], Qn );
395  // compute to the north
396  s[ 0 ] = 0.0;
397  s[ 1 ] = -1.0;
398  DenseVector<double> xs( eb -> get_x( s ) );
399  DenseVector<double> Qs( ORDER_OF_SYSTEM, 0.0 );
400  p_Q_INIT( xs[0], xs[1], Qs );
401  // difference for the slopes
402  eb -> set_slope_x( ( Qe - Qw ) / ( xe[0] - xw[0] ) );
403  eb -> set_slope_y( ( Qn - Qs ) / ( xn[1] - xs[1] ) );
404  // set the mid value
405  eb -> set_Q_mid( ( Qe + Qw + Qn + Qs ) / 4 );
406  ++eb;
407  }
408 
409 #ifdef DEBUG
410  std::cout << "DEBUG: mesh constructor complete \n";
411 #endif
412 
413  // now all that remains is to initialise the starting (black) mesh
414  eb = BLACK_ELTS.begin();
415  while ( eb != BLACK_ELTS.end() )
416  {
417  DenseVector<double> x( 2, 0.0 );
418  DenseVector<double> s( 2, 0.0 );
419  x = eb -> get_x( s );
420  DenseVector<double> Q( ORDER_OF_SYSTEM, 0.0 );
421  p_Q_INIT( x[0], x[1], Q );
422  eb -> set_Q_mid( Q );
423  ++eb;
424  }
425 
427 
428  }
vector_of_elts BLACK_ELTS
An STL vector of linear elements – the black mesh.
fn_ptr p_Q_INIT
function pointer to a funnction that defines the initial distribution
double s
relative rotation rate
double MESH_TIME
the time level of the mesh
elt_iter get_elt_iter_from_elt_iter(elt_iter e, std::string target_colour, int corner_index)
Given an element in the INITIAL STRUCTURED MESH, this method will return an iterator to an element in...
std::size_t ORDER_OF_SYSTEM
order of the conservative system
vector_of_elts::iterator elt_iter
std::size_t size() const
A pass-thru definition to get the size of the vector.
Definition: DenseVector.h:365
void calc_slopes(vector_of_elts *elt_vector)
Use the appropriate limiter to approximate the slope in each element in the mesh. ...
vector_of_elts RED_ELTS
An STL vector of linear elements – the red mesh.
std::size_t NX
number of faces in the x & y directions
unsigned LIMITER
Slope limiter method.
CppNoddy::TwoD_TVDLF_Mesh::~TwoD_TVDLF_Mesh ( )
virtual

Empty desctructor.

Definition at line 430 of file TwoD_TVDLF_Mesh.cpp.

431  {}

Member Function Documentation

virtual void CppNoddy::TwoD_TVDLF_Mesh::actions_before_time_step1 ( const double &  time_step)
inlinevirtual

A virtual method that is run before the first time update.

For user-custom problems.

Parameters
time_stepThe time step size that is about to be taken

Definition at line 112 of file TwoD_TVDLF_Mesh.h.

Referenced by update().

113  {
114  // Empty by default. If you want to take actions before the time
115  // step then you need to inherit from this basic mesh and implement
116  // this method.
117  }
virtual void CppNoddy::TwoD_TVDLF_Mesh::actions_before_time_step2 ( const double &  time_step)
inlinevirtual

A virtual method that is run before the second time update.

For user-custom problems.

Parameters
time_stepThe time step size that is about to be taken

Definition at line 122 of file TwoD_TVDLF_Mesh.h.

Referenced by update().

123  {
124  // Empty by default. If you want to take actions before the time
125  // step then you need to inherit from this basic mesh and implement
126  // this method.
127  }
void CppNoddy::TwoD_TVDLF_Mesh::boundary_diff ( elt_iter  e,
const int &  face_index,
DenseVector< double > &  diff 
) const
protected

Given an element iterator and the local coordinate this will return zero for any components specified as inflow boundary conditions in line with Levy & Tadmor (1997) and set the centre nodal value to the edge value.

Parameters
eElement iterator
face_indexThe index of the face that is on a boundary
diffA vector of derivatives

Definition at line 1008 of file TwoD_TVDLF_Mesh.cpp.

References ORDER_OF_SYSTEM.

Referenced by east_diff(), EW_diff(), get_elt_iter_from_elt_iter(), north_diff(), NS_diff(), south_diff(), and west_diff().

1009  {
1010  DenseVector<double> se( 2, 0.0 );
1011  // get the appropriate local coordinate for the mid point on the edge
1012  switch ( face_index )
1013  {
1014  case 0:
1015  // south
1016  se[ 0 ] = 0.0;
1017  se[ 1 ] = -1.0;
1018  break;
1019  case 1:
1020  // east
1021  se[ 0 ] = 1.0;
1022  se[ 1 ] = 0.0;
1023  break;
1024  case 2:
1025  // north
1026  se[ 0 ] = 0.0;
1027  se[ 1 ] = 1.0;
1028  break;
1029  case 3:
1030  // west
1031  se[ 0 ] = -1.0;
1032  se[ 1 ] = 0.0;
1033  break;
1034  }
1035  // for the edge value
1036  DenseVector<double> Q( e -> get_Q( se ) );
1037  // look at the user-defined BCs for any defined Dirichlet conditions
1038  std::vector<bool> inflow = e -> p_system -> edge_values( face_index, e -> get_x( se ), Q );
1039  // the default is a zero slope in accordance with Levy & Tadmor (1997)
1040  DenseVector<double> sigma_n( ORDER_OF_SYSTEM, 0.0 );
1041  // allow the user to override the zero slope
1042  e -> p_system -> edge_slopes( face_index, e -> get_x( se ), sigma_n );
1043  // use edge values for inflow conditions
1044  for ( std::size_t i = 0; i < ORDER_OF_SYSTEM; ++i )
1045  {
1046  if ( inflow[ i ] == true )
1047  {
1048  // set a zero slope as per Levy & Tadmor (1997)?
1049  diff[ i ] = sigma_n[ i ];// ( Qe[ i ] - Qm[ i ] ) / delta;
1050  //std::cout << face_index << " " << diff[ i ] << "\n";
1051  }
1052  }
1053  }
std::size_t ORDER_OF_SYSTEM
order of the conservative system
void CppNoddy::TwoD_TVDLF_Mesh::calc_slopes ( vector_of_elts elt_vector)
protected

Use the appropriate limiter to approximate the slope in each element in the mesh.

The slopes will be sent down to the element objects and then onto the face objects.

Parameters
elt_vectorThe vector of elements to set the slope for

superbee

Definition at line 760 of file TwoD_TVDLF_Mesh.cpp.

References east_diff(), EW_diff(), LIMITER, maxmod(), minmod(), north_diff(), NS_diff(), ORDER_OF_SYSTEM, set_boundary_Q(), south_diff(), and west_diff().

Referenced by get_elt_iter_from_elt_iter(), TwoD_TVDLF_Mesh(), and update().

761  {
762  set_boundary_Q( elt_vector );
763  elt_iter e( elt_vector -> begin() );
764  DenseVector<double> slope_east( ORDER_OF_SYSTEM, 0.0 );
765  DenseVector<double> slope_west( ORDER_OF_SYSTEM, 0.0 );
766  DenseVector<double> slope_north( ORDER_OF_SYSTEM, 0.0 );
767  DenseVector<double> slope_south( ORDER_OF_SYSTEM, 0.0 );
768  switch ( LIMITER )
769  {
770  case 0:
771  // minmod
772  while ( e != elt_vector -> end() )
773  {
774  slope_east = east_diff( e );
775  slope_west = west_diff( e );
776  slope_south = south_diff( e );
777  slope_north = north_diff( e );
778  e -> set_slope_x( minmod( slope_east, slope_west ) );
779  e -> set_slope_y( minmod( slope_north, slope_south ) );
780  ++e;
781  }
782  break;
783  case 1:
784  // MC
785  while ( e != elt_vector -> end() )
786  {
787  slope_east = east_diff( e );
788  slope_west = west_diff( e );
789  DenseVector<double> slope_ew( EW_diff( e ) );
790  slope_south = south_diff( e );
791  slope_north = north_diff( e );
792  DenseVector<double> slope_ns( NS_diff( e ) );
793  const DenseVector<double> temp_x( minmod( slope_east * 2, slope_west * 2 ) );
794  const DenseVector<double> slope_x( minmod( temp_x, slope_ew ) );
795  const DenseVector<double> temp_y( minmod( slope_north * 2, slope_south * 2 ) );
796  const DenseVector<double> slope_y( minmod( temp_y, slope_ns ) );
797  e -> set_slope_x( slope_x );
798  e -> set_slope_y( slope_y );
799  ++e;
800  }
801  case 2:
802  /// superbee
803  while ( e != elt_vector -> end() )
804  {
805  slope_east = east_diff( e );
806  slope_west = west_diff( e );
807  slope_south = south_diff( e );
808  slope_north = north_diff( e );
809  const DenseVector<double> slope_x = maxmod(
810  minmod( slope_east, slope_west * 2. ),
811  minmod( slope_east * 2., slope_west )
812  );
813  e -> set_slope_x( slope_x );
814  const DenseVector<double> slope_y = maxmod(
815  minmod( slope_north, slope_south * 2. ),
816  minmod( slope_north * 2., slope_south )
817  );
818  e -> set_slope_y( slope_y );
819  ++e;
820  }
821  break;
822  default:
823  std::string problem;
824  problem = " The TwoD_TVDLF_Mesh object has an unrecognised 'LIMITER' identifier. \n";
825  throw ExceptionRuntime( problem );
826  }
827  }
DenseVector< double > west_diff(elt_iter e) const
Compute a finite difference approximation of the derivative in the compass direction.
DenseVector< double > east_diff(elt_iter e) const
Compute a finite difference approximation of the derivative in the compass direction.
std::size_t ORDER_OF_SYSTEM
order of the conservative system
DenseVector< double > maxmod(DenseVector< double > A, DenseVector< double > B) const
A vector version of the maxmod operator.
vector_of_elts::iterator elt_iter
DenseVector< double > north_diff(elt_iter e) const
Compute a finite difference approximation of the derivative in the compass direction.
void set_boundary_Q(vector_of_elts *elts)
Loops over all boundary elements and sets the Q values in each one to be the value specified by the e...
DenseVector< double > south_diff(elt_iter e) const
Compute a finite difference approximation of the derivative in the compass direction.
DenseVector< double > NS_diff(elt_iter e)
Compute a finite difference approximation of the derivative in the compass direction.
DenseVector< double > minmod(DenseVector< double > A, DenseVector< double > B) const
A vector version of the minmod operator.
DenseVector< double > EW_diff(elt_iter e)
Compute a finite difference approximation of the derivative in the compass direction.
unsigned LIMITER
Slope limiter method.
void CppNoddy::TwoD_TVDLF_Mesh::dump_data ( std::string  filename)

Dump the data over the nodal positions to a given filename.

Parameters
filenameThe filename to be generated

Definition at line 501 of file TwoD_TVDLF_Mesh.cpp.

References BLACK_ELTS, ORDER_OF_SYSTEM, and CppNoddy::Example::s.

Referenced by main().

502  {
503  std::ofstream dump;
504  dump.open( filename.c_str() );
505  dump.precision( 6 );
506  elt_iter e;
507  DenseVector<double> s( 2, 0.0 );
508  {
509  e = BLACK_ELTS.begin();
510  while ( e != BLACK_ELTS.end() )
511  {
512  for ( std::size_t i = 0; i < ORDER_OF_SYSTEM; ++i )
513  {
514  dump << e -> get_Q( s )[i] << " ";
515  }
516  for ( std::size_t i = 0; i < ORDER_OF_SYSTEM; ++i )
517  {
518  dump << e -> get_slope_x()[i] << " ";
519  }
520  for ( std::size_t i = 0; i < ORDER_OF_SYSTEM; ++i )
521  {
522  dump << e -> get_slope_y()[i] << " ";
523  }
524  dump << "\n";
525  ++e;
526  }
527  }
528  dump.close();
529  }
vector_of_elts BLACK_ELTS
An STL vector of linear elements – the black mesh.
double s
relative rotation rate
std::size_t ORDER_OF_SYSTEM
order of the conservative system
vector_of_elts::iterator elt_iter
void CppNoddy::TwoD_TVDLF_Mesh::dump_gnu ( std::string  filename)

Dump the data to a given filename in a gnuplot format.

Parameters
filenameThe filename to be generated

Definition at line 433 of file TwoD_TVDLF_Mesh.cpp.

References BLACK_ELTS, ORDER_OF_SYSTEM, and CppNoddy::Example::s.

Referenced by main().

434  {
435  std::ofstream dump;
436  dump.open( filename.c_str() );
437  dump.precision( 6 );
438  DenseVector<double> s( 2, 0.0 );
439  {
440  elt_iter e( BLACK_ELTS.begin() );
441  while ( e != BLACK_ELTS.end() )
442  {
443  dump << e -> get_x( s )[0] << " " << e -> get_x( s )[1] << " ";
444  for ( std::size_t i = 0; i < ORDER_OF_SYSTEM; ++i )
445  {
446  dump << e -> get_Q( s )[i] << " ";
447  }
448  for ( std::size_t i = 0; i < ORDER_OF_SYSTEM; ++i )
449  {
450  dump << e -> get_slope_x()[i] << " ";
451  }
452  for ( std::size_t i = 0; i < ORDER_OF_SYSTEM; ++i )
453  {
454  dump << e -> get_slope_y()[i] << " ";
455  }
456  dump << "\n";
457  if ( e -> face_is_external( 1 ) )
458  dump << "\n";
459  ++e;
460  }
461  }
462  dump.close();
463  }
vector_of_elts BLACK_ELTS
An STL vector of linear elements – the black mesh.
double s
relative rotation rate
std::size_t ORDER_OF_SYSTEM
order of the conservative system
vector_of_elts::iterator elt_iter
void CppNoddy::TwoD_TVDLF_Mesh::dump_nodes_x ( std::string  filename) const

Dump the x-nodal positions to a given filename.

This method only applies to regular structured meshes.

Parameters
filenameThe filename to be generated

Definition at line 465 of file TwoD_TVDLF_Mesh.cpp.

References BLACK_ELTS, NX, and CppNoddy::Example::s.

Referenced by main().

466  {
467  std::ofstream dump;
468  dump.open( filename.c_str() );
469  dump.precision( 6 );
470  DenseVector<double> s( 2, 0.0 );
471  celt_iter e;
472  {
473  e = BLACK_ELTS.begin();
474  for ( unsigned i = 0; i < NX - 1; ++i )
475  {
476  dump << e -> get_x( s )[0] << "\n";
477  ++e;
478  }
479  }
480  dump.close();
481  }
vector_of_elts BLACK_ELTS
An STL vector of linear elements – the black mesh.
vector_of_elts::const_iterator celt_iter
double s
relative rotation rate
std::size_t NX
number of faces in the x & y directions
void CppNoddy::TwoD_TVDLF_Mesh::dump_nodes_y ( std::string  filename) const

Dump the y-nodal positions to a given filename.

This method only applies to regular structured meshes.

Parameters
filenameThe filename to be generated

Definition at line 483 of file TwoD_TVDLF_Mesh.cpp.

References BLACK_ELTS, NX, NY, and CppNoddy::Example::s.

Referenced by main().

484  {
485  std::ofstream dump;
486  dump.open( filename.c_str() );
487  dump.precision( 6 );
488  DenseVector<double> s( 2, 0.0 );
489  celt_iter e;
490  {
491  e = BLACK_ELTS.begin();
492  for ( unsigned i = 0; i < NY - 1; ++i )
493  {
494  dump << e -> get_x( s )[1] << "\n";
495  e += NX - 1;
496  }
497  }
498  dump.close();
499  }
vector_of_elts BLACK_ELTS
An STL vector of linear elements – the black mesh.
vector_of_elts::const_iterator celt_iter
double s
relative rotation rate
std::size_t NX
number of faces in the x & y directions
DenseVector< double > CppNoddy::TwoD_TVDLF_Mesh::east_diff ( elt_iter  e) const
protected

Compute a finite difference approximation of the derivative in the compass direction.

Parameters
eThe iterator to the element that we want the derivative for
Returns
The spatial derivative of the vector system

Definition at line 829 of file TwoD_TVDLF_Mesh.cpp.

References boundary_diff(), ORDER_OF_SYSTEM, and west_diff().

Referenced by calc_slopes(), EW_diff(), get_elt_iter_from_elt_iter(), and west_diff().

830  {
831  DenseVector<double> diff( ORDER_OF_SYSTEM, 0.0 );
832  std::set< int > faces( e -> get_external_faces() );
833  const int face_index( 1 );
834  if ( e -> face_is_external( face_index ) )
835  {
836  // interior difference
837  diff = west_diff( e );
838  boundary_diff( e, face_index, diff );
839  }
840  else
841  {
842  // We're not on an edge, so we can difference
843  elt_iter j( e -> get_ptrs( face_index ) );
844  diff = ( j -> get_Q_mid() - e -> get_Q_mid() )
845  / ( j -> get_x_mid()[0] - e -> get_x_mid()[0] );
846  }
847  return diff;
848  }
void boundary_diff(elt_iter e, const int &face_index, DenseVector< double > &diff) const
Given an element iterator and the local coordinate this will return zero for any components specified...
DenseVector< double > west_diff(elt_iter e) const
Compute a finite difference approximation of the derivative in the compass direction.
std::size_t ORDER_OF_SYSTEM
order of the conservative system
vector_of_elts::iterator elt_iter
DenseVector< double > CppNoddy::TwoD_TVDLF_Mesh::EW_diff ( elt_iter  e)
protected

Compute a finite difference approximation of the derivative in the compass direction.

Parameters
eThe iterator to the element that we want the derivative for
Returns
The spatial derivative of the vector system

Definition at line 941 of file TwoD_TVDLF_Mesh.cpp.

References boundary_diff(), east_diff(), ORDER_OF_SYSTEM, and west_diff().

Referenced by calc_slopes(), and get_elt_iter_from_elt_iter().

942  {
943  DenseVector<double> diff( ORDER_OF_SYSTEM, 0.0 );
944  std::set< int > faces( e -> get_external_faces() );
945  if ( e -> face_is_external( 1 ) )
946  {
947  // interior difference
948  diff = west_diff( e );
949  boundary_diff( e, 1, diff );
950  }
951  else
952  if ( e -> face_is_external( 3 ) )
953  {
954  // interior difference
955  diff = east_diff( e );
956  boundary_diff( e, 3, diff );
957  }
958  else
959  {
960  // We're not on an edge, so we can difference
961  elt_iter jE( e -> get_ptrs( 1 ) );
962  elt_iter jW( e -> get_ptrs( 3 ) );
963  diff = ( jE -> get_Q_mid() - jW -> get_Q_mid() )
964  / ( jE -> get_x_mid()[0] - jW -> get_x_mid()[0] );
965  }
966  return diff;
967  }
void boundary_diff(elt_iter e, const int &face_index, DenseVector< double > &diff) const
Given an element iterator and the local coordinate this will return zero for any components specified...
DenseVector< double > west_diff(elt_iter e) const
Compute a finite difference approximation of the derivative in the compass direction.
DenseVector< double > east_diff(elt_iter e) const
Compute a finite difference approximation of the derivative in the compass direction.
std::size_t ORDER_OF_SYSTEM
order of the conservative system
vector_of_elts::iterator elt_iter
elt_iter CppNoddy::TwoD_TVDLF_Mesh::get_elt_iter_from_elt_iter ( elt_iter  e,
std::string  target_colour,
int  corner_index 
)
inlineprotected

Given an element in the INITIAL STRUCTURED MESH, this method will return an iterator to an element in the other mesh that overlaps the corner specified by corner_index.

Parameters
eAn element iterator to the source element
target_colourThe colour of the target mesh, ie. NOT the one that iterator 'e' is in
corner_indexThe index of the corner to be considered 0,1,2,3 for SW, SE, NE, NW.

Definition at line 143 of file TwoD_TVDLF_Mesh.h.

References CppNoddy::Example::A(), BLACK_ELTS, boundary_diff(), calc_slopes(), east_diff(), EW_diff(), get_elts_from_colour(), get_number_elts_in_x(), m, maxmod(), minmod(), north_diff(), NS_diff(), NX, NY, RED_ELTS, sgn(), south_diff(), and west_diff().

Referenced by TwoD_TVDLF_Mesh().

146  {
147  // for corners SW,SE,NE,NW:
148  // black (i,j) -> red (i,j),(i+1,j),(i+1,j+1),(i,j+1)
149  // => j*Bx+i -> j*Rx+i etc
150  // red (i,j) -> black (i-1,j-1),(i,j-1),(i,j),(i-1,j)
151  // => j*Rx+i -> (j-1)*Bx+i-1 etc
152  //dimensions of the Black (Bx times By) & Red (Rx times Ry) meshes
153  //
154  vector_of_elts* target_elts( NULL );
155  int k( 0 );
156  int Bx( NX - 1 );
157  int By( NY - 1 );
158  int Rx( NX );
159  int Ry( NY );
160  //
161  if ( target_colour == "red" )
162  {
163  int offset( e - BLACK_ELTS.begin() );
164  target_elts = &RED_ELTS;
165  int i, j, l, m;
166  //std::cout << " offset = " << offset << "\n";
167  i = offset % Bx;
168  j = ( offset - i ) / Bx;
169  switch ( corner_index )
170  {
171  case 0:
172  l = i;
173  m = j;
174  break;
175  case 1:
176  l = i + 1;
177  m = j;
178  break;
179  case 2:
180  l = i + 1;
181  m = j + 1;
182  break;
183  case 3:
184  l = i;
185  m = j + 1;
186  break;
187  default:
188  l = 0;
189  m = 0;
190  assert( false );
191  }
192  // dont return outside the mesh
193  //std::cout << source_colour << " " << i << "," << j << " -> " << l << "," << m <<"\n";
194  l = std::min( l, Rx );
195  l = std::max( l, 0 );
196  m = std::min( m, Ry );
197  m = std::max( m, 0 );
198  k = m * Rx + l;
199  //std::cout << source_colour << " " << i << "," << j << " -> " << l << "," << m <<"\n";
200  //std::cout << "--\n";
201  }
202  else
203  if ( target_colour == "black" )
204  {
205  int offset( e - RED_ELTS.begin() );
206  target_elts = &BLACK_ELTS;
207  int i, j, l, m;
208  i = offset % Rx;
209  j = ( offset - i ) / Rx;
210  switch ( corner_index )
211  {
212  case 0:
213  l = i - 1;
214  m = j - 1;
215  break;
216  case 1:
217  l = i;
218  m = j - 1;
219  break;
220  case 2:
221  l = i;
222  m = j;
223  break;
224  case 3:
225  l = i - 1;
226  m = j;
227  break;
228  default:
229  l = 0;
230  m = 0;
231  assert( false );
232  }
233  // dont return outside the mesh
234  l = std::min( l, Bx );
235  l = std::max( l, 0 );
236  m = std::min( m, By );
237  m = std::max( m, 0 );
238  k = m * Bx + l;
239  }
240  else
241  {
242  // throw
243  }
244  return target_elts -> begin() + k;
245  }
vector_of_elts BLACK_ELTS
An STL vector of linear elements – the black mesh.
vector_of_elts RED_ELTS
An STL vector of linear elements – the red mesh.
std::size_t NX
number of faces in the x & y directions
std::vector< TwoD_TVDLF_Elt > vector_of_elts
iterators for the vector of elements
std::vector< TwoD_TVDLF_Elt >::iterator CppNoddy::TwoD_TVDLF_Mesh::get_elt_iter_from_x ( const DenseVector< double > &  x,
std::string  mesh_colour = "black" 
)

Given a global coordinate, return a pointer to the elt that contains that point.

Because the elts are stored in a vector, and are logically in a rectangular grid, we first hunt for the column, then the appropriate row.

Parameters
xA vector global coordinate
mesh_colourA string identifier of the mesh to be searched
Returns
A pointer to the element containing the global coordinate

Definition at line 666 of file TwoD_TVDLF_Mesh.cpp.

References get_elts_from_colour(), and get_number_elts_in_x().

Referenced by get_point_values().

667  {
668  elt_iter found_elt;
669  vector_of_elts* elts( get_elts_from_colour( mesh_colour ) );
670  std::size_t Mx( get_number_elts_in_x( mesh_colour ) );
671 
672  elt_iter e = elts -> begin();
673  while ( e != elts -> end() )
674  {
675  // local coordinates of the NE and SW corners
676  DenseVector<double> ne( 2, 1.0 );
677  DenseVector<double> sw( -ne );
678  double west = e -> get_x( sw )[ 0 ];
679  double east = e -> get_x( ne )[ 0 ];
680  if ( ( x[ 0 ] >= west ) && ( x[ 0 ] <= east ) )
681  {
682  break;
683  }
684  ++e;
685  }
686 
687  while ( true )
688  {
689  // local coordinates of the NE and SW corners
690  DenseVector<double> ne( 2, 1.0 );
691  DenseVector<double> sw( -ne );
692  double south = e -> get_x( sw )[ 1 ];
693  double north = e -> get_x( ne )[ 1 ];
694  if ( ( x[ 1 ] >= south ) && ( x[ 1 ] <= north ) )
695  {
696  break;
697  }
698  if ( e + Mx < elts -> end() )
699  {
700  e += Mx;
701  }
702  else
703  {
704  // if we are here, then we're looking for a point outside the mesh
705  std::string problem;
706  problem = "The TwoD_TVDLF_Mesh::get_elt_iter_from_x method has been called\n";
707  problem += "for a position that is outside the boundaries of the mesh.\n";
708  throw ExceptionRuntime( problem );
709  }
710  }
711  // if we get to here, then we've found the elt.
712  return e;
713  }
std::size_t get_number_elts_in_x(std::string mesh_colour)
Given a choice of black or red mesh, return the number of elements in the x-direction.
vector_of_elts::iterator elt_iter
std::vector< TwoD_TVDLF_Elt > vector_of_elts
iterators for the vector of elements
vector_of_elts * get_elts_from_colour(std::string mesh_colour)
Given a choice of black or red mesh, return a pointer to the appropriate vector of elements...
std::vector< TwoD_TVDLF_Elt > * CppNoddy::TwoD_TVDLF_Mesh::get_elts_from_colour ( std::string  mesh_colour)
protected

Given a choice of black or red mesh, return a pointer to the appropriate vector of elements.

Parameters
mesh_colourA mesh identifier (black or red)
Returns
A pointer to a std::vector of elements

Definition at line 716 of file TwoD_TVDLF_Mesh.cpp.

References BLACK_ELTS, and RED_ELTS.

Referenced by get_elt_iter_from_elt_iter(), get_elt_iter_from_x(), and integrate().

717  {
718  vector_of_elts* elts;
719  if ( mesh_colour == "black" )
720  {
721  elts = &BLACK_ELTS;
722  }
723  else
724  if ( mesh_colour == "red" )
725  {
726  elts = &RED_ELTS;
727  }
728  else
729  {
730  std::string problem;
731  problem = " The TwoD_TVDLF_Mesh object has been passed an unrecognised mesh identifier. \n";
732  problem += " valid options are 'black' or 'red'.\n";
733  throw ExceptionRuntime( problem );
734  }
735  return elts;
736  }
vector_of_elts BLACK_ELTS
An STL vector of linear elements – the black mesh.
vector_of_elts RED_ELTS
An STL vector of linear elements – the red mesh.
std::vector< TwoD_TVDLF_Elt > vector_of_elts
iterators for the vector of elements
std::size_t CppNoddy::TwoD_TVDLF_Mesh::get_number_elts_in_x ( std::string  mesh_colour)
protected

Given a choice of black or red mesh, return the number of elements in the x-direction.

Parameters
mesh_colourA mesh identifier (black or red)
Returns
The number of elts in the x-direction

Definition at line 738 of file TwoD_TVDLF_Mesh.cpp.

References NX.

Referenced by get_elt_iter_from_elt_iter(), and get_elt_iter_from_x().

739  {
740  std::size_t N;
741  if ( mesh_colour == "black" )
742  {
743  N = NX - 1;
744  }
745  else
746  if ( mesh_colour == "red" )
747  {
748  N = NX;
749  }
750  else
751  {
752  std::string problem;
753  problem = " The TwoD_TVDLF_Mesh object has been passed an unrecognised mesh identifier. \n";
754  problem += " valid options are 'black' or 'red'.\n";
755  throw ExceptionRuntime( problem );
756  }
757  return N;
758  }
std::size_t NX
number of faces in the x & y directions
DenseVector< double > CppNoddy::TwoD_TVDLF_Mesh::get_point_values ( const DenseVector< double > &  x)

Get the vector of unknowns at a point in the 2D mesh.

Parameters
xThe global coordinate at which to return the values
Returns
The vector of unknowns

Definition at line 531 of file TwoD_TVDLF_Mesh.cpp.

References get_elt_iter_from_x(), and CppNoddy::Example::s.

Referenced by main().

532  {
533  elt_iter e( get_elt_iter_from_x( x ) );
534  DenseVector<double> s( e-> get_s( x ) );
535  return e -> get_Q( s );
536  }
double s
relative rotation rate
vector_of_elts::iterator elt_iter
elt_iter get_elt_iter_from_x(const DenseVector< double > &x, std::string mesh_colour="black")
Given a global coordinate, return a pointer to the elt that contains that point.
const double & CppNoddy::TwoD_TVDLF_Mesh::get_time ( ) const

Get a const reference to the time value for the current mesh.

Returns
time The time level at which the data in the mesh applies.

Definition at line 646 of file TwoD_TVDLF_Mesh.cpp.

References MESH_TIME.

Referenced by main().

647  {
648  return MESH_TIME;
649  }
double MESH_TIME
the time level of the mesh
DenseVector< double > CppNoddy::TwoD_TVDLF_Mesh::integrate ( std::string  mesh_colour = "black")

Integrate the concentration values across the entire mesh.

Parameters
mesh_colourThe identifier of which mesh to integrate over
Returns
The vector value of the integral

Definition at line 651 of file TwoD_TVDLF_Mesh.cpp.

References get_elts_from_colour(), and ORDER_OF_SYSTEM.

652  {
653  vector_of_elts* elts( get_elts_from_colour( mesh_colour ) );
654  elt_iter e = elts -> begin();
655  DenseVector<double> I( ORDER_OF_SYSTEM, 0.0 );
656  while ( e != elts -> end() )
657  {
658  const DenseVector<double> sw( 2, -1.0 );
659  const DenseVector<double> ne( 2, 1.0 );
660  I += e -> get_int_Q( sw, ne );
661  ++e;
662  }
663  return I;
664  }
std::size_t ORDER_OF_SYSTEM
order of the conservative system
vector_of_elts::iterator elt_iter
std::vector< TwoD_TVDLF_Elt > vector_of_elts
iterators for the vector of elements
vector_of_elts * get_elts_from_colour(std::string mesh_colour)
Given a choice of black or red mesh, return a pointer to the appropriate vector of elements...
DenseVector< double > CppNoddy::TwoD_TVDLF_Mesh::maxmod ( DenseVector< double >  A,
DenseVector< double >  B 
) const
protected

A vector version of the maxmod operator.

Parameters
AA vector to compare
BA vector to compare
Returns
A component-wise maxmod vector, i.e., each component of the returned vector is the maxmod of the components of A & B.

Definition at line 997 of file TwoD_TVDLF_Mesh.cpp.

References CppNoddy::DenseVector< _Type >::push_back(), sgn(), and CppNoddy::DenseVector< _Type >::size().

Referenced by calc_slopes(), and get_elt_iter_from_elt_iter().

998  {
999  DenseVector<double> MM;
1000  for ( std::size_t i = 0; i < A.size(); ++i )
1001  {
1002  MM.push_back( 0.5 * ( sgn( A[i] ) + sgn( B[i] ) )
1003  * std::max( std::abs( A[i] ), std::abs( B[i] ) ) );
1004  }
1005  return MM;
1006  }
std::size_t size() const
A pass-thru definition to get the size of the vector.
Definition: DenseVector.h:365
int sgn(double a) const
Sign of a double.
DenseVector< double > CppNoddy::TwoD_TVDLF_Mesh::minmod ( DenseVector< double >  A,
DenseVector< double >  B 
) const
protected

A vector version of the minmod operator.

Parameters
AA vector to compare
BA vector to compare
Returns
A component-wise minmod vector, i.e., each component of the returned vector is the minmod of the components of A & B.

Definition at line 986 of file TwoD_TVDLF_Mesh.cpp.

References CppNoddy::DenseVector< _Type >::push_back(), sgn(), and CppNoddy::DenseVector< _Type >::size().

Referenced by calc_slopes(), and get_elt_iter_from_elt_iter().

987  {
988  DenseVector<double> MM;
989  for ( std::size_t i = 0; i < A.size(); ++i )
990  {
991  MM.push_back( 0.5 * ( sgn( A[i] ) + sgn( B[i] ) )
992  * std::min( std::abs( A[i] ), std::abs( B[i] ) ) );
993  }
994  return MM;
995  }
std::size_t size() const
A pass-thru definition to get the size of the vector.
Definition: DenseVector.h:365
int sgn(double a) const
Sign of a double.
DenseVector< double > CppNoddy::TwoD_TVDLF_Mesh::north_diff ( elt_iter  e) const
protected

Compute a finite difference approximation of the derivative in the compass direction.

Parameters
eThe iterator to the element that we want the derivative for
Returns
The spatial derivative of the vector system

Definition at line 871 of file TwoD_TVDLF_Mesh.cpp.

References boundary_diff(), ORDER_OF_SYSTEM, and south_diff().

Referenced by calc_slopes(), get_elt_iter_from_elt_iter(), NS_diff(), and south_diff().

872  {
873  DenseVector<double> diff( ORDER_OF_SYSTEM, 0.0 );
874  std::set< int > faces( e -> get_external_faces() );
875  const int face_index( 2 );
876  if ( e -> face_is_external( face_index ) )
877  {
878  // interior difference
879  diff = south_diff( e );
880  boundary_diff( e, face_index, diff );
881  }
882  else
883  {
884  // We're not on an edge, so we can difference
885  elt_iter j( e -> get_ptrs( face_index ) );
886  diff = ( j -> get_Q_mid() - e -> get_Q_mid() )
887  / ( j -> get_x_mid()[1] - e -> get_x_mid()[1] );
888  }
889  return diff;
890  }
void boundary_diff(elt_iter e, const int &face_index, DenseVector< double > &diff) const
Given an element iterator and the local coordinate this will return zero for any components specified...
std::size_t ORDER_OF_SYSTEM
order of the conservative system
vector_of_elts::iterator elt_iter
DenseVector< double > south_diff(elt_iter e) const
Compute a finite difference approximation of the derivative in the compass direction.
DenseVector< double > CppNoddy::TwoD_TVDLF_Mesh::NS_diff ( elt_iter  e)
protected

Compute a finite difference approximation of the derivative in the compass direction.

Parameters
eThe iterator to the element that we want the derivative for
Returns
The spatial derivative of the vector system

Definition at line 913 of file TwoD_TVDLF_Mesh.cpp.

References boundary_diff(), north_diff(), ORDER_OF_SYSTEM, and south_diff().

Referenced by calc_slopes(), and get_elt_iter_from_elt_iter().

914  {
915  DenseVector<double> diff( ORDER_OF_SYSTEM, 0.0 );
916  std::set< int > faces( e -> get_external_faces() );
917  if ( e -> face_is_external( 0 ) )
918  {
919  // interior difference
920  diff = north_diff( e );
921  boundary_diff( e, 0, diff );
922  }
923  else
924  if ( e -> face_is_external( 2 ) )
925  {
926  // interior difference
927  diff = south_diff( e );
928  boundary_diff( e, 2, diff );
929  }
930  else
931  {
932  // We're not on an edge, so we can difference
933  elt_iter jS( e -> get_ptrs( 0 ) );
934  elt_iter jN( e -> get_ptrs( 2 ) );
935  diff = ( jN -> get_Q_mid() - jS -> get_Q_mid() )
936  / ( jN -> get_x_mid()[1] - jS -> get_x_mid()[1] );
937  }
938  return diff;
939  }
void boundary_diff(elt_iter e, const int &face_index, DenseVector< double > &diff) const
Given an element iterator and the local coordinate this will return zero for any components specified...
std::size_t ORDER_OF_SYSTEM
order of the conservative system
vector_of_elts::iterator elt_iter
DenseVector< double > north_diff(elt_iter e) const
Compute a finite difference approximation of the derivative in the compass direction.
DenseVector< double > south_diff(elt_iter e) const
Compute a finite difference approximation of the derivative in the compass direction.
void CppNoddy::TwoD_TVDLF_Mesh::set_boundary_Q ( vector_of_elts elts)
inlineprotected

Loops over all boundary elements and sets the Q values in each one to be the value specified by the edge_values method.

Parameters
eltsA vector of elements in the mesh

Definition at line 332 of file TwoD_TVDLF_Mesh.h.

References ORDER_OF_SYSTEM, and CppNoddy::Example::s.

Referenced by calc_slopes().

333  {
334  // loop over all elts
335  elt_iter e( elts -> begin() );
336  while ( e != elts -> end() )
337  {
338  // find the external elts that are on the boundary
339  if ( e -> get_external_flag() )
340  {
341  std::set<int> faces( e -> get_external_faces() );
342  std::set<int>::iterator i( faces.begin() );
343  // loop through all external faces (there are 2 on corner elts)
344  while ( i != faces.end() )
345  {
346  int face( *i );
347  // local coordinate at which to impose the BC
348  DenseVector<double> s( 2, 0.0 );
349  switch ( face )
350  {
351  case 0:
352  s[ 0 ] = 0.0;
353  s[ 1 ] = -1.0;
354  break;
355  case 1:
356  s[ 0 ] = 1.0;
357  s[ 1 ] = 0.0;
358  break;
359  case 2:
360  s[ 0 ] = 0.0;
361  s[ 1 ] = 1.0;
362  break;
363  case 3:
364  s[ 0 ] = -1.0;
365  s[ 1 ] = 0.0;
366  break;
367  }
368  // get the current edge data
369  DenseVector<double> Qe( e -> get_Q( s ) );
370  //// initialise the normal slope vector
371  // DenseVector<double> sigma_n( ORDER_OF_SYSTEM, 0.0 );
372  // get the user specified edge values
373  std::vector<bool> inflow = e -> p_system -> edge_values( face, e -> get_x( s ), Qe ); //, sigma_n );
374  // get the mid-element nodal data
375  DenseVector<double> Qm( e -> get_Q_mid() );
376  for ( std::size_t j = 0; j < ORDER_OF_SYSTEM; ++j )
377  {
378  if ( inflow[ j ] == true )
379  {
380  // only change components that are inflow
381  Qm[ j ] = Qe[ j ];
382  }
383  }
384  e -> set_Q_mid( Qm );
385  ++i;
386  }
387  }
388  ++e;
389  }
390  }
double s
relative rotation rate
std::size_t ORDER_OF_SYSTEM
order of the conservative system
vector_of_elts::iterator elt_iter
void CppNoddy::TwoD_TVDLF_Mesh::set_limiter ( const unsigned &  id)

Set the limiter type to be applied in the slope values.

Parameters
idThe identifier of the limiter.

Definition at line 538 of file TwoD_TVDLF_Mesh.cpp.

References LIMITER.

Referenced by main().

539  {
540  LIMITER = id;
541  }
unsigned LIMITER
Slope limiter method.
int CppNoddy::TwoD_TVDLF_Mesh::sgn ( double  a) const
protected

Sign of a double.

Parameters
aThe value to return the sign of
Returns
The sign of the value

Definition at line 969 of file TwoD_TVDLF_Mesh.cpp.

Referenced by get_elt_iter_from_elt_iter(), maxmod(), and minmod().

970  {
971  if ( a > 0.0 )
972  {
973  return 1;
974  }
975  else
976  if ( a < 0.0 )
977  {
978  return -1;
979  }
980  else
981  {
982  return 0;
983  }
984  }
DenseVector< double > CppNoddy::TwoD_TVDLF_Mesh::south_diff ( elt_iter  e) const
protected

Compute a finite difference approximation of the derivative in the compass direction.

Parameters
eThe iterator to the element that we want the derivative for
Returns
The spatial derivative of the vector system

Definition at line 892 of file TwoD_TVDLF_Mesh.cpp.

References boundary_diff(), north_diff(), and ORDER_OF_SYSTEM.

Referenced by calc_slopes(), get_elt_iter_from_elt_iter(), north_diff(), and NS_diff().

893  {
894  DenseVector<double> diff( ORDER_OF_SYSTEM, 0.0 );
895  std::set< int > faces( e -> get_external_faces() );
896  const int face_index( 0 );
897  if ( e -> face_is_external( face_index ) )
898  {
899  // interior difference
900  diff = north_diff( e );
901  boundary_diff( e, face_index, diff );
902  }
903  else
904  {
905  // We're not on an edge, so we can difference
906  elt_iter j( e -> get_ptrs( face_index ) );
907  diff = ( e -> get_Q_mid() - j -> get_Q_mid() )
908  / ( e -> get_x_mid()[1] - j -> get_x_mid()[1] );
909  }
910  return diff;
911  }
void boundary_diff(elt_iter e, const int &face_index, DenseVector< double > &diff) const
Given an element iterator and the local coordinate this will return zero for any components specified...
std::size_t ORDER_OF_SYSTEM
order of the conservative system
vector_of_elts::iterator elt_iter
DenseVector< double > north_diff(elt_iter e) const
Compute a finite difference approximation of the derivative in the compass direction.
double CppNoddy::TwoD_TVDLF_Mesh::update ( const double &  CFL,
const double &  max_dt = std::numeric_limits<long double>::max() 
)

Update the mesh object.

A time step is chosen based upon the CFL constraint.

Parameters
CFLThe CFL constraint for the timestep (e.g. 0.49)
max_dtA maximum timestep to be taken irrespective of the CFL value
Returns
The total timestep that was taken

Definition at line 543 of file TwoD_TVDLF_Mesh.cpp.

References actions_before_time_step1(), actions_before_time_step2(), BLACK_ELTS, calc_slopes(), MESH_TIME, and RED_ELTS.

Referenced by main(), and update_to().

544  {
545  // integrate the black mesh data onto the red mesh
546  {
547  elt_iter e = RED_ELTS.begin();
548  while ( e != RED_ELTS.end() )
549  {
550  e -> set_Q_mid( e -> contributed_Q() / e -> get_dA() );
551  ++e;
552  }
553  }
554  calc_slopes( &RED_ELTS );
555 
556  // determine the first time step from the CFL constraint
557  double first_dt;
558  {
559  elt_iter e = BLACK_ELTS.begin();
560  first_dt = e -> get_max_dt();
561  ++e;
562  while ( e != BLACK_ELTS.end() )
563  {
564  first_dt = std::min( first_dt, e -> get_max_dt() );
565  ++e;
566  }
567  first_dt *= CFL;
568  }
569  if ( first_dt > max_dt / 2 )
570  {
571  first_dt = max_dt / 2;
572  }
573 
574  actions_before_time_step1( first_dt );
575  // do the time step
576  {
577  elt_iter e = RED_ELTS.begin();
578  while ( e != RED_ELTS.end() )
579  {
580  // add to the corrections
581  e -> add_flux_contributions( first_dt );
582  ++e;
583  }
584  }
585  calc_slopes( &RED_ELTS );
586  MESH_TIME += first_dt;
587 
588  // integrate the red mesh data onto the black mesh
589  {
590  elt_iter e = BLACK_ELTS.begin();
591  while ( e != BLACK_ELTS.end() )
592  {
593  e -> set_Q_mid( e -> contributed_Q() / e -> get_dA() );
594  ++e;
595  }
596  }
598 
599  // determine the first time step from the CFL constraint
600  double second_dt;
601  {
602  elt_iter e = RED_ELTS.begin();
603  second_dt = e -> get_max_dt();
604  ++e;
605  while ( e != RED_ELTS.end() )
606  {
607  second_dt = std::min( second_dt, e -> get_max_dt() );
608  ++e;
609  }
610  second_dt *= CFL;
611  }
612  if ( first_dt + second_dt > max_dt )
613  {
614  second_dt = max_dt - first_dt;
615  }
616 
617  actions_before_time_step2( second_dt );
618  // do the time step
619  {
620  elt_iter e = BLACK_ELTS.begin();
621  while ( e != BLACK_ELTS.end() )
622  {
623  // add to the corrections
624  e -> add_flux_contributions( second_dt );
625  ++e;
626  }
627  }
629  MESH_TIME += second_dt;
630 
631  //std::cout << " currently at " << MESH_TIME << "\n";
632 
633  return first_dt + second_dt;
634  }
vector_of_elts BLACK_ELTS
An STL vector of linear elements – the black mesh.
virtual void actions_before_time_step2(const double &time_step)
A virtual method that is run before the second time update.
double MESH_TIME
the time level of the mesh
vector_of_elts::iterator elt_iter
virtual void actions_before_time_step1(const double &time_step)
A virtual method that is run before the first time update.
void calc_slopes(vector_of_elts *elt_vector)
Use the appropriate limiter to approximate the slope in each element in the mesh. ...
vector_of_elts RED_ELTS
An STL vector of linear elements – the red mesh.
void CppNoddy::TwoD_TVDLF_Mesh::update_to ( const double &  CFL,
const double &  t_end 
)

Update the mesh object to a set time level.

A time step is chosen based upon the CFL constraint.

Parameters
CFLThe CFL constraint for the timestep (e.g. 0.49)
t_endThe target end time.

Definition at line 636 of file TwoD_TVDLF_Mesh.cpp.

References MESH_TIME, and update().

637  {
638  do
639  {
640  std::cout << " computing to " << t_end << "\n";
641  update( CFL, std::abs( t_end - MESH_TIME ) );
642  }
643  while ( MESH_TIME < t_end );
644  }
double update(const double &CFL, const double &max_dt=std::numeric_limits< long double >::max())
Update the mesh object.
double MESH_TIME
the time level of the mesh
DenseVector< double > CppNoddy::TwoD_TVDLF_Mesh::west_diff ( elt_iter  e) const
protected

Compute a finite difference approximation of the derivative in the compass direction.

Parameters
eThe iterator to the element that we want the derivative for
Returns
The spatial derivative of the vector system

Definition at line 850 of file TwoD_TVDLF_Mesh.cpp.

References boundary_diff(), east_diff(), and ORDER_OF_SYSTEM.

Referenced by calc_slopes(), east_diff(), EW_diff(), and get_elt_iter_from_elt_iter().

851  {
852  DenseVector<double> diff( ORDER_OF_SYSTEM, 0.0 );
853  std::set< int > faces( e -> get_external_faces() );
854  const int face_index( 3 );
855  if ( e -> face_is_external( face_index ) )
856  {
857  // interior difference
858  diff = east_diff( e );
859  boundary_diff( e, face_index, diff );
860  }
861  else
862  {
863  // We're not on an edge, so we can difference
864  elt_iter j( e -> get_ptrs( face_index ) );
865  diff = ( e -> get_Q_mid() - j -> get_Q_mid() )
866  / ( e -> get_x_mid()[0] - j -> get_x_mid()[0] );
867  }
868  return diff;
869  }
void boundary_diff(elt_iter e, const int &face_index, DenseVector< double > &diff) const
Given an element iterator and the local coordinate this will return zero for any components specified...
DenseVector< double > east_diff(elt_iter e) const
Compute a finite difference approximation of the derivative in the compass direction.
std::size_t ORDER_OF_SYSTEM
order of the conservative system
vector_of_elts::iterator elt_iter

Member Data Documentation

vector_of_elts CppNoddy::TwoD_TVDLF_Mesh::BLACK_ELTS

An STL vector of linear elements – the black mesh.

Definition at line 130 of file TwoD_TVDLF_Mesh.h.

Referenced by dump_data(), dump_gnu(), dump_nodes_x(), dump_nodes_y(), get_elt_iter_from_elt_iter(), get_elts_from_colour(), TwoD_TVDLF_Mesh(), and update().

unsigned CppNoddy::TwoD_TVDLF_Mesh::LIMITER
protected

Slope limiter method.

Definition at line 393 of file TwoD_TVDLF_Mesh.h.

Referenced by calc_slopes(), set_limiter(), and TwoD_TVDLF_Mesh().

double CppNoddy::TwoD_TVDLF_Mesh::MESH_TIME
protected

the time level of the mesh

Definition at line 399 of file TwoD_TVDLF_Mesh.h.

Referenced by get_time(), TwoD_TVDLF_Mesh(), update(), and update_to().

std::size_t CppNoddy::TwoD_TVDLF_Mesh::NX
protected

number of faces in the x & y directions

Definition at line 397 of file TwoD_TVDLF_Mesh.h.

Referenced by dump_nodes_x(), dump_nodes_y(), get_elt_iter_from_elt_iter(), get_number_elts_in_x(), and TwoD_TVDLF_Mesh().

std::size_t CppNoddy::TwoD_TVDLF_Mesh::NY
protected

Definition at line 397 of file TwoD_TVDLF_Mesh.h.

Referenced by dump_nodes_y(), get_elt_iter_from_elt_iter(), and TwoD_TVDLF_Mesh().

std::size_t CppNoddy::TwoD_TVDLF_Mesh::ORDER_OF_SYSTEM
protected
fn_ptr CppNoddy::TwoD_TVDLF_Mesh::p_Q_INIT
protected

function pointer to a funnction that defines the initial distribution

Definition at line 401 of file TwoD_TVDLF_Mesh.h.

Referenced by TwoD_TVDLF_Mesh().

vector_of_elts CppNoddy::TwoD_TVDLF_Mesh::RED_ELTS

An STL vector of linear elements – the red mesh.

Definition at line 132 of file TwoD_TVDLF_Mesh.h.

Referenced by get_elt_iter_from_elt_iter(), get_elts_from_colour(), TwoD_TVDLF_Mesh(), and update().


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

© 2012

R.E. Hewitt