simple_cubic_scaffold_tet_mesh.cc
Go to the documentation of this file.
1 //LIC// ====================================================================
2 //LIC// This file forms part of oomph-lib, the object-oriented,
3 //LIC// multi-physics finite-element library, available
4 //LIC// at http://www.oomph-lib.org.
5 //LIC//
6 //LIC// Version 1.0; svn revision $LastChangedRevision$
7 //LIC//
8 //LIC// $LastChangedDate$
9 //LIC//
10 //LIC// Copyright (C) 2006-2016 Matthias Heil and Andrew Hazel
11 //LIC//
12 //LIC// This library is free software; you can redistribute it and/or
13 //LIC// modify it under the terms of the GNU Lesser General Public
14 //LIC// License as published by the Free Software Foundation; either
15 //LIC// version 2.1 of the License, or (at your option) any later version.
16 //LIC//
17 //LIC// This library is distributed in the hope that it will be useful,
18 //LIC// but WITHOUT ANY WARRANTY; without even the implied warranty of
19 //LIC// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 //LIC// Lesser General Public License for more details.
21 //LIC//
22 //LIC// You should have received a copy of the GNU Lesser General Public
23 //LIC// License along with this library; if not, write to the Free Software
24 //LIC// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
25 //LIC// 02110-1301 USA.
26 //LIC//
27 //LIC// The authors may be contacted at oomph-lib@maths.man.ac.uk.
28 //LIC//
29 //LIC//====================================================================
30 #include "Telements.h"
32 
33 
34 namespace oomph
35 {
36 
37 
38 //===========================================================
39 /// Scaffold mesh for cubic tet mesh.
40 //===========================================================
42  const unsigned &n_y,
43  const unsigned &n_z,
44  const double &l_x,
45  const double &l_y,
46  const double &l_z,
47  TimeStepper* time_stepper_pt)
48 {
49  // Storage for the pointers to the nodes
50  RankThreeTensor<Node*> vertex_node_pt(n_x+1,n_y+1,n_z+1);
51  RankThreeTensor<Node*> left_face_node_pt(n_x+1,n_y+1,n_z+1);
52  RankThreeTensor<Node*> front_face_node_pt(n_x+1,n_y+1,n_z+1);
53  RankThreeTensor<Node*> down_face_node_pt(n_x+1,n_y+1,n_z+1);
54  RankThreeTensor<Node*> central_node_pt(n_x,n_y,n_z);
55 
56  // "Lower left" corner
57  double x_0=0.0;
58  double y_0=0.0;
59  double z_0=0.0;
60 
61  // Increments
62  double dx=l_x/double(n_x);
63  double dy=l_y/double(n_y);
64  double dz=l_z/double(n_z);
65 
66  // Total number of nodes
67  unsigned nnod=
68  (n_x+1)*(n_y+1)*(n_z+1)+ // vertex nodes
69  n_x*n_y*n_z+ // central nodes
70  (n_x*n_y)*(n_z+1) + // faces
71  (n_x*n_z)*(n_y+1) +
72  (n_y*n_z)*(n_x+1);
73  Node_pt.reserve(nnod);
74 
75  // Total number of elements
76  unsigned nelem=24*n_x*n_y*n_z;
77  Element_pt.reserve(nelem);
78 
79  // Six boundaries
80  set_nboundary(6);
81 
82 
83  // Generate the vertex nodes of all cells
84  //=======================================
85  Node* node_pt;
86  for (unsigned k=0;k<n_z+1;k++)
87  {
88  for (unsigned j=0;j<n_y+1;j++)
89  {
90  for (unsigned i=0;i<n_x+1;i++)
91  {
92  //Need to work out whether to create a boundary node or not
93  if (((i<n_x+1)&&(j<n_y+1)&&(k<n_z+1)) &&
94  ((i==0) || (i==n_x) || (j==0) || (j==n_y) || (k==0) ||
95  (k==n_z)))
96  {
97  node_pt = new BoundaryNode<Node>(3,1,0);
98  }
99  else
100  {
101  node_pt=new Node(3,1,0);
102  }
103 
104  vertex_node_pt(i,j,k)=node_pt;
105 
106  // Coordinates
107  node_pt->x(0)=x_0+double(i)*dx;
108  node_pt->x(1)=y_0+double(j)*dy;
109  node_pt->x(2)=z_0+double(k)*dz;
110 
111  // Real node?
112  if ((i<n_x+1)&&(j<n_y+1)&&(k<n_z+1))
113  {
114  // Add node
115  Node_pt.push_back(node_pt);
116 
117  // Left boundary is 0
118  if (i==0)
119  {
120  add_boundary_node(0,node_pt);
121  }
122  // Right boundary is 1
123  else if (i==n_x)
124  {
125  add_boundary_node(1,node_pt);
126  }
127 
128  // Front boundary is 2
129  if (j==0)
130  {
131  add_boundary_node(2,node_pt);
132  }
133  // Back boundary is 3
134  else if (j==n_y)
135  {
136  add_boundary_node(3,node_pt);
137  }
138 
139  // Down boundary is 4
140  if (k==0)
141  {
142  add_boundary_node(4,node_pt);
143  }
144  // Up boundary is 5
145  else if (k==n_z)
146  {
147  add_boundary_node(5,node_pt);
148  }
149 
150  }
151 
152  }
153  }
154  }
155 
156 
157 
158  // Generate the face nodes of all cells
159  //=====================================
160  for (unsigned k=0;k<n_z+1;k++)
161  {
162  for (unsigned j=0;j<n_y+1;j++)
163  {
164  for (unsigned i=0;i<n_x+1;i++)
165  {
166 
167  // Node on front face of cell
168  //---------------------------
169  //Need to work out whether to create boundary node or not
170  if (((i<n_x)&&(k<n_z)) &&
171  ((j==0) || (j==n_y)))
172  {
173  node_pt = new BoundaryNode<Node>(3,1,0);
174  }
175  else
176  {
177  node_pt=new Node(3,1,0);
178  }
179  front_face_node_pt(i,j,k)=node_pt;
180 
181 
182  // Coordinates
183  node_pt->x(0)=x_0+0.5*dx+double(i)*dx;
184  node_pt->x(1)=y_0+double(j)*dy;
185  node_pt->x(2)=z_0+0.5*dz+double(k)*dz;
186 
187  // Real node?
188  if ((i<n_x)&&(k<n_z))
189  {
190  // Add node to mesh
191  Node_pt.push_back(node_pt);
192 
193  // Front boundary is 2
194  if (j==0)
195  {
196  add_boundary_node(2,node_pt);
197  }
198  // Back boundary is 3
199  else if (j==n_y)
200  {
201  add_boundary_node(3,node_pt);
202  }
203  }
204 
205  // Node on left face of cell
206  //--------------------------
207  //Work out whether to construct boundary node or not
208  if (((j<n_y)&&(k<n_z)) &&
209  ((i==0) || (i==n_x)))
210  {
211  node_pt = new BoundaryNode<Node>(3,1,0);
212  }
213  else
214  {
215  node_pt=new Node(3,1,0);
216  }
217  left_face_node_pt(i,j,k)=node_pt;
218 
219  // Coordinates
220  node_pt->x(0)=x_0+double(i)*dx;
221  node_pt->x(1)=y_0+0.5*dy+double(j)*dy;
222  node_pt->x(2)=z_0+0.5*dz+double(k)*dz;
223 
224 
225  // Real node?
226  if ((j<n_y)&&(k<n_z))
227  {
228  // Add node to mesh
229  Node_pt.push_back(node_pt);
230 
231  // Left boundary is 0
232  if (i==0)
233  {
234  add_boundary_node(0,node_pt);
235  }
236  // Right boundary is 1
237  else if (i==n_x)
238  {
239  add_boundary_node(1,node_pt);
240  }
241  }
242 
243  // Node on down face of cell
244  //--------------------------
245  if (((i<n_x)&&(j<n_y)) &&
246  ((k==0) || (k==n_z)))
247  {
248  node_pt = new BoundaryNode<Node>(3,1,0);
249  }
250  else
251  {
252  node_pt=new Node(3,1,0);
253  }
254  down_face_node_pt(i,j,k)=node_pt;
255 
256  // Coordinates
257  node_pt->x(0)=x_0+0.5*dx+double(i)*dx;
258  node_pt->x(1)=y_0+0.5*dy+double(j)*dy;
259  node_pt->x(2)=z_0+double(k)*dz;
260 
261 
262  // Real node?
263  if ((i<n_x)&&(j<n_y))
264  {
265  // Add node to mesh
266  Node_pt.push_back(node_pt);
267 
268  // Down boundary is 4
269  if (k==0)
270  {
271  add_boundary_node(4,node_pt);
272  }
273  // Up boundary is 5
274  else if (k==n_z)
275  {
276  add_boundary_node(5,node_pt);
277  }
278  }
279 
280  }
281  }
282  }
283 
284 
285  // Central nodes for all cells
286  for (unsigned k=0;k<n_z;k++)
287  {
288  for (unsigned j=0;j<n_y;j++)
289  {
290  for (unsigned i=0;i<n_x;i++)
291  {
292  node_pt=new Node(3,1,0);
293  central_node_pt(i,j,k)=node_pt;
294  Node_pt.push_back(node_pt);
295  node_pt->x(0)=x_0+0.5*dx+double(i)*dx;
296  node_pt->x(1)=y_0+0.5*dy+double(j)*dy;
297  node_pt->x(2)=z_0+0.5*dz+double(k)*dz;
298  }
299  }
300  }
301 
302 
303  // Loop over blocks and create elements
304  TElement<3,2>* el_pt=0;
305  for (unsigned k=0;k<n_z;k++)
306  {
307  for (unsigned j=0;j<n_y;j++)
308  {
309  for (unsigned i=0;i<n_x;i++)
310  {
311 
312  // FRONT FACE
313  //===========
314 
315  // Left element on front face
316  //---------------------------
317  el_pt=new TElement<3,2>;
318 
319  // LFD
320  el_pt->node_pt(0)=vertex_node_pt(i,j,k);
321 
322  // Central front face
323  el_pt->node_pt(1)=front_face_node_pt(i,j,k);
324 
325  // LFU
326  el_pt->node_pt(2)=vertex_node_pt(i,j,k+1);
327 
328  // central node
329  el_pt->node_pt(3)=central_node_pt(i,j,k);
330 
331  Element_pt.push_back(el_pt);
332 
333 
334  // Down element on front face
335  //---------------------------
336  el_pt=new TElement<3,2>;
337 
338  // LFD
339  el_pt->node_pt(0)=vertex_node_pt(i,j,k);
340 
341  // RFD
342  el_pt->node_pt(1)=vertex_node_pt(i+1,j,k);
343 
344  // Central front face
345  el_pt->node_pt(2)=front_face_node_pt(i,j,k);
346 
347  // Central node
348  el_pt->node_pt(3)=central_node_pt(i,j,k);
349 
350  Element_pt.push_back(el_pt);
351 
352 
353  // Right element on front face
354  //---------------------------
355  el_pt=new TElement<3,2>;
356 
357  // RFD
358  el_pt->node_pt(0)=vertex_node_pt(i+1,j,k);
359 
360  // RFU
361  el_pt->node_pt(1)=vertex_node_pt(i+1,j,k+1);
362 
363  // Central front face
364  el_pt->node_pt(2)=front_face_node_pt(i,j,k);
365 
366  // Central node
367  el_pt->node_pt(3)=central_node_pt(i,j,k);
368 
369  Element_pt.push_back(el_pt);
370 
371 
372  // Up element on front face
373  //---------------------------
374  el_pt=new TElement<3,2>;
375 
376  // RFU
377  el_pt->node_pt(0)=vertex_node_pt(i+1,j,k+1);
378 
379  // LFU
380  el_pt->node_pt(1)=vertex_node_pt(i,j,k+1);
381 
382  // Central front face
383  el_pt->node_pt(2)=front_face_node_pt(i,j,k);
384 
385  // Central node
386  el_pt->node_pt(3)=central_node_pt(i,j,k);
387 
388  Element_pt.push_back(el_pt);
389 
390 
391 
392 
393 
394  // RIGHT FACE
395  //===========
396 
397  // Front element on right face
398  //---------------------------
399  el_pt=new TElement<3,2>;
400 
401  // RFD
402  el_pt->node_pt(0)=vertex_node_pt(i+1,j,k);
403 
404  // Central right face
405  el_pt->node_pt(1)=left_face_node_pt(i+1,j,k);
406 
407  // RFU
408  el_pt->node_pt(2)=vertex_node_pt(i+1,j,k+1);
409 
410  // Central node
411  el_pt->node_pt(3)=central_node_pt(i,j,k);
412 
413  Element_pt.push_back(el_pt);
414 
415 
416  // Down element on right face
417  //---------------------------
418  el_pt=new TElement<3,2>;
419 
420  // RFD
421  el_pt->node_pt(0)=vertex_node_pt(i+1,j,k);
422 
423  // RBD
424  el_pt->node_pt(1)=vertex_node_pt(i+1,j+1,k);
425 
426  // Central right face
427  el_pt->node_pt(2)=left_face_node_pt(i+1,j,k);
428 
429  // central node
430  el_pt->node_pt(3)=central_node_pt(i,j,k);
431 
432  Element_pt.push_back(el_pt);
433 
434 
435  // Back element on right face
436  //---------------------------
437  el_pt=new TElement<3,2>;
438 
439  // RBD
440  el_pt->node_pt(0)=vertex_node_pt(i+1,j+1,k);
441 
442  // RBU
443  el_pt->node_pt(1)=vertex_node_pt(i+1,j+1,k+1);
444 
445  // Central right face
446  el_pt->node_pt(2)=left_face_node_pt(i+1,j,k);
447 
448  // central node
449  el_pt->node_pt(3)=central_node_pt(i,j,k);
450 
451  Element_pt.push_back(el_pt);
452 
453 
454  // Up element on right face
455  //---------------------------
456  el_pt=new TElement<3,2>;
457 
458  // RBU
459  el_pt->node_pt(0)=vertex_node_pt(i+1,j+1,k+1);
460 
461  // RFU
462  el_pt->node_pt(1)=vertex_node_pt(i+1,j,k+1);
463 
464  // Central right face
465  el_pt->node_pt(2)=left_face_node_pt(i+1,j,k);
466 
467  // Central node
468  el_pt->node_pt(3)=central_node_pt(i,j,k);
469 
470  Element_pt.push_back(el_pt);
471 
472 
473 
474 
475  // UP FACE
476  //===========
477 
478  // Front element on up face
479  //---------------------------
480  el_pt=new TElement<3,2>;
481 
482  // LFU
483  el_pt->node_pt(0)=vertex_node_pt(i,j,k+1);
484 
485  // RFU
486  el_pt->node_pt(1)=vertex_node_pt(i+1,j,k+1);
487 
488  // Central up face
489  el_pt->node_pt(2)=down_face_node_pt(i,j,k+1);
490 
491  // Central node
492  el_pt->node_pt(3)=central_node_pt(i,j,k);
493 
494  Element_pt.push_back(el_pt);
495 
496 
497  // Front element on up face
498  //---------------------------
499  el_pt=new TElement<3,2>;
500 
501  // RFU
502  el_pt->node_pt(0)=vertex_node_pt(i+1,j,k+1);
503 
504  // RBU
505  el_pt->node_pt(1)=vertex_node_pt(i+1,j+1,k+1);
506 
507  // Central up face
508  el_pt->node_pt(2)=down_face_node_pt(i,j,k+1);
509 
510  // central node
511  el_pt->node_pt(3)=central_node_pt(i,j,k);
512 
513  Element_pt.push_back(el_pt);
514 
515 
516  // Back element on up face
517  //---------------------------
518  el_pt=new TElement<3,2>;
519 
520  // RBU
521  el_pt->node_pt(0)=vertex_node_pt(i+1,j+1,k+1);
522 
523  // LBU
524  el_pt->node_pt(1)=vertex_node_pt(i,j+1,k+1);
525 
526  // Central up face
527  el_pt->node_pt(2)=down_face_node_pt(i,j,k+1);
528 
529  // central node
530  el_pt->node_pt(3)=central_node_pt(i,j,k);
531 
532  Element_pt.push_back(el_pt);
533 
534 
535  // Left element on up face
536  //---------------------------
537  el_pt=new TElement<3,2>;
538 
539 
540  // LBU
541  el_pt->node_pt(0)=vertex_node_pt(i,j+1,k+1);
542 
543  // RFU
544  el_pt->node_pt(1)=vertex_node_pt(i,j,k+1);
545 
546  // Central up face
547  el_pt->node_pt(2)=down_face_node_pt(i,j,k+1);
548 
549  // Central node
550  el_pt->node_pt(3)=central_node_pt(i,j,k);
551 
552  Element_pt.push_back(el_pt);
553 
554 
555 
556 
557  // DOWN FACE
558  //===========
559 
560  // Front element on down face
561  //---------------------------
562  el_pt=new TElement<3,2>;
563 
564  // LFD
565  el_pt->node_pt(0)=vertex_node_pt(i,j,k);
566 
567  // RFD
568  el_pt->node_pt(2)=vertex_node_pt(i+1,j,k);
569 
570  // Central down face
571  el_pt->node_pt(1)=down_face_node_pt(i,j,k);
572 
573  // Central node
574  el_pt->node_pt(3)=central_node_pt(i,j,k);
575 
576  Element_pt.push_back(el_pt);
577 
578 
579  // Front element on down face
580  //---------------------------
581  el_pt=new TElement<3,2>;
582 
583  // RFD
584  el_pt->node_pt(0)=vertex_node_pt(i+1,j,k);
585 
586  // RBD
587  el_pt->node_pt(2)=vertex_node_pt(i+1,j+1,k);
588 
589  // Central down face
590  el_pt->node_pt(1)=down_face_node_pt(i,j,k);
591 
592  // central node
593  el_pt->node_pt(3)=central_node_pt(i,j,k);
594 
595  Element_pt.push_back(el_pt);
596 
597 
598  // Back element on down face
599  //---------------------------
600  el_pt=new TElement<3,2>;
601 
602  // RBD
603  el_pt->node_pt(0)=vertex_node_pt(i+1,j+1,k);
604 
605  // LBD
606  el_pt->node_pt(2)=vertex_node_pt(i,j+1,k);
607 
608  // Central down face
609  el_pt->node_pt(1)=down_face_node_pt(i,j,k);
610 
611  // central node
612  el_pt->node_pt(3)=central_node_pt(i,j,k);
613 
614  Element_pt.push_back(el_pt);
615 
616 
617  // Left element on down face
618  //---------------------------
619  el_pt=new TElement<3,2>;
620 
621 
622  // LBD
623  el_pt->node_pt(0)=vertex_node_pt(i,j+1,k);
624 
625  // RFD
626  el_pt->node_pt(2)=vertex_node_pt(i,j,k);
627 
628  // Central down face
629  el_pt->node_pt(1)=down_face_node_pt(i,j,k);
630 
631  // Central node
632  el_pt->node_pt(3)=central_node_pt(i,j,k);
633 
634  Element_pt.push_back(el_pt);
635 
636 
637 
638  // BACK FACE
639  //===========
640 
641  // Left element on back face
642  //---------------------------
643  el_pt=new TElement<3,2>;
644 
645  // LBD
646  el_pt->node_pt(0)=vertex_node_pt(i,j+1,k);
647 
648  // Central back face
649  el_pt->node_pt(2)=front_face_node_pt(i,j+1,k);
650 
651  // LBU
652  el_pt->node_pt(1)=vertex_node_pt(i,j+1,k+1);
653 
654  // central node
655  el_pt->node_pt(3)=central_node_pt(i,j,k);
656 
657  Element_pt.push_back(el_pt);
658 
659 
660  // Down element on back face
661  //---------------------------
662  el_pt=new TElement<3,2>;
663 
664  // LBD
665  el_pt->node_pt(0)=vertex_node_pt(i,j+1,k);
666 
667  // RBD
668  el_pt->node_pt(2)=vertex_node_pt(i+1,j+1,k);
669 
670  // Central back face
671  el_pt->node_pt(1)=front_face_node_pt(i,j+1,k);
672 
673  // Central node
674  el_pt->node_pt(3)=central_node_pt(i,j,k);
675 
676  Element_pt.push_back(el_pt);
677 
678 
679  // Right element on back face
680  //---------------------------
681  el_pt=new TElement<3,2>;
682 
683  // RBD
684  el_pt->node_pt(0)=vertex_node_pt(i+1,j+1,k);
685 
686  // RBU
687  el_pt->node_pt(2)=vertex_node_pt(i+1,j+1,k+1);
688 
689  // Central back face
690  el_pt->node_pt(1)=front_face_node_pt(i,j+1,k);
691 
692  // Central node
693  el_pt->node_pt(3)=central_node_pt(i,j,k);
694 
695  Element_pt.push_back(el_pt);
696 
697 
698  // Up element on back face
699  //---------------------------
700  el_pt=new TElement<3,2>;
701 
702  // RBU
703  el_pt->node_pt(0)=vertex_node_pt(i+1,j+1,k+1);
704 
705  // LBU
706  el_pt->node_pt(2)=vertex_node_pt(i,j+1,k+1);
707 
708  // Central back face
709  el_pt->node_pt(1)=front_face_node_pt(i,j+1,k);
710 
711  // Central node
712  el_pt->node_pt(3)=central_node_pt(i,j,k);
713 
714  Element_pt.push_back(el_pt);
715 
716 
717 
718  // LEFT FACE
719  //===========
720 
721  // Front element on left face
722  //---------------------------
723  el_pt=new TElement<3,2>;
724 
725  // LFD
726  el_pt->node_pt(0)=vertex_node_pt(i,j,k);
727 
728  // Central left face
729  el_pt->node_pt(2)=left_face_node_pt(i,j,k);
730 
731  // LFU
732  el_pt->node_pt(1)=vertex_node_pt(i,j,k+1);
733 
734  // Central node
735  el_pt->node_pt(3)=central_node_pt(i,j,k);
736 
737  Element_pt.push_back(el_pt);
738 
739 
740  // Down element on left face
741  //---------------------------
742  el_pt=new TElement<3,2>;
743 
744  // LFD
745  el_pt->node_pt(0)=vertex_node_pt(i,j,k);
746 
747  // LBD
748  el_pt->node_pt(2)=vertex_node_pt(i,j+1,k);
749 
750  // Central left face
751  el_pt->node_pt(1)=left_face_node_pt(i,j,k);
752 
753  // central node
754  el_pt->node_pt(3)=central_node_pt(i,j,k);
755 
756  Element_pt.push_back(el_pt);
757 
758 
759  // Back element on left face
760  //---------------------------
761  el_pt=new TElement<3,2>;
762 
763  // LBD
764  el_pt->node_pt(0)=vertex_node_pt(i,j+1,k);
765 
766  // LBU
767  el_pt->node_pt(2)=vertex_node_pt(i,j+1,k+1);
768 
769  // Central left face
770  el_pt->node_pt(1)=left_face_node_pt(i,j,k);
771 
772  // central node
773  el_pt->node_pt(3)=central_node_pt(i,j,k);
774 
775  Element_pt.push_back(el_pt);
776 
777 
778  // Up element on left face
779  //---------------------------
780  el_pt=new TElement<3,2>;
781 
782  // LBU
783  el_pt->node_pt(0)=vertex_node_pt(i,j+1,k+1);
784 
785  // LFU
786  el_pt->node_pt(2)=vertex_node_pt(i,j,k+1);
787 
788  // Central left face
789  el_pt->node_pt(1)=left_face_node_pt(i,j,k);
790 
791  // Central node
792  el_pt->node_pt(3)=central_node_pt(i,j,k);
793 
794  Element_pt.push_back(el_pt);
795 
796  }
797  }
798  }
799 
800  if (Node_pt.size()!=nnod)
801  {
802  std::ostringstream error_stream;
803  error_stream << "Some internal error in the constructor\n"
804  << "Actual number of nodes : "
805  << Node_pt.size()
806  << "\ndoesn't match the prediction : " << nnod << std::endl;
807 
808  throw OomphLibError(
809  error_stream.str(),
810  OOMPH_CURRENT_FUNCTION,
811  OOMPH_EXCEPTION_LOCATION);
812  }
813 
814 
815  if (Element_pt.size()!=nelem)
816  {
817  std::ostringstream error_stream;
818  error_stream << "Some internal error in the constructor\n"
819  << "Actual number of elements : "
820  << Element_pt.size()
821  << "\ndoesn't match the prediction : " << nelem
822  << std::endl;
823 
824  throw OomphLibError(
825  error_stream.str(),
826  OOMPH_CURRENT_FUNCTION,
827  OOMPH_EXCEPTION_LOCATION);
828  }
829 
830 // // Deliberately switch nodes to invert elements -- test for self_test()
831 // nelem=nelement();
832 // for (unsigned e=0;e<nelem;e++)
833 // {
834 // Node* node_pt=finite_element_pt(e)->node_pt(0);
835 // finite_element_pt(e)->node_pt(0)=
836 // finite_element_pt(e)->node_pt(1);
837 // finite_element_pt(e)->node_pt(1)=node_pt;
838 // }
839 
840 }
841 
842 
843 }
Vector< Node * > Node_pt
Vector of pointers to nodes.
Definition: mesh.h:194
void add_boundary_node(const unsigned &b, Node *const &node_pt)
Add a (pointer to) a node to the b-th boundary.
Definition: mesh.cc:246
cstr elem_len * i
Definition: cfortran.h:607
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
Definition: nodes.h:852
double & x(const unsigned &i)
Return the i-th nodal coordinate.
Definition: nodes.h:995
A Rank 3 Tensor class.
Definition: matrices.h:1337
A template Class for BoundaryNodes; that is Nodes that MAY live on the boundary of a Mesh...
Definition: nodes.h:67
void set_nboundary(const unsigned &nbound)
Set the number of boundaries in the mesh.
Definition: mesh.h:505
Vector< GeneralisedElement * > Element_pt
Vector of pointers to generalised elements.
Definition: mesh.h:197
SimpleCubicScaffoldTetMesh(const unsigned &n_x, const unsigned &n_y, const unsigned &n_z, const double &l_x, const double &l_y, const double &l_z, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass number of elements and dimensions of cube.
Node *& node_pt(const unsigned long &n)
Return pointer to global node n.
Definition: mesh.h:456
Base class for time-stepping schemes. Timestepper provides an approximation of the temporal derivativ...
Definition: timesteppers.h:219