refineable_young_laplace_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 
27 #ifndef OOMPH_REFINEABLE_YOUNGLAPLACE_ELEMENTS_HEADER
28 #define OOMPH_REFINEABLE_YOUNGLAPLACE_ELEMENTS_HEADER
29 
30 // Config header generated by autoconfig
31 #ifdef HAVE_CONFIG_H
32 #include <oomph-lib-config.h>
33 #endif
34 
35 
36 // oomph-lib headers
37 #include "../generic/refineable_quad_element.h"
38 #include "../generic/error_estimator.h"
39 #include "young_laplace_elements.h"
40 
41 
42 namespace oomph
43 {
46 
47 
48  //======================================================================
52  //======================================================================
54  : public virtual YoungLaplaceEquations,
55  public virtual RefineableElement,
56  public virtual ElementWithZ2ErrorEstimator
57  {
58  public:
61  RefineableYoungLaplaceEquations(const int& refine_level = 0)
65  {
66  }
67 
68 
71  const RefineableYoungLaplaceEquations& dummy) = delete;
72 
75 
78 
80  unsigned num_Z2_flux_terms()
81  {
82  return 2;
83  }
84 
88  {
89  this->get_flux(s, flux);
90  }
91 
97  Vector<double>& values)
98  {
99  // Set size of Vector: u
100  values.resize(1);
101 
102  // Find number of nodes
103  unsigned n_node = nnode();
104 
105  // Local shape function
106  Shape psi(n_node);
107 
108  // Find values of shape function
109  shape(s, psi);
110 
111  // Initialise value of u
112  values[0] = 0.0;
113 
114  // Loop over the local nodes and sum
115  for (unsigned l = 0; l < n_node; l++)
116  {
117  values[0] += this->u(l) * psi[l];
118  }
119  }
120 
121 
126  void get_interpolated_values(const unsigned& t,
127  const Vector<double>& s,
128  Vector<double>& values)
129  {
130  if (t != 0)
131  {
132  throw OomphLibError("These equations are steady => No time dependence",
135  }
136  else
137  {
138  get_interpolated_values(s, values);
139  }
140  }
141 
142 
147  {
148  // Copy kappa with set_kappa() to ensure that it's added to the
149  // element's external Data.
150  this->set_kappa(dynamic_cast<RefineableYoungLaplaceEquations*>(
151  this->father_element_pt())
152  ->kappa_pt());
153 
154  // Copy spine functions
155  this->Spine_fct_pt = dynamic_cast<RefineableYoungLaplaceEquations*>(
156  this->father_element_pt())
157  ->spine_fct_pt();
158 
159  this->Spine_base_fct_pt = dynamic_cast<RefineableYoungLaplaceEquations*>(
160  this->father_element_pt())
161  ->spine_base_fct_pt();
162  }
163  };
164 
165 
166  //======================================================================
170  //======================================================================
171  template<unsigned NNODE_1D>
173  : public QYoungLaplaceElement<NNODE_1D>,
174  public virtual RefineableYoungLaplaceEquations,
175  public virtual RefineableQElement<2>
176  {
177  public:
181  : RefineableElement(),
183  RefineableQElement<2>(),
184  QYoungLaplaceElement<NNODE_1D>()
185  {
186  }
187 
190  const RefineableQYoungLaplaceElement<NNODE_1D>& dummy) = delete;
191 
194 
196  unsigned ncont_interpolated_values() const
197  {
198  return 1;
199  }
200 
202  unsigned nvertex_node() const
203  {
205  }
206 
208  Node* vertex_node_pt(const unsigned& j) const
209  {
211  }
212 
214  void rebuild_from_sons(Mesh*& mesh_pt) {}
215 
218  unsigned nrecovery_order()
219  {
220  return (NNODE_1D - 1);
221  }
222 
226  };
227 
231 
232 
233  //=======================================================================
237  //=======================================================================
238  template<unsigned NNODE_1D>
240  : public virtual QElement<1, NNODE_1D>
241  {
242  public:
245  FaceGeometry() : QElement<1, NNODE_1D>() {}
246  };
247 
248 
249 } // namespace oomph
250 
251 #endif
Definition: error_estimator.h:79
FaceGeometry()
Definition: refineable_young_laplace_elements.h:245
Definition: elements.h:4998
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: oomph_definitions.h:222
unsigned nvertex_node() const
Number of vertex nodes in the element.
Definition: Qelements.h:907
Node * vertex_node_pt(const unsigned &j) const
Pointer to the j-th vertex node in the element.
Definition: Qelements.h:913
Definition: Qelements.h:459
Definition: young_laplace_elements.h:462
Definition: refineable_elements.h:97
virtual RefineableElement * father_element_pt() const
Return a pointer to the father element.
Definition: refineable_elements.h:539
Definition: Qelements.h:2259
Definition: refineable_young_laplace_elements.h:176
unsigned nrecovery_order()
Definition: refineable_young_laplace_elements.h:218
void rebuild_from_sons(Mesh *&mesh_pt)
Rebuild from sons: empty.
Definition: refineable_young_laplace_elements.h:214
unsigned ncont_interpolated_values() const
Number of continuously interpolated values: 1.
Definition: refineable_young_laplace_elements.h:196
void further_setup_hanging_nodes()
Definition: refineable_young_laplace_elements.h:225
unsigned nvertex_node() const
Number of vertex nodes in the element.
Definition: refineable_young_laplace_elements.h:202
RefineableQYoungLaplaceElement()
Definition: refineable_young_laplace_elements.h:180
void operator=(const RefineableQYoungLaplaceElement< NNODE_1D > &)=delete
Broken assignment operator.
Node * vertex_node_pt(const unsigned &j) const
Pointer to the j-th vertex node in the element.
Definition: refineable_young_laplace_elements.h:208
RefineableQYoungLaplaceElement(const RefineableQYoungLaplaceElement< NNODE_1D > &dummy)=delete
Broken copy constructor.
Definition: refineable_young_laplace_elements.h:57
void get_interpolated_values(const unsigned &t, const Vector< double > &s, Vector< double > &values)
Definition: refineable_young_laplace_elements.h:126
RefineableYoungLaplaceEquations(const RefineableYoungLaplaceEquations &dummy)=delete
Broken copy constructor.
RefineableYoungLaplaceEquations(const int &refine_level=0)
Definition: refineable_young_laplace_elements.h:61
void operator=(const RefineableYoungLaplaceEquations &)=delete
Broken assignment operator.
void further_build()
Definition: refineable_young_laplace_elements.h:146
void get_interpolated_values(const Vector< double > &s, Vector< double > &values)
Definition: refineable_young_laplace_elements.h:96
void get_Z2_flux(const Vector< double > &s, Vector< double > &flux)
Definition: refineable_young_laplace_elements.h:87
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Compute element residual vector taking hanging nodes into account.
Definition: refineable_young_laplace_elements.cc:34
unsigned num_Z2_flux_terms()
Number of 'flux' terms for Z2 error estimation.
Definition: refineable_young_laplace_elements.h:80
Definition: shape.h:76
Definition: young_laplace_elements.h:58
SpineBaseFctPt & spine_base_fct_pt()
Definition: young_laplace_elements.h:158
void set_kappa(Data *kappa_pt)
Set curvature data (and add it to the element's external Data)
Definition: young_laplace_elements.h:172
SpineFctPt & spine_fct_pt()
Definition: young_laplace_elements.h:166
virtual double u(const unsigned &n) const
Definition: young_laplace_elements.h:84
SpineFctPt Spine_fct_pt
Pointer to spine function:
Definition: young_laplace_elements.h:439
void get_flux(const Vector< double > &s, Vector< double > &flux) const
Get flux: flux[i] = du/dx_i: Mainly used for error estimation.
Definition: young_laplace_elements.h:208
SpineBaseFctPt Spine_base_fct_pt
Pointer to spine base function:
Definition: young_laplace_elements.h:436
Data * kappa_pt()
Definition: young_laplace_elements.h:144
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
t
Definition: plotPSD.py:36
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2