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// Version 1.0; svn revision $LastChangedRevision$
7 //LIC//
8 //LIC// $LastChangedDate$
9 //LIC//
10 //LIC// Copyright (C) 2006-2016 Matthias Heil and Andrew Hazel
11 //LIC//
12 //LIC// This library is free software; you can redistribute it and/or
13 //LIC// modify it under the terms of the GNU Lesser General Public
14 //LIC// License as published by the Free Software Foundation; either
15 //LIC// version 2.1 of the License, or (at your option) any later version.
16 //LIC//
17 //LIC// This library is distributed in the hope that it will be useful,
18 //LIC// but WITHOUT ANY WARRANTY; without even the implied warranty of
19 //LIC// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 //LIC// Lesser General Public License for more details.
21 //LIC//
22 //LIC// You should have received a copy of the GNU Lesser General Public
23 //LIC// License along with this library; if not, write to the Free Software
24 //LIC// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
25 //LIC// 02110-1301 USA.
26 //LIC//
27 //LIC// The authors may be contacted at oomph-lib@maths.man.ac.uk.
28 //LIC//
29 //LIC//====================================================================
30 //Header file for Tri/Tet axisym linear elasticity elements
31 #ifndef OOMPH_TAXISYM_LINEAR_ELASTICITY_ELEMENTS_HEADER
32 #define OOMPH_TAXISYM_LINEAR_ELASTICITY_ELEMENTS_HEADER
33 
34 
35 // Config header generated by autoconfig
36 #ifdef HAVE_CONFIG_H
37  #include <oomph-lib-config.h>
38 #endif
39 
40 
41 //OOMPH-LIB headers
42 #include "../generic/nodes.h"
43 #include "../generic/oomph_utilities.h"
44 #include "../generic/Telements.h"
46 #include "../generic/error_estimator.h"
47 
48 
49 namespace oomph
50 {
51 
52 /////////////////////////////////////////////////////////////////////////
53 /////////////////////////////////////////////////////////////////////////
54 // axisym TLinearElasticityElement
55 ////////////////////////////////////////////////////////////////////////
56 ////////////////////////////////////////////////////////////////////////
57 
58 
59 //======================================================================
60 /// TAxisymAxisymmetricLinearElasticityElement<NNODE_1D> elements are
61 /// isoparametric triangular AxisymmetricLinearElasticity elements with
62 /// NNODE_1D nodal points along each
63 /// element edge. Inherits from TElement and
64 /// AxisymmetricLinearElasticityEquations
65 //======================================================================
66 template <unsigned NNODE_1D>
68  public virtual TElement<2,NNODE_1D>,
70  public virtual ElementWithZ2ErrorEstimator
71  {
72 
73  public:
74 
75  ///\short Constructor: Call constructors for TElement and
76  /// AxisymmetricLinearElasticity equations
79 
80 
81  /// Broken copy constructor
84  {
85  BrokenCopy::broken_copy("TAxisymmetricLinearElasticityElement");
86  }
87 
88  /// Broken assignment operator
90  {
91  BrokenCopy::broken_assign("TAxisymmetricLinearElasticityElement");
92  }
93 
94  /// \short Output function:
95  void output(std::ostream &outfile)
96  {
98  }
99 
100  /// \short Output function:
101  void output(std::ostream &outfile, const unsigned &nplot)
102  {
104  }
105 
106 
107  /// \short C-style output function:
108  void output(FILE* file_pt)
109  {
111  }
112 
113  /// \short C-style output function:
114  void output(FILE* file_pt, const unsigned &n_plot)
115  {
117  }
118 
119  /// \short Number of vertex nodes in the element
120  unsigned nvertex_node() const
122 
123  /// \short Pointer to the j-th vertex node in the element
124  Node* vertex_node_pt(const unsigned& j) const
125  {
127  }
128 
129  /// \short Order of recovery shape functions for Z2 error estimation:
130  /// Same order as shape functions.
131  unsigned nrecovery_order() {return NNODE_1D-1;}
132 
133  /// Number of 'flux' terms for Z2 error estimation
134  unsigned num_Z2_flux_terms()
135  {
136  return 6;
137  }
138 
139  /// \short Get 'flux' for Z2 error recovery: Upper triangular entries
140  /// in strain tensor.
142  {
143 
144 #ifdef PARANOID
145  unsigned num_entries=6;
146  if (flux.size()!=num_entries)
147  {
148  std::ostringstream error_message;
149  error_message << "The flux vector has the wrong number of entries, "
150  << flux.size() << ", whereas it should be "
151  << num_entries << std::endl;
152  throw OomphLibError(
153  error_message.str(),
154  OOMPH_CURRENT_FUNCTION,
155  OOMPH_EXCEPTION_LOCATION);
156  }
157 #endif
158 
159  // Get strain matrix
160  DenseMatrix<double> strain(3);
161  this->get_strain(s,strain);
162 
163  // Pack into flux Vector
164  unsigned icount=0;
165 
166  // Start with diagonal terms
167  for(unsigned i=0;i<3;i++)
168  {
169  flux[icount]=strain(i,i);
170  icount++;
171  }
172 
173  //Off diagonals row by row
174  for(unsigned i=0;i<3;i++)
175  {
176  for(unsigned j=i+1;j<3;j++)
177  {
178  flux[icount]=strain(i,j);
179  icount++;
180  }
181  }
182  }
183 };
184 
185 //=======================================================================
186 /// Face geometry for the TAxisymmetricLinearElasticityElement elements: The spatial
187 /// dimension of the face elements is one lower than that of the
188 /// bulk element but they have the same number of points
189 /// along their 1D edges.
190 //=======================================================================
191 template<unsigned NNODE_1D>
193  public virtual TElement<1,NNODE_1D>
194 {
195 
196  public:
197 
198  /// \short Constructor: Call the constructor for the
199  /// appropriate lower-dimensional QElement
200  FaceGeometry() : TElement<1,NNODE_1D>() {}
201 
202 };
203 
204 
205 }
206 
207 #endif
void output(std::ostream &outfile)
Output function:
void broken_copy(const std::string &class_name)
Issue error message and terminate execution.
Base class for finite elements that can compute the quantities that are required for the Z2 error est...
void operator=(const TAxisymmetricLinearElasticityElement< NNODE_1D > &)
Broken assignment operator.
unsigned nrecovery_order()
Order of recovery shape functions for Z2 error estimation: Same order as shape functions.
TAxisymmetricLinearElasticityElement(const TAxisymmetricLinearElasticityElement< NNODE_1D > &dummy)
Broken copy constructor.
cstr elem_len * i
Definition: cfortran.h:607
Node * vertex_node_pt(const unsigned &j) const
Pointer to the j-th vertex node in the element.
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.
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
Definition: nodes.h:852
unsigned num_Z2_flux_terms()
Number of &#39;flux&#39; terms for Z2 error estimation.
void output(FILE *file_pt)
C-style output function:
void get_Z2_flux(const Vector< double > &s, Vector< double > &flux)
Get &#39;flux&#39; for Z2 error recovery: Upper triangular entries in strain tensor.
void output(FILE *file_pt, const unsigned &n_plot)
C-style output function:
TAxisymmetricLinearElasticityElement()
Constructor: Call constructors for TElement and AxisymmetricLinearElasticity equations.
static char t char * s
Definition: cfortran.h:572
unsigned nvertex_node() const
Number of vertex nodes in the element.
void broken_assign(const std::string &class_name)
Issue error message and terminate execution.
void output(std::ostream &outfile, const unsigned &nplot)
Output function:
FaceGeometry()
Constructor: Call the constructor for the appropriate lower-dimensional QElement. ...