spine_channel.cc File Reference
#include "generic.h"
#include "navier_stokes.h"
#include "meshes/channel_spine_mesh.h"

Classes

class  SinusoidalWall
 
class  ChannelSpineFlowProblem< ELEMENT >
 

Namespaces

 Global_Physical_Variables
 Global variables.
 

Functions

int main ()
 Driver for channel flow problem with spine mesh. More...
 
void doc_sparse_node_update ()
 Create the files to illustrate the sparse node update operation. More...
 

Function Documentation

◆ doc_sparse_node_update()

void doc_sparse_node_update ( )

Create the files to illustrate the sparse node update operation.

559 {
560 
561  // Set output directory
562  DocInfo doc_info;
563  doc_info.set_directory("RESLT");
564 
565  // Setup mesh
566 
567  // # of elements in x-direction in left region
568  unsigned Nx0=1;
569  // # of elements in x-direction in centre region
570  unsigned Nx1=5;
571  // # of elements in x-direction in right region
572  unsigned Nx2=1;
573 
574  // # of elements in y-direction
575  unsigned Ny=5;
576 
577  // Domain length in x-direction in left region
578  double Lx0=0.5;
579  // Domain length in x-direction in centre region
580  double Lx1=1.0;
581  // Domain length in x-direction in right region
582  double Lx2=0.5;
583 
584  // Domain length in y-direction
585  double Ly=1.0;
586 
587  double amplitude_upper = -0.4*Ly;
588  double zeta_min=Lx0;
589  double zeta_max=Lx0+Lx1;
590  GeomObject* UpperWall =
591  new SinusoidalWall(Ly,amplitude_upper,zeta_min,zeta_max);
592 
593  // Build and assign mesh
596  Lx0,Lx1,Lx2,Ly,
597  UpperWall);
598 
599  // Update *all* nodal positions
600  mesh_pt->node_update();
601 
602  // Change the amplitude
603  dynamic_cast<SinusoidalWall*>(mesh_pt->wall_pt())->amplitude()=0.5;
604 
605  unsigned count=0;
606  ofstream some_file;
607  char filename[100];
608 
609  // Number of plot points
610  unsigned npts=5;
611 
612  // Output solution
613  sprintf(filename,"%s/mesh_update%i.dat",doc_info.directory().c_str(),
614  count);
615  count++;
616 
617  // Loop over spines in centre
618  unsigned n_node = mesh_pt->nnode();
619  for (unsigned inode=0;inode<n_node;inode++)
620  {
621  SpineNode* node_pt=dynamic_cast<SpineNode*>(
622  mesh_pt->node_pt(inode));
623  if (node_pt->node_update_fct_id()==1)
624  {
625  node_pt->node_update();
626  // Output solution
627  some_file.open(filename);
628  sprintf(filename,"%s/mesh_update%i.dat",doc_info.directory().c_str(),
629  count);
630  count++;
631  mesh_pt->output(some_file,npts);
632  some_file.close();
633  }
634  }
635 
636 }
Definition: spine_channel.cc:73
Definition: channel_spine_mesh.template.h:43
GeomObject * wall_pt()
Access function to the GeomObject for upper wall.
Definition: channel_spine_mesh.template.h:262
Definition: oomph_utilities.h:499
std::string directory() const
Output directory.
Definition: oomph_utilities.h:524
void set_directory(const std::string &directory)
Definition: oomph_utilities.cc:298
Definition: geom_objects.h:101
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
SpineNode * node_pt(const unsigned long &n)
Return a pointer to the n-th global SpineNode.
Definition: spines.h:648
void node_update(const bool &update_all_solid_nodes=false)
Definition: spines.cc:84
Definition: spines.h:328
unsigned & node_update_fct_id()
Access function to ID of node update function (within specific mesh)
Definition: spines.h:384
void node_update(const bool &update_all_time_levels_for_new_node=false)
Update function, call the update function in the Node's SpineMesh.
Definition: spines.cc:44
unsigned Ny
Definition: structured_cubic_point_source.cc:115
double Ly
Length of domain in y direction.
Definition: periodic_load.cc:58
string filename
Definition: MergeRestartFiles.py:39

References oomph::DocInfo::directory(), MergeRestartFiles::filename, Global_Parameters::Ly, oomph::Mesh::nnode(), oomph::SpineMesh::node_pt(), oomph::SpineMesh::node_update(), oomph::SpineNode::node_update(), oomph::SpineNode::node_update_fct_id(), GlobalParameters::Ny, oomph::Mesh::output(), oomph::DocInfo::set_directory(), and oomph::ChannelSpineMesh< ELEMENT >::wall_pt().

◆ main()

int main ( )

Driver for channel flow problem with spine mesh.

506 {
507 
508  // Set output directory
509  DocInfo doc_info;
510  doc_info.set_directory("RESLT");
511  doc_info.number()=0;
512 
513  // Solve problem with Taylor Hood elements
514  //---------------------------------------
515  {
516  //Build problem
518  problem;
519 
520  // Solve the problem with automatic adaptation
521  problem.newton_solve();
522 
523  //Output solution
524  problem.doc_solution(doc_info);
525  // Step number
526  doc_info.number()++;
527 
528  } // end of Taylor Hood elements
529 
530 
531  // Solve problem with Crouzeix Raviart elements
532  //--------------------------------------------
533  {
534  // Build problem
536  problem;
537 
538  // Solve the problem with automatic adaptation
539  problem.newton_solve();
540 
541  //Output solution
542  problem.doc_solution(doc_info);
543  // Step number
544  doc_info.number()++;
545 
546  } // end of Crouzeix Raviart elements
547 
548 
549 
550 } // end_of_main
Definition: simple_spine_channel.cc:459
unsigned & number()
Number used (e.g.) for labeling output files.
Definition: oomph_utilities.h:554
Constructor for SteadyAxisymAdvectionDiffusion problem
Definition: steady_axisym_advection_diffusion.cc:213

References oomph::DocInfo::number(), problem, and oomph::DocInfo::set_directory().