refineable_gen_axisym_advection_diffusion_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 solve the advection diffusion equation
27 // and that can be refined.
28 
29 #ifndef OOMPH_REFINEABLE_GEN_AXISYM_ADVECTION_DIFFUSION_ELEMENTS_HEADER
30 #define OOMPH_REFINEABLE_GEN_AXISYM_ADVECTION_DIFFUSION_ELEMENTS_HEADER
31 
32 // Config header generated by autoconfig
33 #ifdef HAVE_CONFIG_H
34 #include <oomph-lib-config.h>
35 #endif
36 
37 // oomph-lib headers
38 #include "../generic/refineable_quad_element.h"
39 #include "../generic/refineable_brick_element.h"
40 #include "../generic/error_estimator.h"
42 
43 namespace oomph
44 {
45  //======================================================================
53  //======================================================================
56  public virtual RefineableElement,
57  public virtual ElementWithZ2ErrorEstimator
58  {
59  public:
65  {
66  }
67 
68 
72  delete;
73 
75  // Commented out broken assignment operator because this can lead to a
76  // conflict warning when used in the virtual inheritence hierarchy.
77  // Essentially the compiler doesn't realise that two separate
78  // implementations of the broken function are the same and so, quite
79  // rightly, it shouts.
80  /*void operator=(const
81  RefineableGeneralisedAxisymAdvectionDiffusionEquations&) = delete;*/
82 
84  unsigned num_Z2_flux_terms()
85  {
86  return 2;
87  }
88 
92  {
93  this->get_flux(s, flux);
94  }
95 
96 
102  Vector<double>& values)
103  {
104  // Set size of Vector: u
105  values.resize(1);
106 
107  // Find number of nodes
108  const unsigned n_node = nnode();
109 
110  // Find the index at which the unknown is stored
111  const unsigned u_nodal_index = this->u_index_cons_axisym_adv_diff();
112 
113  // Local shape function
114  Shape psi(n_node);
115 
116  // Find values of shape function
117  shape(s, psi);
118 
119  // Initialise value of u
120  values[0] = 0.0;
121 
122  // Loop over the local nodes and sum
123  for (unsigned l = 0; l < n_node; l++)
124  {
125  values[0] += this->nodal_value(l, u_nodal_index) * psi[l];
126  }
127  }
128 
133  void get_interpolated_values(const unsigned& t,
134  const Vector<double>& s,
135  Vector<double>& values)
136  {
137  // Set size of Vector:
138  values.resize(1);
139 
140  // Find out how many nodes there are
141  const unsigned n_node = nnode();
142 
143  // Find the nodal index at which the unknown is stored
144  const unsigned u_nodal_index = this->u_index_cons_axisym_adv_diff();
145 
146  // Shape functions
147  Shape psi(n_node);
148 
149  // Find values of shape function
150  shape(s, psi);
151 
152  // Initialise the value of u
153  values[0] = 0.0;
154 
155  // Calculate value
156  for (unsigned l = 0; l < n_node; l++)
157  {
158  values[0] += this->nodal_value(t, l, u_nodal_index) * psi[l];
159  }
160  }
161 
164  {
165  return x[0];
166  }
167 
168 
171  {
173  cast_father_element_pt =
175  this->father_element_pt());
176 
177  // Set the values of the pointers from the father
178  this->Source_fct_pt = cast_father_element_pt->source_fct_pt();
179  this->Wind_fct_pt = cast_father_element_pt->wind_fct_pt();
180  this->Conserved_wind_fct_pt =
181  cast_father_element_pt->conserved_wind_fct_pt();
182  this->Diff_fct_pt = cast_father_element_pt->diff_fct_pt();
183  this->Pe_pt = cast_father_element_pt->pe_pt();
184  this->PeSt_pt = cast_father_element_pt->pe_st_pt();
185 
186  // Set the ALE status
187  this->ALE_is_disabled = cast_father_element_pt->ALE_is_disabled;
188  }
189 
190  protected:
196  Vector<double>& residuals,
197  DenseMatrix<double>& jacobian,
198  DenseMatrix<double>& mass_matrix,
199  unsigned flag);
200  };
201 
202 
203  //======================================================================
208  //======================================================================
209  template<unsigned NNODE_1D>
213  public virtual RefineableQElement<2>
214  {
215  public:
218  : RefineableElement(),
220  RefineableQElement<2>(),
222  {
223  }
224 
225 
229  dummy) = delete;
230 
232  /*void operator=(const
233  RefineableQGeneralisedAxisymAdvectionDiffusionElement< NNODE_1D>&) =
234  delete;*/
235 
237  unsigned ncont_interpolated_values() const
238  {
239  return 1;
240  }
241 
243  unsigned nvertex_node() const
244  {
246  NNODE_1D>::nvertex_node();
247  }
248 
250  Node* vertex_node_pt(const unsigned& j) const
251  {
253  NNODE_1D>::vertex_node_pt(j);
254  }
255 
257  void rebuild_from_sons(Mesh*& mesh_pt) {}
258 
261  unsigned nrecovery_order()
262  {
263  return (NNODE_1D - 1);
264  }
265 
269  };
270 
274 
275 
276  //=======================================================================
283  //=======================================================================
284  template<unsigned NNODE_1D>
287  : public virtual QElement<1, NNODE_1D>
288  {
289  public:
292  FaceGeometry() : QElement<1, NNODE_1D>() {}
293  };
294 
295 } // namespace oomph
296 
297 #endif
Definition: gen_axisym_advection_diffusion_elements.h:660
Definition: error_estimator.h:79
FaceGeometry()
Definition: refineable_gen_axisym_advection_diffusion_elements.h:292
Definition: elements.h:4998
double nodal_value(const unsigned &n, const unsigned &i) const
Definition: elements.h:2593
virtual void shape(const Vector< double > &s, Shape &psi) const =0
unsigned nnode() const
Return the number of nodes.
Definition: elements.h:2210
Definition: mesh.h:67
Definition: nodes.h:906
Definition: Qelements.h:459
Definition: refineable_elements.h:97
virtual RefineableElement * father_element_pt() const
Return a pointer to the father element.
Definition: refineable_elements.h:539
Definition: refineable_gen_axisym_advection_diffusion_elements.h:58
RefineableGeneralisedAxisymAdvectionDiffusionEquations(const RefineableGeneralisedAxisymAdvectionDiffusionEquations &dummy)=delete
Broken copy constructor.
RefineableGeneralisedAxisymAdvectionDiffusionEquations()
Empty Constructor.
Definition: refineable_gen_axisym_advection_diffusion_elements.h:61
void get_interpolated_values(const Vector< double > &s, Vector< double > &values)
Definition: refineable_gen_axisym_advection_diffusion_elements.h:101
void get_interpolated_values(const unsigned &t, const Vector< double > &s, Vector< double > &values)
Definition: refineable_gen_axisym_advection_diffusion_elements.h:133
void get_Z2_flux(const Vector< double > &s, Vector< double > &flux)
Definition: refineable_gen_axisym_advection_diffusion_elements.h:91
double geometric_jacobian(const Vector< double > &x)
Fill in the geometric Jacobian, which in this case is r.
Definition: refineable_gen_axisym_advection_diffusion_elements.h:163
void further_build()
Further build: Copy source function pointer from father element.
Definition: refineable_gen_axisym_advection_diffusion_elements.h:170
void fill_in_generic_residual_contribution_cons_axisym_adv_diff(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix, unsigned flag)
Definition: refineable_gen_axisym_advection_diffusion_elements.cc:37
unsigned num_Z2_flux_terms()
Broken assignment operator.
Definition: refineable_gen_axisym_advection_diffusion_elements.h:84
Definition: Qelements.h:2259
Definition: refineable_gen_axisym_advection_diffusion_elements.h:214
Node * vertex_node_pt(const unsigned &j) const
Pointer to the j-th vertex node in the element.
Definition: refineable_gen_axisym_advection_diffusion_elements.h:250
RefineableQGeneralisedAxisymAdvectionDiffusionElement()
Empty Constructor:
Definition: refineable_gen_axisym_advection_diffusion_elements.h:217
unsigned nvertex_node() const
Number of vertex nodes in the element.
Definition: refineable_gen_axisym_advection_diffusion_elements.h:243
RefineableQGeneralisedAxisymAdvectionDiffusionElement(const RefineableQGeneralisedAxisymAdvectionDiffusionElement< NNODE_1D > &dummy)=delete
Broken copy constructor.
unsigned ncont_interpolated_values() const
Broken assignment operator.
Definition: refineable_gen_axisym_advection_diffusion_elements.h:237
void rebuild_from_sons(Mesh *&mesh_pt)
Rebuild from sons: empty.
Definition: refineable_gen_axisym_advection_diffusion_elements.h:257
unsigned nrecovery_order()
Definition: refineable_gen_axisym_advection_diffusion_elements.h:261
void further_setup_hanging_nodes()
Definition: refineable_gen_axisym_advection_diffusion_elements.h:268
Definition: shape.h:76
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
virtual unsigned u_index_cons_axisym_adv_diff() const
Definition: gen_axisym_advection_diffusion_elements.h:110
GeneralisedAxisymAdvectionDiffusionSourceFctPt Source_fct_pt
Pointer to source function:
Definition: gen_axisym_advection_diffusion_elements.h:624
GeneralisedAxisymAdvectionDiffusionDiffFctPt Diff_fct_pt
Pointer to diffusivity funciton.
Definition: gen_axisym_advection_diffusion_elements.h:633
GeneralisedAxisymAdvectionDiffusionWindFctPt Conserved_wind_fct_pt
Pointer to additional (conservative) wind function:
Definition: gen_axisym_advection_diffusion_elements.h:630
double * PeSt_pt
Pointer to global Peclet number multiplied by Strouhal number.
Definition: gen_axisym_advection_diffusion_elements.h:621
GeneralisedAxisymAdvectionDiffusionWindFctPt Wind_fct_pt
Pointer to wind function:
Definition: gen_axisym_advection_diffusion_elements.h:627
bool ALE_is_disabled
Definition: gen_axisym_advection_diffusion_elements.h:638
double * Pe_pt
Pointer to global Peclet number.
Definition: gen_axisym_advection_diffusion_elements.h:618
void get_flux(const Vector< double > &s, Vector< double > &flux) const
Get flux: .
Definition: gen_axisym_advection_diffusion_elements.h:424
list x
Definition: plotDoE.py:28
t
Definition: plotPSD.py:36
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2