Toggle navigation
Documentation
Big picture
The finite element method
The data structure
Not-so-quick guide
Optimisation
Order of action functions
Example codes and tutorials
List of example codes and tutorials
Meshing
Solvers
MPI parallel processing
Post-processing/visualisation
Other
Change log
Creating documentation
Coding conventions
Index
FAQ
Get it
Installation guide
Get code from subversion repository
Get code as tar file
Copyright
About
People
Contact/Get involved
Publications
Acknowledgements
Picture show
Go
src
meshes
quarter_pipe_mesh.template.cc
Go to the documentation of this file.
1
//LIC// ====================================================================
2
//LIC// This file forms part of oomph-lib, the object-oriented,
3
//LIC// multi-physics finite-element library, available
4
//LIC// at http://www.oomph-lib.org.
5
//LIC//
6
//LIC// Version 1.0; svn revision $LastChangedRevision$
7
//LIC//
8
//LIC// $LastChangedDate$
9
//LIC//
10
//LIC// Copyright (C) 2006-2016 Matthias Heil and Andrew Hazel
11
//LIC//
12
//LIC// This library is free software; you can redistribute it and/or
13
//LIC// modify it under the terms of the GNU Lesser General Public
14
//LIC// License as published by the Free Software Foundation; either
15
//LIC// version 2.1 of the License, or (at your option) any later version.
16
//LIC//
17
//LIC// This library is distributed in the hope that it will be useful,
18
//LIC// but WITHOUT ANY WARRANTY; without even the implied warranty of
19
//LIC// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20
//LIC// Lesser General Public License for more details.
21
//LIC//
22
//LIC// You should have received a copy of the GNU Lesser General Public
23
//LIC// License along with this library; if not, write to the Free Software
24
//LIC// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
25
//LIC// 02110-1301 USA.
26
//LIC//
27
//LIC// The authors may be contacted at oomph-lib@maths.man.ac.uk.
28
//LIC//
29
//LIC//====================================================================
30
#ifndef OOMPH_QUARTER_PIPE_MESH_TEMPLATE_CC
31
#define OOMPH_QUARTER_PIPE_MESH_TEMPLATE_CC
32
33
#include "
quarter_pipe_mesh.template.h
"
34
35
36
37
namespace
oomph
38
{
39
40
//====================================================================
41
/// Constructor: Pass number of elements in various directions,
42
/// the inner and outer radius and the length of the tube
43
//====================================================================
44
template
<
class
ELEMENT>
45
QuarterPipeMesh<ELEMENT>::QuarterPipeMesh
(
const
unsigned
&ntheta,
46
const
unsigned
&nr,
47
const
unsigned
&nz,
48
const
double
&rmin,
49
const
double
&rmax,
50
const
double
&length,
51
TimeStepper* time_stepper_pt) :
52
SimpleCubicMesh
<ELEMENT>(ntheta,nr,nz,1.0,1.0,length,time_stepper_pt)
53
{
54
55
// Mesh can only be built with 3D Qelements.
56
MeshChecker::assert_geometric_element<QElementGeometricBase,ELEMENT>(3);
57
58
//Variables declaration
59
Ntheta
=ntheta;
60
Nr
=nr;
61
Nz
=
nz
;
62
Rmin
=rmin;
63
Rmax
=rmax;
64
Length
=length;
65
66
//Build macro element-based domain
67
Domain_pt
=
new
QuarterPipeDomain
(ntheta,nr,nz,rmin,rmax,length);
68
69
// Loop over all elements
70
unsigned
nel=this->nelement();
71
for
(
unsigned
e=0;e<nel;e++)
72
{
73
// Try to cast to FiniteElement
74
FiniteElement* el_pt =
dynamic_cast<
FiniteElement*
>
(this->element_pt(e));
75
76
// Set macro element pointer
77
el_pt->set_macro_elem_pt(
Domain_pt
->macro_element_pt(e));
78
}
79
80
// Update node coordinates with macroelement coordinates,
81
// updating solid coordinates too.
82
this->node_update(
true
);
83
84
// Setup boundary coordinates on inner boundary (boundary 1)
85
unsigned
b=1;
86
unsigned
nnod=this->nboundary_node(b);
87
for
(
unsigned
j=0;j<nnod;j++)
88
{
89
// Pointer to node
90
Node* nod_pt=this->boundary_node_pt(b,j);
91
92
// Get the Eulerian coordinates
93
double
x=nod_pt->x(0);
94
double
y=nod_pt->x(1);
95
double
z=nod_pt->x(2);
96
97
// Polar angle
98
double
phi=atan2(y,x);
99
100
// Set boundary coordinates
101
Vector<double> zeta(2);
102
zeta[0]=z;
103
zeta[1]=phi;
104
nod_pt->set_coordinates_on_boundary(b,zeta);
105
}
106
this->Boundary_coordinate_exists[b]=
true
;
107
}
108
109
}
110
111
112
#endif
oomph::QuarterPipeMesh::QuarterPipeMesh
QuarterPipeMesh(const unsigned &ntheta, const unsigned &nr, const unsigned &nz, const double &rmin, const double &rmax, const double &length, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass number of elements in various directions, the inner and outer radius and the length...
Definition:
quarter_pipe_mesh.template.cc:45
oomph::SimpleCubicMesh::nz
const unsigned & nz() const
Access function for number of elements in y directions.
Definition:
simple_cubic_mesh.template.h:99
oomph::SimpleCubicMesh
Simple cubic 3D Brick mesh class.
Definition:
simple_cubic_mesh.template.h:52
oomph::QuarterPipeMesh::Domain_pt
QuarterPipeDomain * Domain_pt
Pointer to domain.
Definition:
quarter_pipe_mesh.template.h:106
quarter_pipe_mesh.template.h
oomph
Definition:
annular_domain.h:38
oomph::QuarterPipeMesh::Rmax
double Rmax
Outer radius.
Definition:
quarter_pipe_mesh.template.h:100
oomph::QuarterPipeMesh::Rmin
double Rmin
Inner radius.
Definition:
quarter_pipe_mesh.template.h:97
oomph::QuarterPipeMesh::Nz
unsigned Nz
Number of elements axial direction.
Definition:
quarter_pipe_mesh.template.h:94
oomph::QuarterPipeMesh::Nr
unsigned Nr
Number of elements radial direction.
Definition:
quarter_pipe_mesh.template.h:91
oomph::QuarterPipeDomain
Domain representing a quarter pipe.
Definition:
quarter_pipe_domain.h:46
oomph::QuarterPipeMesh::Ntheta
unsigned Ntheta
Number of elements azimuthal direction.
Definition:
quarter_pipe_mesh.template.h:88
oomph::QuarterPipeMesh::Length
double Length
Length.
Definition:
quarter_pipe_mesh.template.h:103