Taxisym_linear_elasticity_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-2023 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 Tri/Tet axisym linear elasticity elements
27 #ifndef OOMPH_TAXISYM_LINEAR_ELASTICITY_ELEMENTS_HEADER
28 #define OOMPH_TAXISYM_LINEAR_ELASTICITY_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"
42 #include "../generic/error_estimator.h"
43 
44 
45 namespace oomph
46 {
47  /// //////////////////////////////////////////////////////////////////////
48  /// //////////////////////////////////////////////////////////////////////
49  // axisym TLinearElasticityElement
50  /// /////////////////////////////////////////////////////////////////////
51  /// /////////////////////////////////////////////////////////////////////
52 
53 
54  //======================================================================
55  /// TAxisymAxisymmetricLinearElasticityElement<NNODE_1D> elements are
56  /// isoparametric triangular AxisymmetricLinearElasticity elements with
57  /// NNODE_1D nodal points along each
58  /// element edge. Inherits from TElement and
59  /// AxisymmetricLinearElasticityEquations
60  //======================================================================
61  template<unsigned NNODE_1D>
63  : public virtual TElement<2, NNODE_1D>,
65  public virtual ElementWithZ2ErrorEstimator
66  {
67  public:
68  /// Constructor: Call constructors for TElement and
69  /// AxisymmetricLinearElasticity equations
72  {
73  }
74 
75 
76  /// Broken copy constructor
79 
80  /// Broken assignment operator
82  delete;
83 
84  /// Output function:
85  void output(std::ostream& outfile)
86  {
88  }
89 
90  /// Output function:
91  void output(std::ostream& outfile, const unsigned& nplot)
92  {
94  }
95 
96 
97  /// C-style output function:
98  void output(FILE* file_pt)
99  {
101  }
102 
103  /// C-style output function:
104  void output(FILE* file_pt, const unsigned& n_plot)
105  {
107  }
108 
109  /// Number of vertex nodes in the element
110  unsigned nvertex_node() const
111  {
113  }
114 
115  /// Pointer to the j-th vertex node in the element
116  Node* vertex_node_pt(const unsigned& j) const
117  {
119  }
120 
121  /// Order of recovery shape functions for Z2 error estimation:
122  /// Same order as shape functions.
123  unsigned nrecovery_order()
124  {
125  return NNODE_1D - 1;
126  }
127 
128  /// Number of 'flux' terms for Z2 error estimation
129  unsigned num_Z2_flux_terms()
130  {
131  return 6;
132  }
133 
134  /// Get 'flux' for Z2 error recovery: Upper triangular entries
135  /// in strain tensor.
137  {
138 #ifdef PARANOID
139  unsigned num_entries = 6;
140  if (flux.size() != num_entries)
141  {
142  std::ostringstream error_message;
143  error_message << "The flux vector has the wrong number of entries, "
144  << flux.size() << ", whereas it should be " << num_entries
145  << std::endl;
146  throw OomphLibError(error_message.str(),
147  OOMPH_CURRENT_FUNCTION,
148  OOMPH_EXCEPTION_LOCATION);
149  }
150 #endif
151 
152  // Get strain matrix
153  DenseMatrix<double> strain(3);
154  this->get_strain(s, strain);
155 
156  // Pack into flux Vector
157  unsigned icount = 0;
158 
159  // Start with diagonal terms
160  for (unsigned i = 0; i < 3; i++)
161  {
162  flux[icount] = strain(i, i);
163  icount++;
164  }
165 
166  // Off diagonals row by row
167  for (unsigned i = 0; i < 3; i++)
168  {
169  for (unsigned j = i + 1; j < 3; j++)
170  {
171  flux[icount] = strain(i, j);
172  icount++;
173  }
174  }
175  }
176  };
177 
178  //=======================================================================
179  /// Face geometry for the TAxisymmetricLinearElasticityElement elements: The
180  /// spatial dimension of the face elements is one lower than that of the bulk
181  /// element but they have the same number of points along their 1D edges.
182  //=======================================================================
183  template<unsigned NNODE_1D>
185  : public virtual TElement<1, NNODE_1D>
186  {
187  public:
188  /// Constructor: Call the constructor for the
189  /// appropriate lower-dimensional QElement
190  FaceGeometry() : TElement<1, NNODE_1D>() {}
191  };
192 
193 
194 } // namespace oomph
195 
196 #endif
static char t char * s
Definition: cfortran.h:568
cstr elem_len * i
Definition: cfortran.h:603
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
void get_strain(const Vector< double > &s, DenseMatrix< double > &strain)
Get strain (3x3 entries; r, z, phi)
void output(std::ostream &outfile)
Output: r,z, u_r, u_z, u_theta.
Base class for finite elements that can compute the quantities that are required for the Z2 error est...
FaceGeometry()
Constructor: Call the constructor for the appropriate lower-dimensional QElement.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
Definition: elements.h:4998
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
Definition: nodes.h:906
An OomphLibError object which should be thrown when an run-time error is encountered....
//////////////////////////////////////////////////////////////////////
unsigned nrecovery_order()
Order of recovery shape functions for Z2 error estimation: Same order as shape functions.
TAxisymmetricLinearElasticityElement(const TAxisymmetricLinearElasticityElement< NNODE_1D > &dummy)=delete
Broken copy constructor.
TAxisymmetricLinearElasticityElement()
Constructor: Call constructors for TElement and AxisymmetricLinearElasticity equations.
unsigned nvertex_node() const
Number of vertex nodes in the element.
void output(std::ostream &outfile)
Output function:
void output(FILE *file_pt, const unsigned &n_plot)
C-style output function:
void output(FILE *file_pt)
C-style output function:
unsigned num_Z2_flux_terms()
Number of 'flux' terms for Z2 error estimation.
void operator=(const TAxisymmetricLinearElasticityElement< NNODE_1D > &)=delete
Broken assignment operator.
void output(std::ostream &outfile, const unsigned &nplot)
Output function:
Node * vertex_node_pt(const unsigned &j) const
Pointer to the j-th vertex node in the element.
void get_Z2_flux(const Vector< double > &s, Vector< double > &flux)
Get 'flux' for Z2 error recovery: Upper triangular entries in strain tensor.
General TElement class.
Definition: Telements.h:1208
//////////////////////////////////////////////////////////////////// ////////////////////////////////...