40#include "meshes/simple_rectangular_quadmesh.h"
57template<
class ELEMENT>
59 public virtual SimpleRectangularQuadMesh<ELEMENT>,
60 public RefineableQuadMesh<ELEMENT>
70 const double &Lx,
const double &Ly,
71 TimeStepper* time_stepper_pt=
72 &Mesh::Default_TimeStepper) :
73 SimpleRectangularQuadMesh<ELEMENT>(Nx,Ny,Lx,Ly,time_stepper_pt)
79 this->setup_quadtree_forest();
113 (1.0-pow(tanh(-1.0+
Alpha*(
TanPhi*x[0]-x[1])),2.0))*
123 double N[2] = {1.0, 0.0};
140template<
class ELEMENT>
176 Mesh*
const &surface_mesh_pt);
202template<
class ELEMENT>
205 : Source_fct_pt(source_fct_pt)
295template<
class ELEMENT>
299 unsigned n_bound = Bulk_mesh_pt->nboundary();
308 unsigned n_node = Bulk_mesh_pt->nboundary_node(
i);
337template<
class ELEMENT>
341 delete_flux_elements(Surface_mesh_pt);
353template<
class ELEMENT>
358 create_flux_elements(1,Bulk_mesh_pt,Surface_mesh_pt);
364 set_prescribed_flux_pt();
371 cout <<
"Min/max. refinement levels in bulk mesh: "
383template<
class ELEMENT>
387 unsigned n_element=Surface_mesh_pt->nelement();
393 Surface_mesh_pt->element_pt(
e));
396 el_pt->flux_fct_pt() =
408template<
class ELEMENT>
417 cout <<
"Ultimate min/max. refinement levels in bulk mesh : "
458 cout <<
"Norm of solution: " <<
sqrt(
norm) << std::endl << std::endl;
469template<
class ELEMENT>
503template<
class ELEMENT>
554 cout <<
"\n\n\nProblem self-test ";
557 cout <<
"passed: Problem can be solved." << std::endl;
581 cout <<
"\n\nSolving for TanhSolnForPoisson::Alpha="
2D Poisson problem on rectangular domain, discretised with 2D QPoisson elements. Flux boundary condit...
void actions_after_adapt()
Actions after adapt: Rebuild the mesh of prescribed flux elements.
PoissonEquations< 2 >::PoissonSourceFctPt Source_fct_pt
Pointer to source function.
void actions_before_adapt()
Actions before adapt: Wipe the mesh of prescribed flux elements.
Mesh * Surface_mesh_pt
Pointer to the "surface" mesh.
void actions_before_newton_solve()
Update the problem specs before solve: Reset boundary conditions to the values from the exact solutio...
SimpleRefineableRectangularQuadMesh< ELEMENT > * Bulk_mesh_pt
Pointer to the "bulk" mesh.
RefineableTwoMeshFluxPoissonProblem(PoissonEquations< 2 >::PoissonSourceFctPt source_fct_pt)
Constructor: Pass pointer to source function.
~RefineableTwoMeshFluxPoissonProblem()
Destructor (empty)
void set_prescribed_flux_pt()
Set pointer to prescribed-flux function for all elements in the surface mesh.
void delete_flux_elements(Mesh *const &surface_mesh_pt)
Delete Poisson flux elements and wipe the surface mesh.
void actions_after_newton_solve()
Update the problem specs after solve (empty)
void create_flux_elements(const unsigned &b, Mesh *const &bulk_mesh_pt, Mesh *const &surface_mesh_pt)
Create Poisson flux elements on boundary b of the Mesh pointed to by bulk_mesh_pt and add them to the...
void doc_solution(DocInfo &doc_info)
Doc the solution. DocInfo object stores flags/labels for where the output gets written to.
Refineable equivalent of the SimpleRectangularQuadMesh. Refinement is performed by the QuadTree-based...
virtual ~SimpleRefineableRectangularQuadMesh()
Destructor: Empty.
SimpleRefineableRectangularQuadMesh(const unsigned &Nx, const unsigned &Ny, const double &Lx, const double &Ly, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Pass number of elements in the horizontal and vertical directions, and the corresponding dimensions....
Namespace for exact solution for Poisson equation with "sharp step".
void prescribed_flux_on_fixed_x_boundary(const Vector< double > &x, double &flux)
Flux required by the exact solution on a boundary on which x is fixed.
double TanPhi
Parameter for angle Phi of "step".
void source_function(const Vector< double > &x, double &source)
Source function required to make the solution above an exact solution.
double Alpha
Parameter for steepness of "step".
void get_exact_u(const Vector< double > &x, Vector< double > &u)
Exact solution as a Vector.
int main()
Demonstrate how to solve 2D Poisson problem with flux boundary conditions, using two meshes.