one_d_poisson_adapt.cc File Reference
#include "generic.h"
#include "poisson.h"
#include "meshes/one_d_mesh.h"

Classes

class  RefineableOneDPoissonProblem< ELEMENT >
 

Namespaces

 ArcTanSolnForPoisson
 Namespace for exact solution for Poisson equation with "sharp step".
 

Functions

void ArcTanSolnForPoisson::get_exact_u (const Vector< double > &x, Vector< double > &u)
 Exact solution as a Vector. More...
 
void ArcTanSolnForPoisson::get_source (const Vector< double > &x, double &source)
 Source function required to make the solution above an exact solution. More...
 
int main ()
 Driver code for 1D Poisson problem. More...
 

Variables

double ArcTanSolnForPoisson::Alpha =100.0
 Parameter for steepness of "step". More...
 

Function Documentation

◆ main()

int main ( )

Driver code for 1D Poisson problem.

273 {
274 
275  //Set up the problem
276  //------------------
277 
278  // Create the problem with 1D three-node refineable elements from the
279  // RefineableLinePoissonElement family. Pass pointer to source function.
282 
283  // Create label for output
284  // -----------------------
285  DocInfo doc_info;
286 
287  // Set output directory
288  doc_info.set_directory("RESLT");
289 
290  // Step number
291  doc_info.number()=0;
292 
293  // Check if we're ready to go:
294  // ---------------------------
295  cout << "\n\n\nProblem self-test ";
296  if (problem.self_test()==0)
297  {
298  cout << "passed: Problem can be solved." << std::endl;
299  }
300  else
301  {
302  throw OomphLibError("Self test failed",
305  }
306 
307  // Choose a large value for the steepness of the "step"
309 
310  // Refine problem uniformly 5 times (to check automatic unrefinement)
311  for(unsigned i=0;i<4;i++) { problem.refine_uniformly(); }
312 
313  // Solve the problem, performing up to 10 adaptive refinements
314  problem.newton_solve(10);
315 
316  // Output the solution
317  problem.doc_solution(doc_info);
318 
319 } // End of main
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Definition: one_d_poisson_adapt.cc:81
Definition: oomph_utilities.h:499
void set_directory(const std::string &directory)
Definition: oomph_utilities.cc:298
unsigned & number()
Number used (e.g.) for labeling output files.
Definition: oomph_utilities.h:554
Definition: oomph_definitions.h:222
double Alpha
Parameter for steepness of "step".
Definition: one_d_poisson_adapt.cc:51
void get_source(const Vector< double > &x, double &source)
Source function required to make the solution above an exact solution.
Definition: one_d_poisson_adapt.cc:60
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86
Constructor for SteadyAxisymAdvectionDiffusion problem
Definition: steady_axisym_advection_diffusion.cc:213

References ArcTanSolnForPoisson::Alpha, ArcTanSolnForPoisson::get_source(), i, oomph::DocInfo::number(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, problem, and oomph::DocInfo::set_directory().