26#ifndef OOMPH_RECTANGLE_WITH_MOVING_CYLINDER_MESH_TEMPLATE_HEADER
27#define OOMPH_RECTANGLE_WITH_MOVING_CYLINDER_MESH_TEMPLATE_HEADER
29#ifndef OOMPH_RECTANGLE_WITH_MOVING_CYLINDER_MESH_HEADER
30#error __FILE__ should only be included from rectangle_with_moving_cylinder_mesh.h.
69 for (
unsigned i = 0;
i < 2;
i++)
114 for (
unsigned i = 0;
i < 2;
i++)
138#ifdef WARN_ABOUT_SUBTLY_CHANGED_OOMPH_INTERFACES
141 "Order of function arguments has changed ";
161 using namespace QuadTreeNames;
174 xi[0] = 3.0 *
atan(1.0);
181 xi[0] = -3.0 *
atan(1.0);
192 xi[0] = 5.0 *
atan(1.0) - 2.0 *
atan(1.0) * 0.5 * (1.0 +
s[0]);
219 xi[0] = 3.0 *
atan(1.0) - 2.0 *
atan(1.0) * 0.5 * (1.0 +
s[0]);
224 xi[0] = 3.0 *
atan(1.0);
231 xi[0] = 1.0 *
atan(1.0);
256 xi[0] = 1.0 *
atan(1.0);
263 xi[0] = -1.0 *
atan(1.0);
270 xi[0] = -
atan(1.0) + 2.0 *
atan(1.0) * 0.5 * (1.0 +
s[0]);
297 xi[0] = -3.0 *
atan(1.0) + 2.0 *
atan(1.0) * 0.5 * (1.0 +
s[0]);
306 xi[0] = -3.0 *
atan(1.0);
313 xi[0] = -1.0 *
atan(1.0);
339 xi[0] = 3.0 *
atan(1.0);
347 xi[0] = -3.0 *
atan(1.0);
355 xi[0] = 5.0 *
atan(1.0) - 2.0 *
atan(1.0) * 0.5 * (1.0 +
s[0]);
360 xi[0] = 5.0 *
atan(1.0) - 2.0 *
atan(1.0) * 0.5 * (1.0 +
s[0]);
383 xi[0] = 3.0 *
atan(1.0) - 2.0 *
atan(1.0) * 0.5 * (1.0 +
s[0]);
388 xi[0] = 3.0 *
atan(1.0) - 2.0 *
atan(1.0) * 0.5 * (1.0 +
s[0]);
393 xi[0] = 3.0 *
atan(1.0);
401 xi[0] = 1.0 *
atan(1.0);
427 xi[0] = 1.0 *
atan(1.0);
435 xi[0] = -1.0 *
atan(1.0);
443 xi[0] = -
atan(1.0) + 2.0 *
atan(1.0) * 0.5 * (1.0 +
s[0]);
448 xi[0] = -
atan(1.0) + 2.0 *
atan(1.0) * 0.5 * (1.0 +
s[0]);
471 xi[0] = -3.0 *
atan(1.0) + 2.0 *
atan(1.0) * 0.5 * (1.0 +
s[0]);
476 xi[0] = -3.0 *
atan(1.0) + 2.0 *
atan(1.0) * 0.5 * (1.0 +
s[0]);
481 xi[0] = -3.0 *
atan(1.0);
489 xi[0] = -1.0 *
atan(1.0);
511 error_stream <<
"Wrong macro element number" <<
m << std::endl;
522 const unsigned& time,
528#ifdef WARN_ABOUT_SUBTLY_CHANGED_OOMPH_INTERFACES
531 "Order of function arguments has changed between versions 0.8 and 0.85",
532 "RectangleWithHoleAndAnnularRegionDomain::macro_element_boundary(...)",
546 using namespace QuadTreeNames;
559 xi[0] = 3.0 *
atan(1.0);
566 xi[0] = -3.0 *
atan(1.0);
577 xi[0] = 5.0 *
atan(1.0) - 2.0 *
atan(1.0) * 0.5 * (1.0 +
s[0]);
604 xi[0] = 3.0 *
atan(1.0) - 2.0 *
atan(1.0) * 0.5 * (1.0 +
s[0]);
609 xi[0] = 3.0 *
atan(1.0);
616 xi[0] = 1.0 *
atan(1.0);
641 xi[0] = 1.0 *
atan(1.0);
648 xi[0] = -1.0 *
atan(1.0);
655 xi[0] = -
atan(1.0) + 2.0 *
atan(1.0) * 0.5 * (1.0 +
s[0]);
682 xi[0] = -3.0 *
atan(1.0) + 2.0 *
atan(1.0) * 0.5 * (1.0 +
s[0]);
691 xi[0] = -3.0 *
atan(1.0);
698 xi[0] = -1.0 *
atan(1.0);
724 xi[0] = 3.0 *
atan(1.0);
732 xi[0] = -3.0 *
atan(1.0);
740 xi[0] = 5.0 *
atan(1.0) - 2.0 *
atan(1.0) * 0.5 * (1.0 +
s[0]);
745 xi[0] = 5.0 *
atan(1.0) - 2.0 *
atan(1.0) * 0.5 * (1.0 +
s[0]);
768 xi[0] = 3.0 *
atan(1.0) - 2.0 *
atan(1.0) * 0.5 * (1.0 +
s[0]);
773 xi[0] = 3.0 *
atan(1.0) - 2.0 *
atan(1.0) * 0.5 * (1.0 +
s[0]);
778 xi[0] = 3.0 *
atan(1.0);
786 xi[0] = 1.0 *
atan(1.0);
812 xi[0] = 1.0 *
atan(1.0);
820 xi[0] = -1.0 *
atan(1.0);
828 xi[0] = -
atan(1.0) + 2.0 *
atan(1.0) * 0.5 * (1.0 +
s[0]);
833 xi[0] = -
atan(1.0) + 2.0 *
atan(1.0) * 0.5 * (1.0 +
s[0]);
856 xi[0] = -3.0 *
atan(1.0) + 2.0 *
atan(1.0) * 0.5 * (1.0 +
s[0]);
861 xi[0] = -3.0 *
atan(1.0) + 2.0 *
atan(1.0) * 0.5 * (1.0 +
s[0]);
866 xi[0] = -3.0 *
atan(1.0);
874 xi[0] = -1.0 *
atan(1.0);
896 error_stream <<
"Wrong macro element number" <<
m << std::endl;
915 template<
class ELEMENT>
936 unsigned nmacro_element = Domain_pt->nmacro_element();
940 for (
unsigned e = 0;
e < nmacro_element;
e++)
943 Element_pt.push_back(
new ELEMENT);
946 unsigned np =
dynamic_cast<ELEMENT*
>(finite_element_pt(
e))->
nnode_1d();
949 for (
unsigned l1 = 0;
l1 <
np;
l1++)
952 for (
unsigned l2 = 0;
l2 <
np;
l2++)
955 tmp_node_pt.push_back(finite_element_pt(
e)->construct_node(
964 Domain_pt->macro_element_pt(
e)->macro_map(
s,
r);
982 unsigned np =
dynamic_cast<ELEMENT*
>(finite_element_pt(0))->
nnode_1d();
986 for (
unsigned n = 1;
n <
np;
n++)
990 finite_element_pt(0)->node_pt((
np *
np - 1) -
n);
1001 for (
unsigned n = 0;
n <
np - 1;
n++)
1004 finite_element_pt(3)->
node_pt(
n *
np) = finite_element_pt(0)->node_pt(
n);
1015 for (
unsigned n = 1;
n <
np;
n++)
1019 finite_element_pt(1)->node_pt((
np - 1) +
n *
np);
1030 for (
unsigned n = 1;
n <
np;
n++)
1034 finite_element_pt(3)->node_pt((
np *
np - 1) -
n *
np);
1045 for (
unsigned n = 0;
n <
np - 1;
n++)
1049 finite_element_pt(4)->node_pt((
np *
np - 1) -
n);
1060 for (
unsigned n = 1;
n <
np;
n++)
1063 finite_element_pt(7)->
node_pt(
n *
np) = finite_element_pt(4)->node_pt(
n);
1074 for (
unsigned n = 0;
n <
np - 1;
n++)
1078 finite_element_pt(5)->node_pt((
n + 1) *
np - 1);
1089 for (
unsigned n = 0;
n <
np - 1;
n++)
1093 finite_element_pt(7)->node_pt((
np *
np - 1) -
n *
np);
1104 for (
unsigned n = 1;
n <
np - 1;
n++)
1108 finite_element_pt(4)->node_pt(
n *
np);
1119 for (
unsigned n = 1;
n <
np - 1;
n++)
1123 finite_element_pt(5)->node_pt(
np * (
np - 1) +
n);
1134 for (
unsigned n = 1;
n <
np - 1;
n++)
1138 finite_element_pt(6)->node_pt((
np *
np - 1) -
n *
np);
1149 for (
unsigned n = 1;
n <
np - 1;
n++)
1153 finite_element_pt(7)->node_pt((
np - 1) -
n);
1176 finite_element_pt(0)->node_pt(
np - 1);
1179 finite_element_pt(4)->node_pt(0) = finite_element_pt(0)->node_pt(
np - 1);
1182 finite_element_pt(7)->node_pt(0) = finite_element_pt(0)->node_pt(
np - 1);
1206 finite_element_pt(1)->
node_pt(0) =
1207 finite_element_pt(0)->node_pt(
np *
np - 1);
1210 finite_element_pt(4)->node_pt(
np * (
np - 1)) =
1211 finite_element_pt(0)->node_pt(
np *
np - 1);
1214 finite_element_pt(5)->node_pt(
np * (
np - 1)) =
1215 finite_element_pt(0)->node_pt(
np *
np - 1);
1240 finite_element_pt(1)->node_pt(
np - 1);
1243 finite_element_pt(5)->node_pt(
np *
np - 1) =
1244 finite_element_pt(1)->node_pt(
np - 1);
1247 finite_element_pt(6)->node_pt(
np *
np - 1) =
1248 finite_element_pt(1)->node_pt(
np - 1);
1273 finite_element_pt(2)->node_pt(0);
1276 finite_element_pt(6)->node_pt(
np - 1) = finite_element_pt(2)->node_pt(0);
1279 finite_element_pt(7)->node_pt(
np - 1) = finite_element_pt(2)->node_pt(0);
1326 for (
unsigned n = 0;
n <
np;
n++)
1330 convert_to_boundary_node(
nod_pt);
1331 add_boundary_node(3,
nod_pt);
1335 convert_to_boundary_node(
nod_pt);
1336 add_boundary_node(2,
nod_pt);
1340 convert_to_boundary_node(
nod_pt);
1341 add_boundary_node(1,
nod_pt);
1345 convert_to_boundary_node(
nod_pt);
1346 add_boundary_node(0,
nod_pt);
1350 for (
unsigned n = 0;
n <
np - 1;
n++)
1354 convert_to_boundary_node(
nod_pt);
1355 add_boundary_node(4,
nod_pt);
1359 convert_to_boundary_node(
nod_pt);
1360 add_boundary_node(4,
nod_pt);
1364 convert_to_boundary_node(
nod_pt);
1365 add_boundary_node(4,
nod_pt);
1369 convert_to_boundary_node(
nod_pt);
1370 add_boundary_node(4,
nod_pt);
1376 if (check_for_repeated_nodes())
1398 template<
class ELEMENT>
1405 const double& height,
1409 Coarse_problem =
false;
1449 TwoDimensionalPMLHelper::create_right_pml_mesh<PMLLayerElement<ELEMENT>>(
1478 TwoDimensionalPMLHelper::create_top_pml_mesh<PMLLayerElement<ELEMENT>>(
1506 TwoDimensionalPMLHelper::create_left_pml_mesh<PMLLayerElement<ELEMENT>>(
1534 TwoDimensionalPMLHelper::create_bottom_pml_mesh<PMLLayerElement<ELEMENT>>(
1603 this->Element_pt.resize(
nel);
1611 for (
unsigned e = 0;
e <
nel;
e++)
1617 for (
unsigned j = 0;
j <
nnod;
j++)
1627 for (
unsigned b = 0; b < 4; b++)
1629 unsigned nnod = Central_mesh_pt->nboundary_node(b);
1630 for (
unsigned j = 0;
j <
nnod;
j++)
1632 Node*
nod_pt = Central_mesh_pt->boundary_node_pt(b,
j);
1633 nod_pt->remove_from_boundary(b);
1639 this->set_nboundary(5);
1757 this->setup_quadtree_forest();
1760 this->setup_boundary_element_info();
1771 Central_mesh_pt->flush_element_and_node_storage();
double size() const
Calculate the size of the element (length, area, volume,...) in Eulerian computational coordinates....
unsigned nnode() const
Return the number of nodes.
Node ** Node_pt
Storage for pointers to the nodes in the element.
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
virtual unsigned nnode_1d() const
Return the number of nodes along one edge of the element Default is to return zero — must be overload...
A geometric object is an object that provides a parametrised description of its shape via the functio...
virtual void position(const Vector< double > &zeta, Vector< double > &r) const =0
Parametrised position on object at current time: r(zeta).
TimeStepper *& time_stepper_pt()
Access function for pointer to time stepper: Null if object is not time-dependent.
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
void resize(const unsigned &n_value)
Resize the number of equations.
An OomphLibError object which should be thrown when an run-time error is encountered....
An OomphLibWarning object which should be created as a temporary object to issue a warning....
Rectangular domain with circular whole DRAIG: This looks like a redefinition of the RectangleWithHole...
Vector< double > Upper_mid_left
Where the "radial" line from circle meets upper boundary on left.
void linear_interpolate(const Vector< double > &left, const Vector< double > &right, const double &s, Vector< double > &f)
Helper function to interpolate linearly between the "right" and "left" points; .
void macro_element_boundary(const double &time, const unsigned &m, const unsigned &direction, const Vector< double > &s, Vector< double > &f)
Parametrisation of macro element boundaries: f(s) is the position vector to macro-element m's boundar...
GeomObject * Cylinder_pt
Pointer to geometric object that represents the central cylinder.
void project_point_on_cylinder_to_annular_boundary(const unsigned &time, const Vector< double > &xi, Vector< double > &r)
Helper function that, given the Lagrangian coordinate, xi, (associated with a point on the cylinder),...
Vector< double > Lower_mid_left
Where the "radial" line from circle meets lower boundary on left.
Vector< double > Lower_mid_right
Where the "radial" line from circle meets lower boundary on right.
double Annular_region_radius
The radius of the outer boundary of the annular region whose inner boundary is described by Cylinder_...
Vector< double > Upper_mid_right
Where the "radial" line from circle meets upper boundary on right.
RectangleWithHoleAndAnnularRegionMesh(GeomObject *cylinder_pt, const double &annular_region_radius, const double &length, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass pointer to geometric object that represents the cylinder, the length and height of ...
RefineableQuadMeshWithMovingCylinder(GeomObject *cylinder_pt, const double &annular_region_radius, const double &length_of_central_box, const double &x_left, const double &x_right, const double &height, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor. Pass pointer to geometric object that represents the cylinder; hierher the length and he...
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
TAdvectionDiffusionReactionElement()
Constructor: Call constructors for TElement and AdvectionDiffusionReaction equations.
Base class for time-stepping schemes. Timestepper provides an approximation of the temporal derivativ...
Mesh * create_bottom_left_pml_mesh(Mesh *pml_left_mesh_pt, Mesh *pml_bottom_mesh_pt, Mesh *bulk_mesh_pt, const unsigned &left_boundary_id, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
"Constructor" for PML bottom left corner mesh, aligned with the existing PML meshes
Mesh * create_top_left_pml_mesh(Mesh *pml_left_mesh_pt, Mesh *pml_top_mesh_pt, Mesh *bulk_mesh_pt, const unsigned &left_boundary_id, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
"Constructor" for PML top left corner mesh, aligned with the existing PML meshes
Mesh * create_top_right_pml_mesh(Mesh *pml_right_mesh_pt, Mesh *pml_top_mesh_pt, Mesh *bulk_mesh_pt, const unsigned &right_boundary_id, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
"Constructor" for PML top right corner mesh, aligned with the existing PML meshes
Mesh * create_bottom_right_pml_mesh(Mesh *pml_right_mesh_pt, Mesh *pml_bottom_mesh_pt, Mesh *bulk_mesh_pt, const unsigned &right_boundary_id, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
"Constructor" for PML bottom right corner mesh, aligned with the existing PML meshes
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).