refineable_line_element.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 RefineableQElement<1> class
27 #ifndef OOMPH_REFINEABLE_LINE_ELEMENT_HEADER
28 #define OOMPH_REFINEABLE_LINE_ELEMENT_HEADER
29 
30 // Config header generated by autoconfig
31 #ifdef HAVE_CONFIG_H
32 #include <oomph-lib-config.h>
33 #endif
34 
35 // oomph-lib headers
36 #include "binary_tree.h"
37 #include "macro_element.h"
38 #include "refineable_elements.h"
39 #include "Qelements.h"
40 
41 namespace oomph
42 {
43  // Forward definition for mesh.
44  class Mesh;
45 
46  //=======================================================================
62  //=======================================================================
63  template<>
64  class RefineableQElement<1> : public virtual RefineableElement,
65  public virtual LineElementBase
66  {
67  public:
70  typedef void (RefineableQElement<1>::*VoidMemberFctPt)();
71 
74  {
75 #ifdef LEAK_CHECK
76  LeakCheckNames::RefineableQElement<1> _build += 1;
77 #endif
78  }
79 
81  RefineableQElement(const RefineableQElement<1>& dummy) = delete;
82 
84  // Commented out broken assignment operator because this can lead to a
85  // conflict warning when used in the virtual inheritence hierarchy.
86  // Essentially the compiler doesn't realise that two separate
87  // implementations of the broken function are the same and so, quite
88  // rightly, it shouts.
89  /*void operator=(const RefineableQElement<1>&) = delete;*/
90 
93  {
94 #ifdef LEAK_CHECK
95  LeakCheckNames::RefineableQElement<1> _build -= 1;
96 #endif
97  }
98 
100  unsigned required_nsons() const
101  {
102  return 2;
103  }
104 
110  Node* node_created_by_neighbour(const Vector<double>& s_fraction,
111  bool& is_periodic);
112 
119  bool& is_periodic)
120  {
121  // It is impossible for this situation to arise in meshes
122  // containing elements of uniform p-order. This is here so
123  // that it can be overloaded for p-refineable elements.
124  return 0;
125  }
126 
131  virtual void build(Mesh*& mesh_pt,
132  Vector<Node*>& new_node_pt,
133  bool& was_already_built,
134  std::ofstream& new_nodes_file);
135 
138  void check_integrity(double& max_error);
139 
141  void output_corners(std::ostream& outfile, const std::string& colour) const;
142 
145  {
146  return dynamic_cast<BinaryTree*>(Tree_pt);
147  }
148 
151  {
152  return dynamic_cast<BinaryTree*>(Tree_pt);
153  }
154 
157 
158  protected:
161  static std::map<unsigned, DenseMatrix<int>> Father_bound;
162 
165  void setup_father_bounds();
166 
168  void setup_hang_for_value(const int& value_id) {}
169 
171  void binary_hang_helper(const int& value_id,
172  const int& my_edge,
173  std::ofstream& output_hangfile)
174  {
175  }
176  };
177 
178 
179  //=======================================================================
181  //=======================================================================
182  template<>
183  class RefineableSolidQElement<1> : public virtual RefineableQElement<1>,
184  public virtual RefineableSolidElement,
185  public virtual QSolidElementBase
186  {
187  public:
191  {
192  // Issue a warning about this class
193  std::string warning_message =
194  "The class RefinableSolidQElement<1> has not been implemented or\n";
195  warning_message +=
196  "tested. It is safest to assume that all functions do not do what\n";
197  warning_message +=
198  "they claim to. The `build()' function is deliberately broken.";
199 
200  throw OomphLibWarning(
201  warning_message,
202  "RefineableSolidQElement<1>::RefineableSolidQElement()",
204  }
205 
208 
210  /*void operator=(const RefineableSolidQElement<1>&) = delete;*/
211 
214 
215 
217  void set_macro_elem_pt(MacroElement* macro_elem_pt)
218  {
220  }
221 
223  void set_macro_elem_pt(MacroElement* macro_elem_pt,
224  MacroElement* undeformed_macro_elem_pt)
225  {
227  undeformed_macro_elem_pt);
228  }
229 
232  void get_jacobian(Vector<double>& residuals, DenseMatrix<double>& jacobian)
233  {
234  RefineableSolidElement::get_jacobian(residuals, jacobian);
235  }
236 
239  // NOTE: FOR SOME REASON THIS NEEDS TO LIVE IN *.H TO WORK ON INTEL
240  void build(Mesh*& mesh_pt,
241  Vector<Node*>& new_node_pt,
242  bool& was_already_built,
243  std::ofstream& new_nodes_file)
244  {
245  throw OomphLibError("This function has not been implemented yet:",
248  }
249  };
250 
251 } // namespace oomph
252 
253 #endif
Definition: binary_tree.h:92
virtual void get_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Definition: elements.h:990
Base class for all line elements.
Definition: Qelements.h:466
Definition: macro_element.h:73
Definition: mesh.h:67
Definition: nodes.h:906
Definition: oomph_definitions.h:222
Definition: oomph_definitions.h:267
Base class for Solid Qelements.
Definition: Qelements.h:331
virtual void set_macro_elem_pt(MacroElement *macro_elem_pt)
Broken assignment operator.
Definition: Qelements.h:349
Definition: refineable_elements.h:97
Definition: refineable_line_element.h:66
Node * node_created_by_son_of_neighbour(const Vector< double > &s_fraction, bool &is_periodic)
Definition: refineable_line_element.h:118
unsigned required_nsons() const
A refineable line element has two sons.
Definition: refineable_line_element.h:100
RefineableQElement(const RefineableQElement< 1 > &dummy)=delete
Broken copy constructor.
BinaryTree * binary_tree_pt() const
Pointer to binary tree representation of this element (const version)
Definition: refineable_line_element.h:150
static std::map< unsigned, DenseMatrix< int > > Father_bound
Definition: refineable_line_element.h:161
void setup_hanging_nodes(Vector< std::ofstream * > &output_stream)
Line elements have no hanging nodes so this is deliberately left empty.
Definition: refineable_line_element.h:156
void binary_hang_helper(const int &value_id, const int &my_edge, std::ofstream &output_hangfile)
Line elements have no hanging nodes so this is deliberately left empty.
Definition: refineable_line_element.h:171
RefineableQElement()
Constructor: Pass refinement level (default 0 = root)
Definition: refineable_line_element.h:73
BinaryTree * binary_tree_pt()
Pointer to binary tree representation of this element.
Definition: refineable_line_element.h:144
void setup_hang_for_value(const int &value_id)
Line elements have no hanging nodes so this is deliberately left empty.
Definition: refineable_line_element.h:168
virtual ~RefineableQElement()
Broken assignment operator.
Definition: refineable_line_element.h:92
Definition: Qelements.h:2259
Definition: refineable_elements.h:874
Refineable version of Solid line elements.
Definition: refineable_line_element.h:186
RefineableSolidQElement()
Constructor, just call the constructor of the RefineableQElement<1>
Definition: refineable_line_element.h:189
void build(Mesh *&mesh_pt, Vector< Node * > &new_node_pt, bool &was_already_built, std::ofstream &new_nodes_file)
Definition: refineable_line_element.h:240
RefineableSolidQElement(const RefineableSolidQElement< 1 > &dummy)=delete
Broken copy constructor.
void get_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Definition: refineable_line_element.h:232
void set_macro_elem_pt(MacroElement *macro_elem_pt, MacroElement *undeformed_macro_elem_pt)
Final over-ride: Use version in QSolidElementBase.
Definition: refineable_line_element.h:223
virtual ~RefineableSolidQElement()
Broken assignment operator.
Definition: refineable_line_element.h:213
void set_macro_elem_pt(MacroElement *macro_elem_pt)
Final over-ride: Use version in QSolidElementBase.
Definition: refineable_line_element.h:217
Definition: Qelements.h:2286
double max_error
Definition: MortaringCantileverCompareToNonMortaring.cpp:188
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286
Vector< std::string > colour
Tecplot colours.
Definition: oomph_utilities.cc:1159
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