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