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.h
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
// Header file for elements that allow the imposition of a "constant volume"
31
// constraint in free surface problems.
32
33
//Include guards, to prevent multiple includes
34
#ifndef LINEARISED_NAVIER_STOKES_EIGENVALUE_ELEMENTS_HEADER
35
#define LINEARISED_NAVIER_STOKES_EIGENVALUE_ELEMENTS_HEADER
36
37
38
// Config header generated by autoconfig
39
#ifdef HAVE_CONFIG_H
40
#include <oomph-lib-config.h>
41
#endif
42
43
//OOMPH-LIB headers
44
#include "../generic/elements.h"
45
46
47
namespace
oomph
48
{
49
50
//==========================================================================
51
/// A class that is used to implement the constraint that the eigenfunction
52
/// has a particular normalisation. This element stores the two components
53
/// of the eigenvalue.
54
//=========================================================================
55
class
LinearisedNavierStokesEigenfunctionNormalisationElement
:
public
GeneralisedElement
56
{
57
private
:
58
59
/// Pointer to the desired normalisation
60
std::complex<double> *
Normalisation_pt
;
61
62
///Storage for the initial index of the eigenvalue
63
unsigned
External_or_internal_data_index_of_eigenvalue
;
64
65
///Storage for the offset index of the eigenvalue
66
unsigned
Index_of_eigenvalue
;
67
68
69
/// \short The local eqn number for the traded pressure
70
inline
int
eigenvalue_local_eqn
(
const
unsigned
&
i
)
71
{
72
return
this->
internal_local_eqn
(
73
External_or_internal_data_index_of_eigenvalue,
74
Index_of_eigenvalue+i);
75
}
76
77
/// \short Fill in the residuals for the volume constraint
78
void
fill_in_generic_contribution_to_residuals_normalisation
(
79
Vector<double>
&residuals);
80
81
public
:
82
83
/// \short Constructor: Pass pointer to target volume. "Pressure" value that
84
/// "traded" for the volume contraint is created internally (as a Data
85
/// item with a single pressure value)
86
LinearisedNavierStokesEigenfunctionNormalisationElement
(
87
std::complex<double>*
const
&normalisation_pt);
88
89
/// \short 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
/*LinearisedNavierStokesEigenfunctionNormalisationElement(double* prescribed_volume_pt,
94
Data* p_traded_data_pt,
95
const unsigned& index_of_traded_pressure);*/
96
97
/// \short Empty destructor
98
~LinearisedNavierStokesEigenfunctionNormalisationElement
() {}
99
100
/// Access to Data that contains the traded pressure
101
inline
Data
*
eigenvalue_data_pt
()
102
{
103
return
internal_data_pt
(
104
External_or_internal_data_index_of_eigenvalue);
105
}
106
107
/// Return the traded pressure value
108
inline
double
eigenvalue
(
const
unsigned
&
i
)
109
{
return
eigenvalue_data_pt
()->
value
(Index_of_eigenvalue+i);}
110
111
/// Return the index of Data object at which the traded pressure is stored
112
inline
unsigned
index_of_eigenvalue
() {
return
Index_of_eigenvalue
;}
113
114
115
/// \short Fill in the residuals for the volume constraint
116
void
fill_in_contribution_to_residuals
(
Vector<double>
&residuals)
117
{
118
this->
fill_in_generic_contribution_to_residuals_normalisation
(
119
residuals);
120
}
121
122
/// \short Fill in the residuals and jacobian for the volume constraint
123
void
fill_in_contribution_to_jacobian
(
Vector<double>
&residuals,
124
DenseMatrix<double>
&jacobian)
125
{
126
//One contribution to jacobian; see comment in that function
127
this->
fill_in_generic_contribution_to_residuals_normalisation
(
128
residuals);
129
130
const
int
local_eqn = this->
eigenvalue_local_eqn
(2);
131
if
(local_eqn >= 0)
132
{
133
const
int
local_unknown = this->
eigenvalue_local_eqn
(0);
134
jacobian(local_eqn,local_unknown) += 1.0;
135
}
136
}
137
138
/// \short Fill in the residuals, jacobian and mass matrix for the volume
139
/// constraint.
140
void
fill_in_contribution_to_jacobian_and_mass_matrix
(
141
Vector<double>
&residuals,
142
DenseMatrix<double>
&jacobian,
143
DenseMatrix<double>
&mass_matrix)
144
{
145
//No contribution to jacobian or mass matrix; see comment in that function
146
this->
fill_in_generic_contribution_to_residuals_normalisation
(
147
residuals);
148
}
149
150
};
151
152
}
153
#endif
154
155
156
157
158
159
oomph::GeneralisedElement
A Generalised Element class.
Definition:
elements.h:76
oomph::Data::value
double value(const unsigned &i) const
Return i-th stored value. This function is not virtual so that it can be inlined. This means that if ...
Definition:
nodes.h:291
oomph::LinearisedNavierStokesEigenfunctionNormalisationElement::fill_in_contribution_to_jacobian_and_mass_matrix
void fill_in_contribution_to_jacobian_and_mass_matrix(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
Fill in the residuals, jacobian and mass matrix for the volume constraint.
Definition:
linearised_navier_stokes_eigenvalue_elements.h:140
oomph::LinearisedNavierStokesEigenfunctionNormalisationElement::eigenvalue_data_pt
Data * eigenvalue_data_pt()
Access to Data that contains the traded pressure.
Definition:
linearised_navier_stokes_eigenvalue_elements.h:101
oomph::LinearisedNavierStokesEigenfunctionNormalisationElement::~LinearisedNavierStokesEigenfunctionNormalisationElement
~LinearisedNavierStokesEigenfunctionNormalisationElement()
Constructor: Pass pointer to target volume, pointer to Data item whose value specified by index_of_tr...
Definition:
linearised_navier_stokes_eigenvalue_elements.h:98
oomph::LinearisedNavierStokesEigenfunctionNormalisationElement::fill_in_contribution_to_residuals
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Fill in the residuals for the volume constraint.
Definition:
linearised_navier_stokes_eigenvalue_elements.h:116
i
cstr elem_len * i
Definition:
cfortran.h:607
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
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::LinearisedNavierStokesEigenfunctionNormalisationElement::index_of_eigenvalue
unsigned index_of_eigenvalue()
Return the index of Data object at which the traded pressure is stored.
Definition:
linearised_navier_stokes_eigenvalue_elements.h:112
oomph
Definition:
advection_diffusion_elements.cc:33
oomph::Vector< double >
oomph::GeneralisedElement::internal_data_pt
Data *& internal_data_pt(const unsigned &i)
Return a pointer to i-th internal data object.
Definition:
elements.h:623
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_contribution_to_jacobian
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Fill in the residuals and jacobian for the volume constraint.
Definition:
linearised_navier_stokes_eigenvalue_elements.h:123
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::DenseMatrix< double >
oomph::LinearisedNavierStokesEigenfunctionNormalisationElement
Definition:
linearised_navier_stokes_eigenvalue_elements.h:55
oomph::GeneralisedElement::internal_local_eqn
int internal_local_eqn(const unsigned &i, const unsigned &j) const
Return the local equation number corresponding to the j-th value stored at the i-th internal data...
Definition:
elements.h:268