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
About
People
Contact/Get involved
Publications
Acknowledgements
Copyright
Picture show
Go
demo_drivers
axisym_solid
shell
shell.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// Copyright (C) 2006-2026 Matthias Heil and Andrew Hazel
7
// LIC//
8
// LIC// This library is free software; you can redistribute it and/or
9
// LIC// modify it under the terms of the GNU Lesser General Public
10
// LIC// License as published by the Free Software Foundation; either
11
// LIC// version 2.1 of the License, or (at your option) any later version.
12
// LIC//
13
// LIC// This library is distributed in the hope that it will be useful,
14
// LIC// but WITHOUT ANY WARRANTY; without even the implied warranty of
15
// LIC// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
// LIC// Lesser General Public License for more details.
17
// LIC//
18
// LIC// You should have received a copy of the GNU Lesser General Public
19
// LIC// License along with this library; if not, write to the Free Software
20
// LIC// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21
// LIC// 02110-1301 USA.
22
// LIC//
23
// LIC// The authors may be contacted at oomph-lib@maths.man.ac.uk.
24
// LIC//
25
// LIC//====================================================================
26
27
// Driver code for benchmark of axisym non-linear solid equations
28
// in cylindrical coordinates: Thick spherical shell with external pressure
29
// Compare against analytical solution for an incompressible material
30
31
// Generic routines
32
#include "generic.h"
33
34
// Axisymmetric non-linear solid equations in cylindrical coords
35
#include "axisym_solid.h"
36
37
// Elements used to solve an auxillary problem for benchmarking
38
#include "
benchmark_elements.h
"
39
40
// Constitutive laws
41
#include "constitutive.h"
42
43
// The mesh: annular
44
#include "meshes/annular_mesh.h"
45
// Line mesh for auxiliary 1D problem
46
#include "meshes/one_d_mesh.h"
47
48
using namespace
std;
49
using namespace
oomph
;
50
51
//=======start_namespace==========================================
52
/// Global physical variables
53
//================================================================
54
namespace
GlobalPhysicalVariables
55
{
56
// Poisson ratio - only used in the compressible case
57
// (nu = 0.5 for incompressible material)
58
double
nu
= 0.4;
59
60
// The external pressure
61
double
ext_pressure
= 0.05;
62
63
// Traction function for appyling a pressure on the outer surface
64
void
external_pressure_fct
(
const
double
& time,
65
const
Vector<double>& xi,
66
const
Vector<double>& x,
67
const
Vector<double>& n,
68
Vector<double>& traction)
69
{
70
traction[0] = -1.0 *
ext_pressure
* n[0];
71
traction[1] = -1.0 *
ext_pressure
* n[1];
72
}
73
}
// namespace GlobalPhysicalVariables
74
75
//=======start_namespace==========================================
76
/// Global simulation settings
77
//================================================================
78
namespace
GlobalSimSettings
79
{
80
// Folder for output
81
string
result_folder
=
"RESLT"
;
82
83
/// Flag for using a pressure formulation
84
bool
use_pressure_formulation
=
false
;
85
86
/// If using a pressure formulation, is the solid incompressible?
87
bool
incompressible
=
false
;
88
89
// Number of elements in radial direction
90
unsigned
n_radial
= 10;
91
92
// Number of elements in azimuthal direction
93
unsigned
n_azimuthal
= 10;
94
95
// Inner radius
96
double
a
= 1.0;
97
98
// Thickness
99
double
h
= 0.5;
100
}
// namespace GlobalSimSettings
101
102
//======================start_mesh================================
103
/// Upgrade the mesh to a solidmesh.
104
/// Quarter-annulus in quadrant r>0, z>0
105
/// ntheta - no. elements in theta direction
106
/// nr - no. elements in the radial direction
107
/// a - Inner radius of annulus
108
/// h - thickness of annulus
109
//================================================================
110
template
<
class
ELEMENT>
111
class
ElasticTwoDAnnularMesh
:
public
virtual
TwoDAnnularMesh<ELEMENT>,
112
public
virtual
SolidMesh
113
{
114
public
:
115
/// Constructor: Build mesh and copy Eulerian coords to Lagrangian
116
/// ones so that the initial configuration is the stress-free one.
117
ElasticTwoDAnnularMesh<ELEMENT>
(
118
const
unsigned
&
ntheta
,
119
const
unsigned
&
nr
,
120
const
double
& a,
121
const
double
& h,
122
TimeStepper
*
time_stepper_pt
= &
Mesh::Default_TimeStepper
)
123
:
RectangularQuadMesh<ELEMENT>
(
124
ntheta
,
nr
, 1.0, 1.0,
false
,
time_stepper_pt
),
125
TwoDAnnularMesh<ELEMENT>
(
false
,
126
0.25,
127
ntheta
,
128
nr
,
129
a,
130
h,
131
MathematicalConstants::Pi
,
132
time_stepper_pt
)
133
{
134
// Make the current configuration the undeformed one by
135
// setting the nodal Lagrangian coordinates to their current
136
// Eulerian ones
137
set_lagrangian_nodal_coordinates
();
138
}
139
};
// End mesh
140
141
//==============start_problem=========================================
142
/// Axisymmetric compression of a finite thickness shell in cylindrical
143
/// polar coordiantes
144
//====================================================================
145
template
<
class
ELEMENT>
146
class
ShellProblem
:
public
Problem
147
{
148
public
:
149
/// Constructor:
150
ShellProblem
();
151
152
/// Destructor
153
~ShellProblem
() {}
154
155
/// Doc the solution
156
void
doc_solution
();
157
158
private
:
159
/// Create the boundary elements
160
void
create_boundary_elements
();
161
162
/// Delete boundary elements and wipe the associated mesh
163
void
delete_boundary_elements
()
164
{
165
// How many surface elements are in the surface mesh
166
unsigned
n_element
=
Surface_mesh_pt
->nelement();
167
168
// Loop over the surface elements
169
for
(
unsigned
e
= 0;
e
<
n_element
;
e
++)
170
{
171
// Kill surface element
172
delete
Surface_mesh_pt
->element_pt(
e
);
173
}
174
175
// Wipe the mesh
176
Surface_mesh_pt
->flush_element_and_node_storage();
177
}
// end of delete_boundary_elements
178
179
/// Complete the problem setup (attach function/physical parameter pointers)
180
void
complete_problem_setup
();
181
182
/// Bulk mesh
183
ElasticTwoDAnnularMesh<ELEMENT>
*
Bulk_mesh_pt
;
184
185
/// Pointer to the "surface" mesh
186
Mesh
*
Surface_mesh_pt
;
187
188
/// Pointer to constitutive law
189
ConstitutiveLaw
*
Constitutive_law_pt
;
190
191
// DocInfo object
192
DocInfo
Doc_info
;
193
};
194
195
//===============start_constructor========================================
196
/// Constructor for unstructured solid problem
197
//========================================================================
198
template
<
class
ELEMENT>
199
ShellProblem<ELEMENT>::ShellProblem
()
200
{
201
// Set output directory
202
Doc_info.set_directory(
GlobalSimSettings::result_folder
);
203
204
// Initialise counter for solutions
205
Doc_info.number() = 0;
206
207
// Create the mesh: Quarter-annulus in the quadrant r>0, z>0.
208
Bulk_mesh_pt =
209
new
ElasticTwoDAnnularMesh<ELEMENT>
(
GlobalSimSettings::n_azimuthal
,
210
GlobalSimSettings::n_radial
,
211
GlobalSimSettings::a
,
212
GlobalSimSettings::h
);
213
214
// Create the "surface mesh" that will contain only the interface
215
// elements. The constructor just creates the mesh without giving
216
// it any elements, nodes, etc.
217
Surface_mesh_pt =
new
Mesh
;
218
219
// Create the boundary elements
220
create_boundary_elements();
221
222
// Add the two submeshes
223
add_sub_mesh
(Bulk_mesh_pt);
224
add_sub_mesh
(Surface_mesh_pt);
225
226
// Combine all sub-meshes into a single mesh
227
build_global_mesh
();
228
229
// Define a constitutive law from a strain energy density function.
230
// Version depends on the incompressibility flag
231
StrainEnergyFunction
*
strain_energy_function_pt
;
232
if
(
GlobalSimSettings::incompressible
)
233
{
234
strain_energy_function_pt
=
new
IncompressibleNeoHookean
();
235
}
236
else
237
{
238
strain_energy_function_pt
=
new
NeoHookean
(&
GlobalPhysicalVariables::nu
);
239
}
240
Constitutive_law_pt =
241
new
IsotropicStrainEnergyFunctionConstitutiveLaw
(
strain_energy_function_pt
);
242
243
// Complete the problem set up
244
complete_problem_setup();
245
246
// Assign eqn numbers
247
oomph_info
<<
"Number of equations: "
<<
assign_eqn_numbers
() << std::endl;
248
249
}
// end constructor
250
251
//========start_of_complete_problem_setup==================================
252
/// Assign function/parameter pointers, set boundary conditions etc.
253
//=========================================================================
254
template
<
class
ELEMENT>
255
void
ShellProblem<ELEMENT>::complete_problem_setup
()
256
{
257
// Determine number of bulk elements in mesh
258
const
unsigned
n_element_bulk
= Bulk_mesh_pt->nelement();
259
260
// Loop over the bulk elements
261
for
(
unsigned
e
= 0;
e
<
n_element_bulk
;
e
++)
262
{
263
// Upcast from GeneralisedElement to the present element
264
ELEMENT
*
el_pt
=
dynamic_cast<
ELEMENT
*
>
(Bulk_mesh_pt->element_pt(
e
));
265
266
// Set the constitutive law
267
el_pt
->constitutive_law_pt() = Constitutive_law_pt;
268
269
// Cast to element with pressure dofs
270
QAxisymmetricCylindricalPVDWithPressureElement
*
el_with_pres_pt
=
271
dynamic_cast<
QAxisymmetricCylindricalPVDWithPressureElement
*
>
(
el_pt
);
272
273
// Can set compressible/incompressible condition here
274
if
(
el_with_pres_pt
!= 0)
275
{
276
if
(
GlobalSimSettings::incompressible
)
277
{
278
el_with_pres_pt
->set_incompressible();
279
}
280
else
281
{
282
el_with_pres_pt
->set_compressible();
283
}
284
}
285
}
// End of loop over bulk elements
286
287
// Determine number of 1D interface elements in mesh
288
const
unsigned
n_interface_element
= Surface_mesh_pt->nelement();
289
290
// Loop over the interface elements
291
for
(
unsigned
e
= 0;
e
<
n_interface_element
;
e
++)
292
{
293
// Upcast from GeneralisedElement to the present element
294
AxisymmetricCylindricalSolidTractionElement<ELEMENT>
*
el_pt
=
295
dynamic_cast<
AxisymmetricCylindricalSolidTractionElement<ELEMENT>
*
>
(
296
Surface_mesh_pt->element_pt(
e
));
297
298
// Set the traction function for applying pressure
299
el_pt
->traction_fct_pt() = &
GlobalPhysicalVariables::external_pressure_fct
;
300
301
}
// End of loop over interface elements
302
303
// Set the Dirichlet boundary conditions for this problem
304
// Find number of nodes on boundary 3
305
unsigned
n_boundary_node
= Bulk_mesh_pt->nboundary_node(3);
306
// Loop over nodes on fixed boundary
307
for
(
unsigned
n
= 0;
n
<
n_boundary_node
;
n
++)
308
{
309
// Pin radial position on symmetry axis only
310
Bulk_mesh_pt->boundary_node_pt(3,
n
)->pin_position(0);
311
}
312
n_boundary_node
= Bulk_mesh_pt->nboundary_node(1);
313
// Loop over nodes on fixed boundary
314
for
(
unsigned
n
= 0;
n
<
n_boundary_node
;
n
++)
315
{
316
// Pin radial position on symmetry axis only
317
Bulk_mesh_pt->boundary_node_pt(1,
n
)->pin_position(1);
318
}
319
}
// End complete_problem_setup
320
321
//============start_of_create_boundary_elements==========================
322
/// Create boundary elements
323
//=======================================================================
324
template
<
class
ELEMENT>
325
void
ShellProblem<ELEMENT>::create_boundary_elements
()
326
{
327
// Loop over elements on boundary 2
328
unsigned
n_element
= Bulk_mesh_pt->nboundary_element(2);
329
for
(
unsigned
e
= 0;
e
<
n_element
;
e
++)
330
{
331
// Set a pointer to the bulk element we wish to our interface
332
// element to
333
ELEMENT
*
bulk_element_pt
=
334
dynamic_cast<
ELEMENT
*
>
(Bulk_mesh_pt->boundary_element_pt(2,
e
));
335
336
// Find the index of the face of element e along boundary b
337
int
face_index
= Bulk_mesh_pt->face_index_at_boundary(2,
e
);
338
339
// Create the interface element
340
AxisymmetricCylindricalSolidTractionElement<ELEMENT>
*
interface_element_pt
=
341
new
AxisymmetricCylindricalSolidTractionElement<ELEMENT>
(
bulk_element_pt
,
342
face_index
);
343
344
// Add the interface element to the surface mesh
345
this->Surface_mesh_pt->add_element_pt(
interface_element_pt
);
346
interface_element_pt
->set_boundary_number_in_bulk_mesh(2);
347
}
348
}
// end of create_boundary_elements
349
350
351
//========================================================================
352
/// Doc the solution
353
//========================================================================
354
template
<
class
ELEMENT>
355
void
ShellProblem<ELEMENT>::doc_solution
()
356
{
357
ofstream
some_file
;
358
char
filename
[100];
359
360
// Number of plot points
361
unsigned
npts
= 3;
362
363
sprintf
(
filename
,
364
"%s/bulk_soln_nu_%g_pres_%g.dat"
,
365
Doc_info.directory().c_str(),
366
GlobalPhysicalVariables::nu
,
367
GlobalPhysicalVariables::ext_pressure
);
368
some_file
.open(
filename
);
369
Bulk_mesh_pt->output(
some_file
,
npts
);
370
some_file
.close();
371
372
sprintf
(
filename
,
373
"%s/bulk_soln_nu_%g_pres_%g.vtu"
,
374
Doc_info.directory().c_str(),
375
GlobalPhysicalVariables::nu
,
376
GlobalPhysicalVariables::ext_pressure
);
377
some_file
.open(
filename
);
378
Bulk_mesh_pt->output_paraview(
some_file
,
npts
);
379
some_file
.close();
380
381
// Increment the counter
382
Doc_info.number()++;
383
}
384
385
386
//==============start_auxillary_problem===============================
387
/// Axisymmetric compression of a finite thickness shell in cylindrical
388
/// polar coordiantes
389
//====================================================================
390
class
AuxiliaryShellProblem
:
public
Problem
391
{
392
public
:
393
/// Constructor:
394
AuxiliaryShellProblem
();
395
396
/// Destructor
397
~AuxiliaryShellProblem
() {}
398
399
/// Doc the solution
400
void
doc_solution
();
401
402
/// Solve the auxiliary problem
403
void
solve_auxiliary_problem
();
404
405
private
:
406
/// Bulk mesh
407
OneDMesh<ShellBenchmarkElement<3>
>*
Bulk_mesh_pt
;
408
409
/// Pointer to the "surface" mesh
410
Mesh
*
Surface_mesh_pt
;
411
412
// DocInfo object
413
DocInfo
Doc_info
;
414
};
415
416
417
//===============start_constructor========================================
418
/// Constructor for auxiliary 1D problem
419
//========================================================================
420
AuxiliaryShellProblem::AuxiliaryShellProblem
()
421
{
422
// Set output directory
423
Doc_info
.set_directory(
GlobalSimSettings::result_folder
);
424
425
// Initialise counter for solutions
426
Doc_info
.number() = 0;
427
428
// Create the mesh: use n_radial elements to match the 2D problem
429
double
outer_coord
=
GlobalSimSettings::a
+
GlobalSimSettings::h
;
430
Bulk_mesh_pt
=
new
OneDMesh<ShellBenchmarkElement<3>
>(
431
GlobalSimSettings::n_radial
,
GlobalSimSettings::a
,
outer_coord
);
432
433
// Only complete the setup if the material is compressible. Otherwise,
434
// an analytical solution will be used.
435
if
(!
GlobalSimSettings::incompressible
)
436
{
437
// Set the Poisson ratio in each element
438
unsigned
n_el
=
Bulk_mesh_pt
->nelement();
439
for
(
unsigned
e
= 0;
e
<
n_el
;
e
++)
440
{
441
// Cast to element
442
ShellBenchmarkElement<3>
*
el_pt
=
443
dynamic_cast<
ShellBenchmarkElement<3>
*
>
(
Bulk_mesh_pt
->element_pt(
e
));
444
445
// Set the Poisson ratio
446
el_pt
->nu_pt() = &
GlobalPhysicalVariables::nu
;
447
}
448
449
// Loop over nodes and set the initial guess in each node: r=R
450
unsigned
n_node
=
Bulk_mesh_pt
->nnode();
451
for
(
unsigned
n
= 0;
n
<
n_node
;
n
++)
452
{
453
double
r
=
Bulk_mesh_pt
->node_pt(
n
)->x(0);
454
Bulk_mesh_pt
->node_pt(
n
)->set_value(0,
r
);
455
}
456
457
// Create the "surface mesh" for application of boundary pressure
458
Surface_mesh_pt
=
new
Mesh
;
459
460
// Cast to the right-most element in the mesh
461
ShellBenchmarkElement<3>
*
bulk_element_pt
=
462
dynamic_cast<
ShellBenchmarkElement<3>
*
>
(
463
Bulk_mesh_pt
->element_pt(
GlobalSimSettings::n_radial
- 1));
464
465
// Find the index of the face of element e (0) along boundary b (1)
466
int
face_index
= 1;
// Bulk_mesh_pt->face_index_at_boundary(1, 0);
467
468
// Create the interface element
469
ShellBenchmarkPressureElement
*
interface_element_pt
=
470
new
ShellBenchmarkPressureElement
(
bulk_element_pt
,
face_index
);
471
472
// Add the interface element to the surface mesh
473
this->
Surface_mesh_pt
->add_element_pt(interface_element_pt);
474
interface_element_pt
->set_boundary_number_in_bulk_mesh(1);
475
476
// Set the pressure in the element
477
interface_element_pt
->pressure_pt() =
478
&
GlobalPhysicalVariables::ext_pressure
;
479
480
// Add the two submeshes
481
add_sub_mesh
(
Bulk_mesh_pt
);
482
add_sub_mesh
(
Surface_mesh_pt
);
483
484
// Combine all sub-meshes into a single mesh
485
build_global_mesh
();
486
487
// Assign eqn numbers
488
oomph_info
<<
"Number of equations for auxiliary problem: "
489
<<
assign_eqn_numbers
() << std::endl;
490
}
491
}
// end constructor
492
493
//========================================================================
494
/// Solve the auxiliary problem
495
//========================================================================
496
void
AuxiliaryShellProblem::solve_auxiliary_problem
()
497
{
498
// If the material is incompressible, the problem can be solved
499
// analytically, but yields an algebriac equation which must still be
500
// solved numerically. This is done using a manual newton solve.
501
if
(
GlobalSimSettings::incompressible
)
502
{
503
// Storage for residual and Jacobian
504
double
residual
,
jacobian
;
505
506
// Containers for undeformed and deformed inner/outer radii.
507
Vector<double>
xi
(2),
r
(2);
508
xi
[0] =
GlobalSimSettings::a
;
509
xi
[1] =
GlobalSimSettings::a
+
GlobalSimSettings::h
;
510
511
// Set the initial guess
512
r
[0] =
xi
[0];
513
r
[1] =
xi
[1];
514
515
// Derivative of outer coord. w.r.t. inner coord.
516
double
dr1_dr0
;
517
518
// Poisson ratio in incompressible case
519
const
double
nu = 0.5;
520
521
// Residual from the initial guess
522
r
[1] =
pow
(
pow
(
r
[0], 3.0) +
pow
(
xi
[1], 3.0) -
pow
(
xi
[0], 3.0), 1.0 / 3.0);
523
residual
=
524
(1.0 / (1.0 + nu)) * (0.25 *
pow
(
xi
[0] /
r
[0], 4.0) +
xi
[0] /
r
[0] -
525
0.25 *
pow
(
xi
[1] /
r
[1], 4.0) -
xi
[1] /
r
[1]) -
526
GlobalPhysicalVariables::ext_pressure
;
527
528
// Newton iteration loop
529
while
(std::fabs(
residual
) > 1.0e-8)
530
{
531
// Calculate the Jacobian
532
dr1_dr0
=
533
pow
(
pow
(
r
[0], 3.0) +
pow
(
xi
[1], 3.0) -
pow
(
xi
[0], 3.0), -2.0 / 3.0) *
534
r
[0] *
r
[0];
535
jacobian
= (1.0 / (1.0 + nu)) *
536
(-1.0 * (
pow
(
xi
[0] /
r
[0], 4.0) +
xi
[0] /
r
[0]) /
r
[0] +
537
(
pow
(
xi
[1] /
r
[1], 4.0) +
xi
[1] /
r
[1]) *
dr1_dr0
/
r
[1]);
538
// Take a Newton step
539
r
[0] =
r
[0] -
residual
/
jacobian
;
540
541
// Calculate the new residual
542
r
[1] =
pow
(
pow
(
r
[0], 3.0) +
pow
(
xi
[1], 3.0) -
pow
(
xi
[0], 3.0), 1.0 / 3.0);
543
residual
=
544
(1 / (1.0 + nu)) * (0.25 *
pow
(
xi
[0] /
r
[0], 4.0) +
xi
[0] /
r
[0] -
545
0.25 *
pow
(
xi
[1] /
r
[1], 4.0) -
xi
[1] /
r
[1]) -
546
GlobalPhysicalVariables::ext_pressure
;
547
}
548
549
// With the solution obtained, set nodal values from the analytic solution
550
unsigned
n_node
=
Bulk_mesh_pt
->nnode();
551
for
(
unsigned
n
= 0;
n
<
n_node
;
n
++)
552
{
553
double
xi_tmp
=
Bulk_mesh_pt
->node_pt(
n
)->x(0);
554
Bulk_mesh_pt
->node_pt(
n
)->set_value(
555
0,
pow
(
pow
(
r
[0], 3.0) +
pow
(
xi_tmp
, 3.0) -
pow
(
xi
[0], 3.0), 1.0 / 3.0));
556
}
557
}
558
// Otherwise, perform a standard Newton solve using the benchmark elements.
559
else
560
{
561
newton_solve
();
562
}
563
}
564
565
//========================================================================
566
/// Doc the solution
567
//========================================================================
568
void
AuxiliaryShellProblem::doc_solution
()
569
{
570
ofstream
some_file
;
571
char
filename
[100];
572
573
// Number of plot points
574
unsigned
npts
= 3;
575
576
sprintf
(
filename
,
577
"%s/aux_soln_nu_%g_pres_%g.dat"
,
578
Doc_info
.directory().c_str(),
579
GlobalPhysicalVariables::nu
,
580
GlobalPhysicalVariables::ext_pressure
);
581
some_file
.open(
filename
);
582
Bulk_mesh_pt
->output(
some_file
,
npts
);
583
some_file
.close();
584
585
// Increment the counter
586
Doc_info
.number()++;
587
}
588
589
//===========start_main===================================================
590
/// Demonstrate how to solve an unstructured solid problem
591
//========================================================================
592
int
main
(
int
argc
,
char
*
argv
[])
593
{
594
// Store command line arguments
595
CommandLineArgs::setup
(
argc
,
argv
);
596
597
string
str_temp_solid_pressure
;
598
CommandLineArgs::specify_command_line_flag
(
599
"--use_solid_pressure"
, &
str_temp_solid_pressure
,
"Use solid pressure"
);
600
601
string
str_temp_incompressible
;
602
CommandLineArgs::specify_command_line_flag
(
603
"--incompressible"
, &
str_temp_incompressible
,
"Incompressible"
);
604
605
CommandLineArgs::specify_command_line_flag
(
606
"--poisson"
, &
GlobalPhysicalVariables::nu
,
"Poisson"
);
607
608
CommandLineArgs::specify_command_line_flag
(
609
"--pressure"
, &
GlobalPhysicalVariables::ext_pressure
,
"External pressure"
);
610
611
CommandLineArgs::parse_and_assign
();
612
CommandLineArgs::doc_specified_flags
();
613
614
istringstream
(
str_temp_solid_pressure
) >> std::boolalpha >>
615
GlobalSimSettings::use_pressure_formulation
;
616
istringstream
(
str_temp_incompressible
) >> std::boolalpha >>
617
GlobalSimSettings::incompressible
;
618
619
// If the Poisson ratio has been set to 0.5, but the
620
// use_pressure_formulation and/or incompressible flags are false, set them to
621
// true
622
if
(std::fabs(
GlobalPhysicalVariables::nu
- 0.5) < 1.0e-10 &&
623
!(
GlobalSimSettings::incompressible
&&
624
GlobalSimSettings::use_pressure_formulation
))
625
{
626
std::string
warning_message
=
627
"Inconsistency: Poisson ratio has been set to 0.5 but the \n"
628
"use_pressure_formulation and/or incompressible flags are false. \n"
629
"Setting both of these to true to proceed."
;
630
OomphLibWarning
(
631
warning_message
,
OOMPH_CURRENT_FUNCTION
,
OOMPH_EXCEPTION_LOCATION
);
632
GlobalSimSettings::use_pressure_formulation
=
true
;
633
GlobalSimSettings::incompressible
=
true
;
634
}
635
636
// If the incompressibility flag has been set, we must use the solid
637
// pressure formulation. The Poisson ratio will not be used in this case.
638
if
(
GlobalSimSettings::incompressible
&&
639
!
GlobalSimSettings::use_pressure_formulation
)
640
{
641
std::string
warning_message
=
642
"Inconsistency: The incompressibility flag is true but we are not using "
643
"\n"
644
"the solid pressure formulation. Setting use_solid_pressure to true to "
645
"proceed. \n"
;
646
OomphLibWarning
(
647
warning_message
,
OOMPH_CURRENT_FUNCTION
,
OOMPH_EXCEPTION_LOCATION
);
648
GlobalSimSettings::use_pressure_formulation
=
true
;
649
}
650
651
// Set the Poisson ratio to 0.5 if incompressibility has been specified. This
652
// is solely for the purpose of output
653
if
(
GlobalSimSettings::incompressible
)
654
{
655
GlobalPhysicalVariables::nu
= 0.5;
656
}
657
658
// End consistency checks
659
660
// Create the problem
661
if
(
GlobalSimSettings::use_pressure_formulation
)
662
{
663
// Build the problem with an additional degree of freedom for pressure
664
ShellProblem<QAxisymmetricCylindricalPVDWithPressureElement>
problem
;
665
666
problem
.newton_solve();
667
problem
.doc_solution();
668
}
669
else
670
{
671
// Standard build
672
ShellProblem<QAxisymmetricCylindricalPVDElement<3>
>
problem
;
673
674
problem
.newton_solve();
675
problem
.doc_solution();
676
}
677
678
// Build and solve the auxiliary problem
679
AuxiliaryShellProblem
aux_problem
;
680
aux_problem
.solve_auxiliary_problem();
681
aux_problem
.doc_solution();
682
}
// end main
benchmark_elements.h
AuxiliaryShellProblem
Axisymmetric compression of a finite thickness shell in cylindrical polar coordiantes.
Definition
shell.cc:391
AuxiliaryShellProblem::~AuxiliaryShellProblem
~AuxiliaryShellProblem()
Destructor.
Definition
shell.cc:397
AuxiliaryShellProblem::Surface_mesh_pt
Mesh * Surface_mesh_pt
Pointer to the "surface" mesh.
Definition
shell.cc:410
AuxiliaryShellProblem::AuxiliaryShellProblem
AuxiliaryShellProblem()
Constructor:
Definition
shell.cc:420
AuxiliaryShellProblem::Bulk_mesh_pt
OneDMesh< ShellBenchmarkElement< 3 > > * Bulk_mesh_pt
Bulk mesh.
Definition
shell.cc:407
AuxiliaryShellProblem::doc_solution
void doc_solution()
Doc the solution.
Definition
shell.cc:568
AuxiliaryShellProblem::Doc_info
DocInfo Doc_info
Definition
shell.cc:413
AuxiliaryShellProblem::solve_auxiliary_problem
void solve_auxiliary_problem()
Solve the auxiliary problem.
Definition
shell.cc:496
ElasticTwoDAnnularMesh
Upgrade the mesh to a solidmesh. Quarter-annulus in quadrant r>0, z>0 ntheta - no....
Definition
shell.cc:113
ElasticTwoDAnnularMesh::ElasticTwoDAnnularMesh
ElasticTwoDAnnularMesh(const unsigned &ntheta, const unsigned &nr, const double &a, const double &h, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Build mesh and copy Eulerian coords to Lagrangian ones so that the initial configuration...
Definition
shell.cc:117
ShellProblem
Axisymmetric compression of a finite thickness shell in cylindrical polar coordiantes.
Definition
shell.cc:147
ShellProblem::create_boundary_elements
void create_boundary_elements()
Create the boundary elements.
Definition
shell.cc:325
ShellProblem::Doc_info
DocInfo Doc_info
Definition
shell.cc:192
ShellProblem::complete_problem_setup
void complete_problem_setup()
Complete the problem setup (attach function/physical parameter pointers)
Definition
shell.cc:255
ShellProblem::Surface_mesh_pt
Mesh * Surface_mesh_pt
Pointer to the "surface" mesh.
Definition
shell.cc:186
ShellProblem::delete_boundary_elements
void delete_boundary_elements()
Delete boundary elements and wipe the associated mesh.
Definition
shell.cc:163
ShellProblem::Bulk_mesh_pt
ElasticTwoDAnnularMesh< ELEMENT > * Bulk_mesh_pt
Bulk mesh.
Definition
shell.cc:183
ShellProblem::Constitutive_law_pt
ConstitutiveLaw * Constitutive_law_pt
Pointer to constitutive law.
Definition
shell.cc:189
ShellProblem::doc_solution
void doc_solution()
Doc the solution.
Definition
shell.cc:355
ShellProblem::ShellProblem
ShellProblem()
Constructor:
Definition
shell.cc:199
ShellProblem::~ShellProblem
~ShellProblem()
Destructor.
Definition
shell.cc:153
oomph::ShellBenchmarkPressureElement
Face elements for the application of an external pressure.
Definition
benchmark_elements.h:128
GlobalPhysicalVariables
Global physical variables.
Definition
shell.cc:55
GlobalPhysicalVariables::nu
double nu
Definition
shell.cc:58
GlobalPhysicalVariables::external_pressure_fct
void external_pressure_fct(const double &time, const Vector< double > &xi, const Vector< double > &x, const Vector< double > &n, Vector< double > &traction)
Definition
shell.cc:64
GlobalPhysicalVariables::ext_pressure
double ext_pressure
Definition
shell.cc:61
GlobalSimSettings
Global simulation settings.
Definition
shell.cc:79
GlobalSimSettings::n_azimuthal
unsigned n_azimuthal
Definition
shell.cc:93
GlobalSimSettings::h
double h
Definition
shell.cc:99
GlobalSimSettings::a
double a
Definition
shell.cc:96
GlobalSimSettings::incompressible
bool incompressible
If using a pressure formulation, is the solid incompressible?
Definition
shell.cc:87
GlobalSimSettings::n_radial
unsigned n_radial
Definition
shell.cc:90
GlobalSimSettings::use_pressure_formulation
bool use_pressure_formulation
Flag for using a pressure formulation.
Definition
shell.cc:84
GlobalSimSettings::result_folder
string result_folder
Definition
shell.cc:81
oomph
Definition
benchmark_elements.cc:31
main
int main(int argc, char *argv[])
Demonstrate how to solve an unstructured solid problem.
Definition
shell.cc:592