Twomersley_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 TWomersley elements
27 #ifndef OOMPH_TWOMERSLEY_ELEMENTS_HEADER
28 #define OOMPH_TWOMERSLEY_ELEMENTS_HEADER
29 
30 
31 // Config header generated by autoconfig
32 #ifdef HAVE_CONFIG_H
33 #include <oomph-lib-config.h>
34 #endif
35 
36 
37 // OOMPH-LIB headers
38 #include "../generic/nodes.h"
39 #include "../generic/oomph_utilities.h"
40 #include "../generic/Telements.h"
41 #include "../generic/error_estimator.h"
42 #include "womersley_elements.h"
43 
44 namespace oomph
45 {
49 
50 
51  //======================================================================
54  //======================================================================
55  template<unsigned DIM, unsigned NNODE_1D>
56  class TWomersleyElement : public virtual TElement<DIM, NNODE_1D>,
57  public virtual WomersleyEquations<DIM>
58  {
59  private:
62  static const unsigned Initial_Nvalue;
63 
64  public:
68  {
69  }
70 
73 
76 
79  inline unsigned required_nvalue(const unsigned& n) const
80  {
81  return Initial_Nvalue;
82  }
83 
86  void output(std::ostream& outfile)
87  {
89  }
90 
91 
94  void output(std::ostream& outfile, const unsigned& n_plot)
95  {
96  WomersleyEquations<DIM>::output(outfile, n_plot);
97  }
98 
99 
102  void output(FILE* file_pt)
103  {
105  }
106 
107 
110  void output(FILE* file_pt, const unsigned& n_plot)
111  {
112  WomersleyEquations<DIM>::output(file_pt, n_plot);
113  }
114 
115 
118  void output_fct(std::ostream& outfile,
119  const unsigned& n_plot,
121  {
122  WomersleyEquations<DIM>::output_fct(outfile, n_plot, exact_soln_pt);
123  }
124 
125 
129  void output_fct(std::ostream& outfile,
130  const unsigned& n_plot,
131  const double& time,
133  {
134  WomersleyEquations<DIM>::output_fct(outfile, n_plot, time, exact_soln_pt);
135  }
136 
137 
138  protected:
142  Shape& psi,
143  DShape& dpsidx,
144  Shape& test,
145  DShape& dtestdx) const;
146 
147 
151  const unsigned& ipt,
152  Shape& psi,
153  DShape& dpsidx,
154  Shape& test,
155  DShape& dtestdx) const;
156  };
157 
158 
162 
163 
164  //======================================================================
169  //======================================================================
170  template<unsigned DIM, unsigned NNODE_1D>
172  const Vector<double>& s,
173  Shape& psi,
174  DShape& dpsidx,
175  Shape& test,
176  DShape& dtestdx) const
177  {
178  // Call the geometrical shape functions and derivatives
179  double J = this->dshape_eulerian(s, psi, dpsidx);
180 
181  // Loop over the test functions and derivatives and set them equal to the
182  // shape functions
183  for (unsigned i = 0; i < NNODE_1D; i++)
184  {
185  test[i] = psi[i];
186  for (unsigned j = 0; j < DIM; j++)
187  {
188  dtestdx(i, j) = dpsidx(i, j);
189  }
190  }
191 
192  // Return the jacobian
193  return J;
194  }
195 
196 
197  //======================================================================
202  //======================================================================
203  template<unsigned DIM, unsigned NNODE_1D>
206  Shape& psi,
207  DShape& dpsidx,
208  Shape& test,
209  DShape& dtestdx) const
210  {
211  // Call the geometrical shape functions and derivatives
212  double J = this->dshape_eulerian_at_knot(ipt, psi, dpsidx);
213 
214  // Set the test functions equal to the shape functions
215  //(sets internal pointers)
216  test = psi;
217  dtestdx = dpsidx;
218 
219  // Return the jacobian
220  return J;
221  }
222 
223 
226 
227 
228  //=======================================================================
233  //=======================================================================
234  template<unsigned DIM, unsigned NNODE_1D>
236  : public virtual TElement<DIM - 1, NNODE_1D>
237  {
238  public:
241  FaceGeometry() : TElement<DIM - 1, NNODE_1D>() {}
242  };
243 
244 
248 
249 
250  //=======================================================================
252  //=======================================================================
253  template<unsigned NNODE_1D>
254  class FaceGeometry<TWomersleyElement<1, NNODE_1D>>
255  : public virtual PointElement
256  {
257  public:
261  };
262 
263 
264 } // namespace oomph
265 
266 #endif
int i
Definition: BiCGSTAB_step_by_step.cpp:9
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
JacobiRotation< float > J
Definition: Jacobi_makeJacobi.cpp:3
Definition: shape.h:278
FaceGeometry()
Definition: Twomersley_elements.h:260
FaceGeometry()
Definition: Twomersley_elements.h:241
Definition: elements.h:4998
void(* SteadyExactSolutionFctPt)(const Vector< double > &, Vector< double > &)
Definition: elements.h:1759
void(* UnsteadyExactSolutionFctPt)(const double &, const Vector< double > &, Vector< double > &)
Definition: elements.h:1765
Definition: elements.h:3439
Definition: shape.h:76
Definition: Telements.h:1208
Definition: Twomersley_elements.h:58
unsigned required_nvalue(const unsigned &n) const
Definition: Twomersley_elements.h:79
void output(std::ostream &outfile, const unsigned &n_plot)
Definition: Twomersley_elements.h:94
void output_fct(std::ostream &outfile, const unsigned &n_plot, const double &time, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt)
Definition: Twomersley_elements.h:129
void operator=(const TWomersleyElement< DIM, NNODE_1D > &)=delete
Broken assignment operator.
double dshape_and_dtest_eulerian_at_knot_womersley(const unsigned &ipt, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const
Definition: Twomersley_elements.h:205
static const unsigned Initial_Nvalue
Definition: Twomersley_elements.h:62
TWomersleyElement()
Definition: Twomersley_elements.h:67
double dshape_and_dtest_eulerian_womersley(const Vector< double > &s, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const
Definition: Twomersley_elements.h:171
void output(std::ostream &outfile)
Definition: Twomersley_elements.h:86
TWomersleyElement(const TWomersleyElement< DIM, NNODE_1D > &dummy)=delete
Broken copy constructor.
void output(FILE *file_pt)
Definition: Twomersley_elements.h:102
void output_fct(std::ostream &outfile, const unsigned &n_plot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
Definition: Twomersley_elements.h:118
void output(FILE *file_pt, const unsigned &n_plot)
Definition: Twomersley_elements.h:110
Definition: womersley_elements.h:186
void output(std::ostream &outfile)
Output with default number of plot points.
Definition: womersley_elements.h:282
void output_fct(std::ostream &outfile, const unsigned &nplot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
Output exact soln: x,y,u_exact or x,y,z,u_exact at nplot^DIM plot points.
Definition: womersley_elements.cc:418
RealScalar s
Definition: level1_cplx_impl.h:130
#define DIM
Definition: linearised_navier_stokes_elements.h:44
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
Definition: AnisotropicHookean.h:10
Definition: indexed_view.cpp:20
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2