adaptive_unstructured_scattering_quad.cc File Reference
#include "math.h"
#include <complex>
#include "generic.h"
#include "helmholtz.h"
#include "meshes/quad_from_triangle_mesh.h"
#include "meshes/rectangular_quadmesh.h"
#include "oomph_crbond_bessel.h"

Classes

class  ScatteringProblem< ELEMENT >
 Problem class to compute scattering of planar wave from unit disk. More...
 

Namespaces

 GlobalParameters
 Global parameters.
 

Macros

#define ADAPTIVE
 

Functions

std::complex< doubleGlobalParameters::I (0.0, 1.0)
 Imaginary unit. More...
 
void GlobalParameters::get_exact_u (const Vector< double > &x, Vector< double > &u)
 Exact solution as a Vector. More...
 
void GlobalParameters::prescribed_incoming_flux (const Vector< double > &x, complex< double > &flux)
 
int main (int argc, char **argv)
 

Macro Definition Documentation

◆ ADAPTIVE

#define ADAPTIVE

Function Documentation

◆ main()

int main ( int argc  ,
char **  argv 
)

Solve 2D Helmholtz problem for scattering of a planar wave from a unit disk

797 {
798  // Store command line arguments
799  CommandLineArgs::setup(argc,argv);
800 
801  // Define case to be run
802  unsigned i_case=0;
804 
805  // Parse command line
807 
808  // Doc what has actually been specified on the command line
810 
811  // Now set flags accordingly
812  switch(i_case)
813  {
814  case 0:
816  break;
817 
818  case 1:
821  break;
822 
823  case 2:
826  break;
827 
828  case 3:
831  break;
832  }
833 
834 
835  //Set up the problem
836  //------------------
837 
838 #ifdef ADAPTIVE
839 
840  // Typedef the ELEMENT and MESH type
841  typedef RefineableQHelmholtzElement<2,3> ELEMENT;
843 
844 #else
845 
846  // Typedef the ELEMENT and MESH type
847  typedef QHelmholtzElement<2,3> ELEMENT;
848  typedef QuadFromTriangleMesh<ELEMENT> MESH;
849 
850 #endif
851 
852  // Set up the problem with 2D nine-node elements from the
853  // QHelmholtzElement family.
855 
856  // Create label for output
857  //------------------------
858  DocInfo doc_info;
859 
860  // Set output directory
861  doc_info.set_directory("RESLT");
862 
863 #ifdef ADAPTIVE
864 
865  // Max. number of adaptations
866  unsigned max_adapt=1;
867 
868  // Solve the problem with Newton's method, allowing
869  // up to max_adapt mesh adaptations after every solve.
870  problem.newton_solve(max_adapt);
871 
872 #else
873 
874  // Solve the problem with Newton's method
875  problem.newton_solve();
876 
877 #endif
878 
879  //Output solution
880  problem.doc_solution(doc_info);
881 
882 } //end of main
Problem class to compute scattering of planar wave from unit disk.
Definition: scattering.cc:223
Definition: oomph_utilities.h:499
void set_directory(const std::string &directory)
Definition: oomph_utilities.cc:298
Definition: helmholtz_elements.h:453
Definition: quad_from_triangle_mesh.template.h:72
Definition: refineable_helmholtz_elements.h:196
Unstructured refineable QuadFromTriangleMesh.
Definition: quad_from_triangle_mesh.template.h:578
void setup(Time *time_pt)
Create all GeomObjects needed to define the cylinder and the flag.
Definition: turek_flag_non_fsi.cc:277
unsigned ABC_order
Flag to choose wich order to use.
Definition: helmholtz_point_source.cc:68
bool DtN_BC
Definition: helmholtz_point_source.cc:64
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
Constructor for SteadyAxisymAdvectionDiffusion problem
Definition: steady_axisym_advection_diffusion.cc:213

References GlobalParameters::ABC_order, oomph::CommandLineArgs::doc_specified_flags(), GlobalParameters::DtN_BC, oomph::CommandLineArgs::parse_and_assign(), problem, oomph::DocInfo::set_directory(), oomph::CommandLineArgs::setup(), and oomph::CommandLineArgs::specify_command_line_flag().