doc_sparse_macro_node_update.cc File Reference
#include "generic.h"
#include "poisson.h"
#include "meshes/fish_mesh.h"
#include "circle_as_generalised_element.h"

Functions

int main ()
 Driver to document sparse MacroElement-based node update. More...
 

Function Documentation

◆ main()

int main ( )

Driver to document sparse MacroElement-based node update.

49 {
50 
51  // Shorthand for element type
53  ELEMENT;
54 
55  // Set coordinates and radius for the circle that will become the fish back
56  double x_c=0.5;
57  double y_c=-0.2;
58  double r_back=1.0;
59 
60  // Build geometric object that will become the fish back
61  ElasticallySupportedRingElement* Fish_back_pt=
62  new ElasticallySupportedRingElement(x_c,y_c,r_back);
63 
64  // Build fish mesh with geometric object that specifies the fish back
67 
68 
69 
70  // Number of plot points in each coordinate direction.
71  unsigned npts=11;
72 
73  ofstream some_file;
74  char filename[100];
75 
76  // Output initial mesh
77  unsigned count=0;
78  sprintf(filename,"RESLT/soln%i.dat",count);
79  some_file.open(filename);
80  Fish_mesh_pt->output(some_file,npts);
81  some_file.close();
82  count++;
83 
84 
85 
86  // Increment y_c
87  Fish_back_pt->y_c()+=0.2;
88 
89 
90 
91  // Adjust each node in turn and doc
92  unsigned nnod=Fish_mesh_pt->nnode();
93  for (unsigned i=0;i<nnod;i++)
94  {
95  // Update individual nodal position
96  Fish_mesh_pt->node_pt(i)->node_update();
97 
98  // Doc mesh
99  sprintf(filename,"RESLT/soln%i.dat",count);
100  some_file.open(filename);
101  Fish_mesh_pt->output(some_file,npts);
102  some_file.close();
103  count++;
104  }
105 
106 } // end of main
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Definition: circle_as_generalised_element.h:57
double & y_c()
Access function to y-coordinate of centre of circle.
Definition: circle.h:208
Definition: macro_element_node_update_element.h:265
Definition: fish_mesh.template.h:200
unsigned long nnode() const
Return number of nodes in the mesh.
Definition: mesh.h:596
void output(std::ostream &outfile)
Output for all elements.
Definition: mesh.cc:2027
Node *& node_pt(const unsigned long &n)
Return pointer to global node n.
Definition: mesh.h:436
virtual void node_update(const bool &update_all_time_levels_for_new_node=false)
Definition: nodes.h:1586
string filename
Definition: MergeRestartFiles.py:39

References MergeRestartFiles::filename, i, oomph::Mesh::nnode(), oomph::Mesh::node_pt(), oomph::Node::node_update(), oomph::Mesh::output(), and oomph::GeneralCircle::y_c().