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
linearised_navier_stokes
linearised_navier_stokes_eigenvalue_elements.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: 1097 $
7
//LIC//
8
//LIC// $LastChangedDate: 2015-12-17 11:53:17 +0000 (Thu, 17 Dec 2015) $
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
// The element-independent guts for imposition of "constant volume"
31
// constraints in free surface/interface problems.
32
33
34
#include "
linearised_navier_stokes_eigenvalue_elements.h
"
35
36
namespace
oomph
37
{
38
39
//=====================================================================
40
/// \short Fill in the residuals for the volume constraint
41
//====================================================================
42
void
LinearisedNavierStokesEigenfunctionNormalisationElement::
43
fill_in_generic_contribution_to_residuals_normalisation
(
44
Vector<double>
&residuals)
45
{
46
//Note that this element can only be used with our linearised navier
47
//stokes elements
48
//Read part
49
{
50
const
int
local_eqn = this->
eigenvalue_local_eqn
(0);
51
if
(local_eqn >= 0)
52
{
53
residuals[local_eqn] -= (*Normalisation_pt).real();
54
}
55
}
56
//Imaginary part
57
{
58
const
int
local_eqn = this->
eigenvalue_local_eqn
(1);
59
if
(local_eqn >= 0)
60
{
61
residuals[local_eqn] -= (*Normalisation_pt).imag();
62
}
63
}
64
//Bifurcation constraint
65
const
int
local_eqn = this->
eigenvalue_local_eqn
(2);
66
if
(local_eqn >= 0)
67
{
68
residuals[local_eqn] += this->
eigenvalue
(0);
69
}
70
71
}
72
73
//===========================================================================
74
/// \short Constructor: Pass pointer to target volume. "Pressure" value that
75
/// "traded" for the volume contraint is created internally (as a Data
76
/// item with a single pressure value)
77
//===========================================================================
78
LinearisedNavierStokesEigenfunctionNormalisationElement::
79
LinearisedNavierStokesEigenfunctionNormalisationElement
(
80
std::complex<double>*
const
&normalisation_pt)
81
{
82
// Store pointer to normalisation
83
Normalisation_pt
= normalisation_pt;
84
85
// Create data, add as internal data and record the index
86
// (gets deleted automatically in destructor of GeneralisedElement)
87
External_or_internal_data_index_of_eigenvalue
=
88
add_internal_data
(
new
Data
(3));
89
90
// ...and stored the "traded pressure" value as first value
91
Index_of_eigenvalue
=0;
92
}
93
94
//======================================================================
95
/// \short Constructor: Pass pointer to target volume, pointer to Data
96
/// item whose value specified by index_of_traded_pressure represents
97
/// the "Pressure" value that "traded" for the volume contraint.
98
/// The Data is stored as external Data for this element.
99
//======================================================================
100
/* LinearisedNavierStokesEigenfunctionNormalisationElement::LinearisedNavierStokesEigenfunctionNormalisationElement(
101
double* prescribed_volume_pt,
102
Data* p_traded_data_pt,
103
const unsigned& index_of_traded_pressure)
104
{
105
// Store pointer to prescribed volume
106
Prescribed_volume_pt = prescribed_volume_pt;
107
108
// Add as external data and record the index
109
External_or_internal_data_index_of_traded_pressure=
110
add_external_data(p_traded_data_pt);
111
112
// Record that it is external data
113
Traded_pressure_stored_as_internal_data=false;
114
115
// Record index
116
Index_of_traded_pressure_value=index_of_traded_pressure;
117
} */
118
119
120
121
}
122
123
124
125
126
127
oomph::LinearisedNavierStokesEigenfunctionNormalisationElement::eigenvalue_local_eqn
int eigenvalue_local_eqn(const unsigned &i)
The local eqn number for the traded pressure.
Definition:
linearised_navier_stokes_eigenvalue_elements.h:70
linearised_navier_stokes_eigenvalue_elements.h
oomph::LinearisedNavierStokesEigenfunctionNormalisationElement::Index_of_eigenvalue
unsigned Index_of_eigenvalue
Storage for the offset index of the eigenvalue.
Definition:
linearised_navier_stokes_eigenvalue_elements.h:66
oomph
Definition:
advection_diffusion_elements.cc:33
oomph::Vector< double >
oomph::Data
A class that represents a collection of data; each Data object may contain many different individual ...
Definition:
nodes.h:89
oomph::LinearisedNavierStokesEigenfunctionNormalisationElement::Normalisation_pt
std::complex< double > * Normalisation_pt
Pointer to the desired normalisation.
Definition:
linearised_navier_stokes_eigenvalue_elements.h:60
oomph::LinearisedNavierStokesEigenfunctionNormalisationElement::fill_in_generic_contribution_to_residuals_normalisation
void fill_in_generic_contribution_to_residuals_normalisation(Vector< double > &residuals)
Fill in the residuals for the volume constraint.
Definition:
linearised_navier_stokes_eigenvalue_elements.cc:43
oomph::LinearisedNavierStokesEigenfunctionNormalisationElement::LinearisedNavierStokesEigenfunctionNormalisationElement
LinearisedNavierStokesEigenfunctionNormalisationElement(std::complex< double > *const &normalisation_pt)
Constructor: Pass pointer to target volume. "Pressure" value that "traded" for the volume contraint i...
Definition:
linearised_navier_stokes_eigenvalue_elements.cc:79
oomph::LinearisedNavierStokesEigenfunctionNormalisationElement::eigenvalue
double eigenvalue(const unsigned &i)
Return the traded pressure value.
Definition:
linearised_navier_stokes_eigenvalue_elements.h:108
oomph::LinearisedNavierStokesEigenfunctionNormalisationElement::External_or_internal_data_index_of_eigenvalue
unsigned External_or_internal_data_index_of_eigenvalue
Storage for the initial index of the eigenvalue.
Definition:
linearised_navier_stokes_eigenvalue_elements.h:63
oomph::GeneralisedElement::add_internal_data
unsigned add_internal_data(Data *const &data_pt, const bool &fd=true)
Add a (pointer to an) internal data object to the element and return the index required to obtain it ...
Definition:
elements.cc:66