unstructured_adaptive_mesh_two_outer_boundaries.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

872 {
873  // initialise MPI
874 #ifdef OOMPH_HAS_MPI
875  MPI_Helpers::init(argc,argv);
876 #endif
877 
878  // Store command line arguments
879  CommandLineArgs::setup(argc,argv);
880 
881  // Sample point container
884 #ifdef OOMPH_HAS_CGAL
886 #endif
887 
888  // Parse command line
890 
891  // Doc what has actually been specified on the command line
893 
894  const unsigned max_adapt = 3;
895 
896  // Label for output
897  DocInfo doc_info;
898 
899  // Output directory
900  doc_info.set_directory("RESLT");
901 
902  // Only set one!
903  unsigned count=0;
905  {
906  count++;
909  }
911  {
912  count++;
915  }
916 
917 #ifdef OOMPH_HAS_CGAL
919  {
920  count++;
922  UseCGALSamplePointContainer;
923  }
924 #endif
925 
926  if (count>1)
927  {
928  std::ostringstream error_message;
929  error_message
930  << "Can only choose one of --non_ref_bin, --ref_bin or --cgal!";
931  throw OomphLibError(error_message.str(),
934  }
935 
936  // Do the problem with linear elements
937  //---------------------------------------
938  {
939  cout << std::endl << "Linear elements" << std::endl;
940  cout << "===================" << std::endl << std::endl;
941 
942  //Set up the problem
945 
946  // Solve the problem
947  problem.newton_solve(max_adapt);
948 
949  // Open trace file
950  char trace_filename[100];
951  sprintf(trace_filename,"%s/trace.dat",
952  doc_info.directory().c_str());
953 
955  ofstream trace_file;
956  trace_file.open(trace_filename);
957 
958  //Output solution
959  problem.doc_solution(doc_info, trace_file);
960 
961  //Increment counter for solutions
962  doc_info.number()++;
963 
964  // Close the trace file
965  trace_file.close();
966 
967  }
968 
969 #ifdef OOMPH_HAS_MPI
970  MPI_Helpers::finalize();
971 #endif
972 
973 }
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.