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 
35 
36 namespace oomph
37 {
38 
39 //=====================================================================
40 /// \short Fill in the residuals for the volume constraint
41 //====================================================================
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 //===========================================================================
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)
88  add_internal_data(new Data(3));
89 
90  // ...and stored the "traded pressure" value as first value
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 
int eigenvalue_local_eqn(const unsigned &i)
The local eqn number for the traded pressure.
unsigned Index_of_eigenvalue
Storage for the offset index of the eigenvalue.
A class that represents a collection of data; each Data object may contain many different individual ...
Definition: nodes.h:89
std::complex< double > * Normalisation_pt
Pointer to the desired normalisation.
void fill_in_generic_contribution_to_residuals_normalisation(Vector< double > &residuals)
Fill in the residuals for the volume constraint.
LinearisedNavierStokesEigenfunctionNormalisationElement(std::complex< double > *const &normalisation_pt)
Constructor: Pass pointer to target volume. "Pressure" value that "traded" for the volume contraint i...
unsigned External_or_internal_data_index_of_eigenvalue
Storage for the initial index of the eigenvalue.
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