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-2022 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  //==========================================================================
49  //=========================================================================
51  : public GeneralisedElement
52  {
53  private:
55  std::complex<double>* Normalisation_pt;
56 
59 
62 
63 
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 
73  Vector<double>& residuals);
74 
75  public:
80  std::complex<double>* const& normalisation_pt);
81 
86  /*LinearisedNavierStokesEigenfunctionNormalisationElement(double*
87  prescribed_volume_pt, Data* p_traded_data_pt, const unsigned&
88  index_of_traded_pressure);*/
89 
92 
95  {
97  }
98 
100  inline double eigenvalue(const unsigned& i)
101  {
103  }
104 
106  inline unsigned index_of_eigenvalue()
107  {
108  return Index_of_eigenvalue;
109  }
110 
111 
114  {
116  }
117 
120  DenseMatrix<double>& jacobian)
121  {
122  // One contribution to jacobian; see comment in that function
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 
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
143  }
144  };
145 
146 } // namespace oomph
147 #endif
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Definition: nodes.h:86
double value(const unsigned &i) const
Definition: nodes.h:293
Definition: elements.h:73
Data *& internal_data_pt(const unsigned &i)
Return a pointer to i-th internal data object.
Definition: elements.h:622
int internal_local_eqn(const unsigned &i, const unsigned &j) const
Definition: elements.h:267
Definition: linearised_navier_stokes_eigenvalue_elements.h:52
void fill_in_contribution_to_jacobian_and_mass_matrix(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
Definition: linearised_navier_stokes_eigenvalue_elements.h:135
LinearisedNavierStokesEigenfunctionNormalisationElement(std::complex< double > *const &normalisation_pt)
Definition: linearised_navier_stokes_eigenvalue_elements.cc:73
unsigned Index_of_eigenvalue
Storage for the offset index of the eigenvalue.
Definition: linearised_navier_stokes_eigenvalue_elements.h:61
Data * eigenvalue_data_pt()
Access to Data that contains the traded pressure.
Definition: linearised_navier_stokes_eigenvalue_elements.h:94
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
double eigenvalue(const unsigned &i)
Return the traded pressure value.
Definition: linearised_navier_stokes_eigenvalue_elements.h:100
int eigenvalue_local_eqn(const unsigned &i)
The local eqn number for the traded pressure.
Definition: linearised_navier_stokes_eigenvalue_elements.h:65
~LinearisedNavierStokesEigenfunctionNormalisationElement()
Empty destructor.
Definition: linearised_navier_stokes_eigenvalue_elements.h:91
unsigned External_or_internal_data_index_of_eigenvalue
Storage for the initial index of the eigenvalue.
Definition: linearised_navier_stokes_eigenvalue_elements.h:58
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
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
std::complex< double > * Normalisation_pt
Pointer to the desired normalisation.
Definition: linearised_navier_stokes_eigenvalue_elements.h:55
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
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
Definition: AnisotropicHookean.h:10