unstructured_adaptive_mesh_two_outer_boundaries_crossed.cc File Reference
#include "generic.h"
#include "poisson.h"
#include "meshes/triangle_mesh.h"

Classes

class  PoissonProblem< ELEMENT >
 Micky mouse Poisson problem. More...
 

Namespaces

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

Functions

void TanhSolnForPoisson::get_exact_u (const Vector< double > &x, Vector< double > &u)
 Exact solution as a Vector. More...
 
void TanhSolnForPoisson::get_exact_u (const Vector< double > &x, double &u)
 Exact solution as a scalar. More...
 
void TanhSolnForPoisson::get_source (const Vector< double > &x, double &source)
 Source function to make it an exact solution. More...
 
int main (int argc, char *argv[])
 Demonstrate how to solve Poisson problem. More...
 

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)

Demonstrate how to solve Poisson problem.

Trace file to document norm of solution

999 {
1000 
1001  // initialise MPI
1002 #ifdef OOMPH_HAS_MPI
1003  MPI_Helpers::init(argc,argv);
1004 #endif
1005 
1006  // Store command line arguments
1007  CommandLineArgs::setup(argc,argv);
1008 
1009  // Sample point container
1012 #ifdef OOMPH_HAS_CGAL
1014 #endif
1015 
1016  // Parse command line
1018 
1019  // Doc what has actually been specified on the command line
1021 
1022  const unsigned max_adapt = 3;
1023 
1024  // Only set one!
1025  unsigned count=0;
1027  {
1028  count++;
1031  }
1033  {
1034  count++;
1037  }
1038 
1039 #ifdef OOMPH_HAS_CGAL
1041  {
1042  count++;
1044  UseCGALSamplePointContainer;
1045  }
1046 #endif
1047 
1048  if (count>1)
1049  {
1050  std::ostringstream error_message;
1051  error_message
1052  << "Can only choose one of --non_ref_bin, --ref_bin or --cgal!";
1053  throw OomphLibError(error_message.str(),
1056  }
1057 
1058  // Label for output
1059  DocInfo doc_info;
1060 
1061  // Output directory
1062  doc_info.set_directory("RESLT");
1063 
1064  // Do the problem with quadratic elements
1065  //---------------------------------------
1066  {
1067  cout << std::endl << "Quadratic elements" << std::endl;
1068  cout << "===================" << std::endl << std::endl;
1069 
1070  //Set up the problem
1073 
1074  // Solve the problem
1075  problem.newton_solve(max_adapt);
1076 
1077  // Open trace file
1078  char trace_filename[100];
1079  sprintf(trace_filename,"%s/trace.dat",
1080  doc_info.directory().c_str());
1081 
1083  ofstream trace_file;
1084  trace_file.open(trace_filename);
1085 
1086  //Output solution
1087  problem.doc_solution(doc_info, trace_file);
1088 
1089  //Increment counter for solutions
1090  doc_info.number()++;
1091 
1092  // Close the trace file
1093  trace_file.close();
1094 
1095  }
1096 
1097 #ifdef OOMPH_HAS_MPI
1098  MPI_Helpers::finalize();
1099 #endif
1100 
1101 }
Micky mouse Poisson problem.
Definition: HypreSolver_test.cc:81
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
unsigned & number()
Number used (e.g.) for labeling output files.
Definition: oomph_utilities.h:554
Definition: oomph_definitions.h:222
void setup(Time *time_pt)
Create all GeomObjects needed to define the cylinder and the flag.
Definition: turek_flag_non_fsi.cc:277
void get_source(const Vector< double > &x, double &source)
Source function to make it an exact solution.
Definition: extrude_with_macro_element_representation.cc:224
bool command_line_flag_has_been_set(const std::string &flag)
Definition: oomph_utilities.cc:501
void specify_command_line_flag(const std::string &command_line_flag, const std::string &doc)
Specify possible argument-free command line flag.
Definition: oomph_utilities.cc:451
void parse_and_assign(int argc, char *argv[], const bool &throw_on_unrecognised_args)
Definition: oomph_utilities.cc:760
void doc_specified_flags()
Document specified command line flags.
Definition: oomph_utilities.cc:610
unsigned Default_sample_point_container_version
Default sample point container type.
Definition: mesh_as_geometric_object.cc:58
@ UseRefineableBinArray
Definition: sample_point_parameters.h:41
@ UseNonRefineableBinArray
Definition: sample_point_parameters.h:42
#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 oomph::CommandLineArgs::command_line_flag_has_been_set(), oomph::MeshAsGeomObject_Helper::Default_sample_point_container_version, oomph::DocInfo::directory(), oomph::CommandLineArgs::doc_specified_flags(), TanhSolnForPoisson::get_source(), oomph::DocInfo::number(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::CommandLineArgs::parse_and_assign(), problem, oomph::DocInfo::set_directory(), Flag_definition::setup(), oomph::CommandLineArgs::specify_command_line_flag(), oomph::UseNonRefineableBinArray, and oomph::UseRefineableBinArray.