biharmonic_flux_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 #ifndef OOMPH_BIHARMONIC_FLUX_ELEMENTS_HEADER
27 #define OOMPH_BIHARMONIC_FLUX_ELEMENTS_HEADER
28 
29 // Config header generated by autoconfig
30 #ifdef HAVE_CONFIG_H
31 #include <oomph-lib-config.h>
32 #endif
33 
34 #ifdef OOMPH_HAS_MPI
35 // mpi headers
36 #include "mpi.h"
37 #endif
38 
39 // Generic C++ headers
40 #include <iostream>
41 #include <math.h>
42 
43 // oomph-lib headers
44 #include "../generic/matrices.h"
45 #include "../generic/elements.h"
46 #include "../generic/hermite_elements.h"
47 #include "biharmonic_elements.h"
48 
49 
50 // oomph namespace
51 namespace oomph
52 {
53  //============================================================================
56  //============================================================================
57  template<unsigned DIM>
59  : public virtual QHermiteElement<DIM - 1>
60  {
61  public:
65  };
66 
67  template<>
68  class FaceGeometry<BiharmonicElement<1>> : public virtual PointElement
69  {
70  public:
74  };
75 
76 
77  //=============================================================================
79  //=============================================================================
80  template<unsigned DIM>
82  : public virtual FaceGeometry<BiharmonicElement<2>>,
83  public virtual FaceElement
84  {
85  public:
88  typedef void (*FluxFctPt)(const double& s, double& flux);
89 
92  const int& face_index,
93  const unsigned& b);
94 
95 
98  {
99  throw OomphLibError("Don't call empty constructor for PoissonFluxElement",
102  }
103 
104 
107 
108 
110  void operator=(const BiharmonicFluxElement&) = delete;
111 
114  {
115  return Flux0_fct_pt;
116  }
117 
120  {
121  return Flux1_fct_pt;
122  }
123 
126  {
127  // Call the generic residuals function
129  }
130 
131 
135  DenseMatrix<double>& jacobian)
136  {
137  // Call the generic residuals routine
139  }
140 
141 
147  double zeta_nodal(const unsigned& n,
148  const unsigned& k,
149  const unsigned& i) const
150  {
151  return FaceElement::zeta_nodal(n, k, i);
152  }
153 
154 
156  void output(std::ostream& outfile) {}
157 
158 
160  void output(std::ostream& outfile, const unsigned& n_plot) {}
161 
162 
164  void output(FILE* file_pt) {}
165 
166 
168  void output(FILE* file_pt, const unsigned& n_plot) {}
169 
170 
172  void compute_error(std::ostream& outfile,
174  double& error,
175  double& norm)
176  {
177  }
178 
179 
180  virtual void output_fct(
181  std::ostream& outfile,
182  const unsigned& nplot,
184  {
185  }
186 
187  private:
190  void get_flux0(const double& s, double& flux)
191  {
192  // If the function pointer is zero return zero
193  if (Flux0_fct_pt == 0)
194  {
195  flux = 0.0;
196  }
197  // Otherwise call the function
198  else
199  {
200  (*Flux0_fct_pt)(s, flux);
201  }
202  }
203 
206  void get_flux1(const double& s, double& flux)
207  {
208  // If the function pointer is zero return zero
209  if (Flux1_fct_pt == 0)
210  {
211  flux = 0.0;
212  }
213  // Otherwise call the function
214  else
215  {
216  (*Flux1_fct_pt)(s, flux);
217  }
218  }
219 
222  double J_eulerian(const Vector<double>& s) const;
223 
227  Vector<double>& residuals);
228 
231 
234 
237  unsigned Nface_nodal_dof;
238 
240  unsigned Boundary;
241  };
242 
243 
244 } // namespace oomph
245 #endif
int i
Definition: BiCGSTAB_step_by_step.cpp:9
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
Scalar * b
Definition: benchVecAdd.cpp:17
biharmonic element class
Definition: biharmonic_elements.h:527
Biharmonic Flux Element.
Definition: biharmonic_flux_elements.h:84
unsigned Nface_nodal_dof
Definition: biharmonic_flux_elements.h:237
void output(std::ostream &outfile)
Output function – does nothing.
Definition: biharmonic_flux_elements.h:156
void(* FluxFctPt)(const double &s, double &flux)
Definition: biharmonic_flux_elements.h:88
FluxFctPt & flux0_fct_pt()
Access function for the flux0 function pointer.
Definition: biharmonic_flux_elements.h:113
double J_eulerian(const Vector< double > &s) const
FluxFctPt Flux1_fct_pt
Function pointer to the prescribed flux.
Definition: biharmonic_flux_elements.h:233
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Definition: biharmonic_flux_elements.h:134
unsigned Boundary
Boundary ID.
Definition: biharmonic_flux_elements.h:240
BiharmonicFluxElement(const BiharmonicFluxElement &dummy)=delete
Broken copy constructor.
void operator=(const BiharmonicFluxElement &)=delete
Broken assignment operator.
void output(std::ostream &outfile, const unsigned &n_plot)
Output function – does nothing.
Definition: biharmonic_flux_elements.h:160
void output(FILE *file_pt)
C-style output function – does nothing.
Definition: biharmonic_flux_elements.h:164
void compute_error(std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
compute_error – does nothing
Definition: biharmonic_flux_elements.h:172
FluxFctPt & flux1_fct_pt()
Access function for the flux1 function pointer.
Definition: biharmonic_flux_elements.h:119
void fill_in_generic_residual_contribution_biharmonic_flux(Vector< double > &residuals)
FluxFctPt Flux0_fct_pt
Function pointer to the prescribed flux.
Definition: biharmonic_flux_elements.h:230
BiharmonicFluxElement()
Broken empty constructor.
Definition: biharmonic_flux_elements.h:97
void get_flux1(const double &s, double &flux)
Definition: biharmonic_flux_elements.h:206
void get_flux0(const double &s, double &flux)
Definition: biharmonic_flux_elements.h:190
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Add the element's contribution to its residual vector.
Definition: biharmonic_flux_elements.h:125
void output(FILE *file_pt, const unsigned &n_plot)
C-style output function – does nothing.
Definition: biharmonic_flux_elements.h:168
BiharmonicFluxElement(FiniteElement *const &bulk_el_pt, const int &face_index, const unsigned &b)
constructor
double zeta_nodal(const unsigned &n, const unsigned &k, const unsigned &i) const
Definition: biharmonic_flux_elements.h:147
virtual void output_fct(std::ostream &outfile, const unsigned &nplot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
Output an exact solution over the element.
Definition: biharmonic_flux_elements.h:180
Definition: elements.h:4338
int & face_index()
Definition: elements.h:4626
double zeta_nodal(const unsigned &n, const unsigned &k, const unsigned &i) const
Definition: elements.h:4497
FaceGeometry()
Definition: biharmonic_flux_elements.h:73
FaceGeometry()
Definition: biharmonic_flux_elements.h:64
Definition: elements.h:4998
Definition: elements.h:1313
void(* SteadyExactSolutionFctPt)(const Vector< double > &, Vector< double > &)
Definition: elements.h:1759
Definition: oomph_definitions.h:222
Definition: elements.h:3439
Definition: hermite_elements.h:86
RealScalar s
Definition: level1_cplx_impl.h:130
char char char int int * k
Definition: level2_impl.h:374
#define DIM
Definition: linearised_navier_stokes_elements.h:44
void flux(const double &time, const Vector< double > &x, double &flux)
Get flux applied along boundary x=0.
Definition: pretend_melt.cc:59
int error
Definition: calibrate.py:297
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
Definition: AnisotropicHookean.h:10
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86