C++ scientific code snippet

I just show a little code snippet taken from our programming environment

void solve( Sfx::Discretization* aDiscretization)
  // retrieve nodal variables
  U_h& w_Uh = aDiscretization->Uh();

  // extract component from nodal variables
  std::valarray w_valA(w_Uh.size());

  std::valarray w_valQ(w_Uh.size());

  // retrieve the spatial discretization
  GridLattice& w_Mesh1D = aDiscretization->spatialDiscretization();

  // create scalar field (shall use the boost smart pointer mechanism)
  scalarField w_A( std::string("A"),w_Mesh1D);
  scalarField w_Q( std::string("Q"),w_Mesh1D);

  // set values of the field

  // apply boundary condition
  BoundaryCondition* w_bndCnd = aDiscretization->gamma();
0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *