Tfoeppl_von_karman_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 TFoepplvonKarman elements
27 #ifndef OOMPH_TFOEPPLVONKARMAN_ELEMENTS_HEADER
28 #define OOMPH_TFOEPPLVONKARMAN_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 
44 
45 namespace oomph
46 {
49  // TFoepplvonKarmanElement
52 
53 
54  //======================================================================
59  //======================================================================
60  template<unsigned NNODE_1D>
61  class TFoepplvonKarmanElement : public virtual TElement<2, NNODE_1D>,
62  public virtual FoepplvonKarmanEquations,
63  public virtual ElementWithZ2ErrorEstimator
64  {
65  public:
69  : TElement<2, NNODE_1D>(), FoepplvonKarmanEquations()
70  {
71  }
72 
73 
76  delete;
77 
80 
83  inline unsigned required_nvalue(const unsigned& n) const
84  {
85  return Initial_Nvalue;
86  }
87 
90  void output(std::ostream& outfile)
91  {
93  }
94 
97  void output(std::ostream& outfile, const unsigned& n_plot)
98  {
99  FoepplvonKarmanEquations::output(outfile, n_plot);
100  }
101 
102 
105  void output(FILE* file_pt)
106  {
108  }
109 
110 
113  void output(FILE* file_pt, const unsigned& n_plot)
114  {
115  FoepplvonKarmanEquations::output(file_pt, n_plot);
116  }
117 
118 
121  void output_fct(std::ostream& outfile,
122  const unsigned& n_plot,
124  {
125  FoepplvonKarmanEquations::output_fct(outfile, n_plot, exact_soln_pt);
126  }
127 
128 
131  void output_fct(std::ostream& outfile,
132  const unsigned& n_plot,
133  const double& time,
135  {
137  outfile, n_plot, time, exact_soln_pt);
138  }
139 
140  protected:
143  inline double dshape_and_dtest_eulerian_fvk(const Vector<double>& s,
144  Shape& psi,
145  DShape& dpsidx,
146  Shape& test,
147  DShape& dtestdx) const;
148 
149 
152  inline double dshape_and_dtest_eulerian_at_knot_fvk(const unsigned& ipt,
153  Shape& psi,
154  DShape& dpsidx,
155  Shape& test,
156  DShape& dtestdx) const;
157 
160  unsigned nrecovery_order()
161  {
162  return (NNODE_1D - 1);
163  }
164 
166  unsigned num_Z2_flux_terms()
167  {
168  return 2;
169  }
170 
173  {
175  }
176 
178  unsigned nvertex_node() const
179  {
181  }
182 
184  Node* vertex_node_pt(const unsigned& j) const
185  {
187  }
188 
189  private:
191  static const unsigned Initial_Nvalue;
192  };
193 
194 
195  // Inline functions:
196 
197 
198  //======================================================================
203  //======================================================================
204  template<unsigned NNODE_1D>
206  const Vector<double>& s,
207  Shape& psi,
208  DShape& dpsidx,
209  Shape& test,
210  DShape& dtestdx) const
211  {
212  unsigned n_node = this->nnode();
213 
214  // Call the geometrical shape functions and derivatives
215  double J = this->dshape_eulerian(s, psi, dpsidx);
216 
217  // Loop over the test functions and derivatives and set them equal to the
218  // shape functions
219  for (unsigned i = 0; i < n_node; i++)
220  {
221  test[i] = psi[i];
222  dtestdx(i, 0) = dpsidx(i, 0);
223  dtestdx(i, 1) = dpsidx(i, 1);
224  }
225 
226  // Return the jacobian
227  return J;
228  }
229 
230 
231  //======================================================================
236  //======================================================================
237  template<unsigned NNODE_1D>
239  NNODE_1D>::dshape_and_dtest_eulerian_at_knot_fvk(const unsigned& ipt,
240  Shape& psi,
241  DShape& dpsidx,
242  Shape& test,
243  DShape& dtestdx) const
244  {
245  // Call the geometrical shape functions and derivatives
246  double J = this->dshape_eulerian_at_knot(ipt, psi, dpsidx);
247 
248  // Set the pointers of the test functions
249  test = psi;
250  dtestdx = dpsidx;
251 
252  // Return the jacobian
253  return J;
254  }
255 
256 
257  //=======================================================================
262  //=======================================================================
263  template<unsigned NNODE_1D>
265  : public virtual TElement<1, NNODE_1D>
266  {
267  public:
270  FaceGeometry() : TElement<1, NNODE_1D>() {}
271  };
272 
273 } // namespace oomph
274 
275 #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
Definition: error_estimator.h:79
FaceGeometry()
Definition: Tfoeppl_von_karman_elements.h:270
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: foeppl_von_karman_elements.h:57
void get_gradient_of_deflection(const Vector< double > &s, Vector< double > &gradient) const
Get gradient of deflection: gradient[i] = dw/dx_i.
Definition: foeppl_von_karman_elements.h:266
void output_fct(std::ostream &outfile, const unsigned &n_plot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
Output exact soln: x,y,w_exact at n_plot^DIM plot points.
Definition: foeppl_von_karman_elements.cc:496
void output(std::ostream &outfile)
Output with default number of plot points.
Definition: foeppl_von_karman_elements.h:137
Definition: nodes.h:906
Definition: shape.h:76
Definition: Telements.h:1208
Definition: Tfoeppl_von_karman_elements.h:64
TFoepplvonKarmanElement()
Definition: Tfoeppl_von_karman_elements.h:68
unsigned required_nvalue(const unsigned &n) const
Definition: Tfoeppl_von_karman_elements.h:83
static const unsigned Initial_Nvalue
Static unsigned that holds the (same) number of variables at every node.
Definition: Tfoeppl_von_karman_elements.h:191
Node * vertex_node_pt(const unsigned &j) const
Pointer to the j-th vertex node in the element.
Definition: Tfoeppl_von_karman_elements.h:184
double dshape_and_dtest_eulerian_at_knot_fvk(const unsigned &ipt, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const
Definition: Tfoeppl_von_karman_elements.h:239
TFoepplvonKarmanElement(const TFoepplvonKarmanElement< NNODE_1D > &dummy)=delete
Broken copy constructor.
void output_fct(std::ostream &outfile, const unsigned &n_plot, const double &time, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt)
Definition: Tfoeppl_von_karman_elements.h:131
unsigned nrecovery_order()
Definition: Tfoeppl_von_karman_elements.h:160
void operator=(const TFoepplvonKarmanElement< NNODE_1D > &)=delete
Broken assignment operator.
void output_fct(std::ostream &outfile, const unsigned &n_plot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
Definition: Tfoeppl_von_karman_elements.h:121
unsigned num_Z2_flux_terms()
Number of 'flux' terms for Z2 error estimation.
Definition: Tfoeppl_von_karman_elements.h:166
void get_Z2_flux(const Vector< double > &s, Vector< double > &flux)
Get 'flux' for Z2 error recovery: Standard flux.from FvK equations.
Definition: Tfoeppl_von_karman_elements.h:172
void output(std::ostream &outfile)
Definition: Tfoeppl_von_karman_elements.h:90
void output(std::ostream &outfile, const unsigned &n_plot)
Definition: Tfoeppl_von_karman_elements.h:97
void output(FILE *file_pt, const unsigned &n_plot)
Definition: Tfoeppl_von_karman_elements.h:113
void output(FILE *file_pt)
Definition: Tfoeppl_von_karman_elements.h:105
double dshape_and_dtest_eulerian_fvk(const Vector< double > &s, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const
Definition: Tfoeppl_von_karman_elements.h:205
unsigned nvertex_node() const
Number of vertex nodes in the element.
Definition: Tfoeppl_von_karman_elements.h:178
RealScalar s
Definition: level1_cplx_impl.h:130
void flux(const double &time, const Vector< double > &x, double &flux)
Get flux applied along boundary x=0.
Definition: pretend_melt.cc:59
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