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