axisym_cylindrical_solid_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-2026 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// Header file for axisymmetric solid mechanics elements
28#ifndef OOMPH_AXISYM_CYLINDRICAL_ELASTICITY_ELEMENTS_HEADER
29#define OOMPH_AXISYM_CYLINDRICAL_ELASTICITY_ELEMENTS_HEADER
30
31// Config header generated by autoconfig
32#ifdef HAVE_CONFIG_H
33#include <oomph-lib-config.h>
34#endif
35
36// OOMPH-LIB headers
37#include "../generic/Telements.h"
38#include "../constitutive/constitutive_laws.h"
39#include "../generic/error_estimator.h"
40#include "../generic/projection.h"
41
42namespace oomph
43{
44 //=====================================================================
45 /// A class for elements that solve the equations of solid mechanics,
46 /// based on the principle of virtual displacements in
47 /// an axisymmetric formulation. In this case, x[0] and x[1] are the
48 /// radial and vertical coordinates, respectively, in the deformed
49 /// configuration.
50 //=====================================================================
52 {
53 private:
54 /// Static default value for timescale ratio (1.0 -- for natural scaling)
56
57 /// Static default value for damping parameters
58 static double Default_eta_value;
59
60 public:
61 /// Function pointer to function that specifies the body force
62 /// as a function of the Lagrangian coordinates and time FCT(t,xi,b) --
63 /// xi and b are Vectors!
64 typedef void (*BodyForceFctPt)(const double& t,
65 const Vector<double>& xi,
67
68 /// Constructor
76
77 /// Return the constitutive law pointer
82
83 /// Access function for timescale ratio (nondim density)
84 const double& lambda_sq() const
85 {
86 return *Lambda_sq_pt;
87 }
88
89 /// Access function for pointer to timescale ratio (nondim density)
90 double*& lambda_sq_pt()
91 {
92 return Lambda_sq_pt;
93 }
94
95 /// Access function: Pointer to body force function
100
101 /// Access function: Pointer to body force function (const version)
103 {
104 return Body_force_fct_pt;
105 }
106
107 /// Return the mass damping parameter
108 double eta_mass()
109 {
110 return *Eta_mass_pt;
111 }
112
113 /// Access function for mass damping parameter
114 double*& eta_mass_pt()
115 {
116 return Eta_mass_pt;
117 }
118
119 /// Evaluate body force at Lagrangian coordinate xi at present time
120 /// (returns zero vector if no body force function pointer has been set)
121 inline void body_force(const Vector<double>& xi, Vector<double>& b) const
122 {
123 // If no function has been set, return zero vector
124 if (Body_force_fct_pt == 0)
125 {
126 for (unsigned i = 0; i < 2; i++)
127 {
128 b[i] = 0.0;
129 }
130 }
131 else
132 {
133 // Get time from timestepper of first node (note that this must
134 // work -- body force only makes sense for elements that can be
135 // deformed and given that the deformation of solid finite elements
136 // is controlled by their nodes, nodes must exist!)
137 double time = node_pt(0)->time_stepper_pt()->time_pt()->time();
138
139 // Now evaluate the body force
140 (*Body_force_fct_pt)(time, xi, b);
141 }
142 }
143
144 /// Return the stress tensor, as calculated from the constitutive law
146 const DenseMatrix<double>& G,
147 DenseMatrix<double>& sigma)
148 {
149#ifdef PARANOID
150 // If the pointer to the constitutive law hasn't been set, issue an error
151 if (Constitutive_law_pt == 0)
152 {
153 std::string error_message =
154 "Elements derived from AxisymmetricCylindricalPVDEquations";
155 error_message += " must have a constitutive law :\n ";
156 error_message +=
157 "set one using the constitutive_law_pt() member function\n";
158
159 throw OomphLibError(
161 }
162#endif
164 }
165
166 /// Return the derivatives of the 2nd Piola Kirchhoff stress tensor,
167 /// as calculated from the constitutive law: Pass metric tensors in the
168 /// stress free and current configurations and the current value of the
169 /// the stress tensor.
171 const DenseMatrix<double>& G,
172 const DenseMatrix<double>& sigma,
174 {
175#ifdef PARANOID
176 // If the pointer to the constitutive law hasn't been set, issue an error
177 if (this->Constitutive_law_pt == 0)
178 {
179 // Write an error message
180 std::string error_message =
181 "Elements derived from PVDEquations must have a constitutive law:\n";
182 error_message +=
183 "set one using the constitutive_law_pt() member function";
184 // Throw the error
185 throw OomphLibError(
187 }
188#endif
189 // Only bother with the symmetric part by passing false as last entry
191 g, G, sigma, d_sigma_dG, false);
192 }
193
194 /// Fill in the residuals by calling the generic function
200
201 /// Fill in the jacobian
207
208 /// Get the strain
210 {
211 // Find out how many nodes there are in the element
212 const unsigned n_node = nnode();
213
214 // Set up memory for the shape and test functions
217
218 // Call the derivatives of the shape functions
220
221 // Calculate the local Lagrangian coordinates, position components
222 // and the derivatives of global position components
223 // wrt lagrangian coordinates, as well as acceleration
227
228 // Calculate displacements and derivatives
229 for (unsigned l = 0; l < n_node; l++)
230 {
231 // Loop over displacement components (deformed position)
232 for (unsigned i = 0; i < 2; i++)
233 {
234 // Set the value of the lagrangian coordinate
236 // Set the value of the position component
238 // Loop over Lagrangian derivative directions
239 for (unsigned j = 0; j < 2; j++)
240 {
241 // Calculate dX[i]/dxi_{j}
243 }
244 }
245 }
246
247 // We are now in a position to calculate the undeformed metric tensor
249 // r row
250 g(0, 0) = 1.0;
251 g(0, 1) = 0.0;
252 g(0, 2) = 0.0;
253 // z row
254 g(1, 0) = 0.0;
255 g(1, 1) = 1.0;
256 g(1, 2) = 0.0;
257 // phi row
258 g(2, 0) = 0.0;
259 g(2, 1) = 0.0;
260 g(2, 2) = interpolated_xi[0] * interpolated_xi[0];
261
262 // Now calculate the deformed metric tensor
264 // r row
265 G(0, 0) = interpolated_dXdxi(0, 0) * interpolated_dXdxi(0, 0) +
267 G(0, 1) = interpolated_dXdxi(0, 0) * interpolated_dXdxi(0, 1) +
269 G(0, 2) = 0.0;
270 // z row
271 G(1, 0) = G(0, 1);
272 G(1, 1) = interpolated_dXdxi(0, 1) * interpolated_dXdxi(0, 1) +
274 G(1, 2) = 0.0;
275 // phi row
276 G(2, 0) = 0.0;
277 G(2, 1) = 0.0;
278 G(2, 2) = interpolated_X[0] * interpolated_X[0];
279
280 // Fill in the strain tensor
281 for (unsigned i = 0; i < 3; i++)
282 {
283 for (unsigned j = 0; j < 3; j++)
284 {
285 strain(i, j) = 0.5 * (G(i, j) - g(i, j));
286 }
287 }
288 }
289
290 /// Get potential (strain) and kinetic energy
291 void get_energy(double& pot_en, double& kin_en)
292 {
293 // Initialise
294 pot_en = 0;
295 kin_en = 0;
296
297 // Set the value of n_intpt
298 unsigned n_intpt = this->integral_pt()->nweight();
299
300 // Set the Vector to hold local coordinates
301 Vector<double> s(2);
302
303 // Find out how many nodes there are
304 const unsigned n_node = this->nnode();
305
306 // Set up memory for the shape functions
309
310 // Timescale ratio (non-dim density)
311 double lambda_sq = this->lambda_sq();
312
313 // Loop over the integration points
314 for (unsigned ipt = 0; ipt < n_intpt; ipt++)
315 {
316 // Assign values of s
317 for (unsigned i = 0; i < 2; i++)
318 {
319 s[i] = this->integral_pt()->knot(ipt, i);
320 }
321
322 // Get the integral weight
323 double w = this->integral_pt()->weight(ipt);
324
325 // Call the derivatives of the shape functions and get Jacobian
326 double J = this->dshape_lagrangian_at_knot(ipt, psi, dpsidxi);
327
328 // Storage for Lagrangian coordinates and velocity (initialised to zero)
332 Vector<double> veloc(2, 0.0);
333
334 // Calculate lagrangian coordinates
335 for (unsigned l = 0; l < n_node; l++)
336 {
337 // Loop over displacement components (deformed position)
338 for (unsigned i = 0; i < 2; i++)
339 {
340 // Calculate the Lagrangian coordinates
342
343 // Set the value of the position component
345 // Loop over Lagrangian derivative directions
346 for (unsigned j = 0; j < 2; j++)
347 {
348 // Calculate dX[i]/dxi_{j}
350 }
351
352 // Calculate the velocity components
353 veloc[i] += this->dnodal_position_dt(l, i) * psi(l);
354 }
355 }
356
357 // We are now in a position to calculate the undeformed metric tensor
359 // r row
360 g(0, 0) = 1.0;
361 g(0, 1) = 0.0;
362 g(0, 2) = 0.0;
363 // z row
364 g(1, 0) = 0.0;
365 g(1, 1) = 1.0;
366 g(1, 2) = 0.0;
367 // phi row
368 g(2, 0) = 0.0;
369 g(2, 1) = 0.0;
370 g(2, 2) = interpolated_xi[0] * interpolated_xi[0];
371
372 // Now multiply the weight by the square-root of the undeformed metric
373 // tensor r
374 double W = w * J * sqrt(g(0, 0) * g(1, 1) * g(2, 2));
375
376 // Now calculate the deformed metric tensor
378 // r row
379 G(0, 0) = interpolated_dXdxi(0, 0) * interpolated_dXdxi(0, 0) +
381 G(0, 1) = interpolated_dXdxi(0, 0) * interpolated_dXdxi(0, 1) +
383 G(0, 2) = 0.0;
384 // z row
385 G(1, 0) = G(0, 1);
386 G(1, 1) = interpolated_dXdxi(0, 1) * interpolated_dXdxi(0, 1) +
388 G(1, 2) = 0.0;
389 // phi row
390 G(2, 0) = 0.0;
391 G(2, 1) = 0.0;
392 G(2, 2) = interpolated_X[0] * interpolated_X[0];
393
394 DenseMatrix<double> sigma(3);
396 // Now calculate the stress tensor from the constitutive law
397 this->get_stress(g, G, sigma);
398
399 // get the strain
400 this->get_strain(s, strain);
401
402 // Initialise
403 double local_pot_en = 0;
404 double veloc_sq = 0;
405
406 // Compute integrals
407 for (unsigned i = 0; i < 3; i++)
408 {
409 for (unsigned j = 0; j < 3; j++)
410 {
411 local_pot_en += sigma(i, j) * strain(i, j);
412 }
413 }
414 veloc_sq = veloc[0] * veloc[0] + veloc[1] * veloc[1];
415
416 pot_en += 0.5 * local_pot_en * W;
417 kin_en += lambda_sq * 0.5 * veloc_sq * W;
418 }
419 }
420
421 /// Return the residuals for the equations of solid mechanics
424 DenseMatrix<double>& jacobian,
425 const unsigned& flag);
426
427 /// Overload the output function
428 void output(std::ostream& outfile)
429 {
430 // If n_plot not provided, assume equal to 5 by default
431 const unsigned n_plot = 5;
433 }
434
435 /// Output function
436 void output(std::ostream& outfile, const unsigned& n_plot)
437 {
438 Vector<double> x(2);
439 Vector<double> xi(2);
440 Vector<double> s(2);
442
443 // Tecplot header info
444 outfile << this->tecplot_zone_string(n_plot);
445
446 // Loop over plot points
447 unsigned num_plot_points = this->nplot_points(n_plot);
448 for (unsigned iplot = 0; iplot < num_plot_points; iplot++)
449 {
450 // Get local coordinates of plot point
451 this->get_s_plot(iplot, n_plot, s);
452
453 // Get Eulerian and Lagrangian coordinates
454 this->interpolated_x(s, x);
455 this->interpolated_xi(s, xi);
456
457 // Get the strain
459
460 // Output the r,z
461 for (unsigned i = 0; i < 2; i++)
462 {
463 outfile << x[i] << " ";
464 }
465
466 // Output xi0,xi1
467 for (unsigned i = 0; i < 2; i++)
468 {
469 outfile << xi[i] << " ";
470 }
471
472 // Output strain components
473 outfile << strain(0, 0) << " " << strain(1, 1) << " " << strain(0, 1)
474 << " " << strain(2, 2);
475
476 outfile << std::endl;
477 }
478
479 // Write tecplot footer (e.g. FE connectivity lists)
480 this->write_tecplot_zone_footer(outfile, n_plot);
481 }
482
483 /// Overload the output function
485 {
486 // If n_plot not provided, assume equal to 5 by default
487 const unsigned n_plot = 5;
489 }
490
491 /// Output function
492 void output(FILE* file_pt, const unsigned& n_plot) {}
493
494 /// returns the number of DOF types associated with this element.
495 unsigned ndof_types() const
496 {
497 return 2;
498 }
499
500 ///--------Paraview stuff------------------------------------------///
501 /// Number of scalars/fields output by this element. Reimplements
502 /// broken virtual function in base class.
503 unsigned nscalar_paraview() const
504 {
505 return 6;
506 }
507
508 /// Write values of the i-th scalar field at the plot points. Needs
509 /// to be implemented for each new specific element type.
510 void scalar_value_paraview(std::ofstream& file_out,
511 const unsigned& i,
512 const unsigned& nplot) const
513 {
514 // Vector of local coordinates
515 Vector<double> s(2);
516
517 // Container for strain
519
520 // Container for Lagrangian coordinates
521 Vector<double> xi(2);
522
523 // Loop over plot points
525 for (unsigned iplot = 0; iplot < num_plot_points; iplot++)
526 {
527 // Get local coordinates of plot point
528 get_s_plot(iplot, nplot, s, true);
529
530 // Get the lagrangian coordinates
531 interpolated_xi(s, xi);
532
533 // Get the strain
535
536 // Output Lagrangian coordinates
537 if (i < 2)
538 {
539 file_out << xi[i] << std::endl;
540 }
541 // Strain components
542 else if (i == 2)
543 {
544 file_out << strain(0, 0) << std::endl;
545 }
546 else if (i == 3)
547 {
548 file_out << strain(1, 1) << std::endl;
549 }
550 else if (i == 4)
551 {
552 file_out << strain(0, 1) << std::endl;
553 }
554 else if (i == 5)
555 {
556 file_out << strain(2, 2) << std::endl;
557 }
558
559 // Never get here
560 else
561 {
562#ifdef PARANOID
563 std::stringstream error_stream;
564 error_stream << "These elements only output " << 6 << " fields, "
565 << "but i is currently " << i << std::endl;
566 throw OomphLibError(error_stream.str(),
569#endif
570 }
571 }
572 }
573
574 /// Name of the i-th scalar field. Default implementation
575 /// returns V1 for the first one, V2 for the second etc. Can (should!) be
576 /// overloaded with more meaningful names in specific elements.
577 std::string scalar_name_paraview(const unsigned& i) const
578 {
579 // Lagrangian coordinates
580 if (i == 0)
581 {
582 return "Lagrangian coord. r";
583 }
584 else if (i == 1)
585 {
586 return "Lagrangian coord. z";
587 }
588 // Strain components
589 else if (i == 2)
590 {
591 return "Strain r-r";
592 }
593 else if (i == 3)
594 {
595 return "Strain z-z";
596 }
597 else if (i == 4)
598 {
599 return "Strain r-z";
600 }
601 else if (i == 5)
602 {
603 return "Strain phi-phi";
604 }
605 // Never get here
606 else
607 {
608 std::stringstream error_stream;
609 error_stream << "These elements only output " << 6 << " fields,\n"
610 << "but i is currently " << i << std::endl;
611 throw OomphLibError(
613 // Dummy return
614 return " ";
615 }
616 }
617
618 protected:
619 /// Pointer to constitutive law
621
622 /// Timescale ratio (non-dim. density)
624
625 /// Pointer to the mass damping parameter
626 double* Eta_mass_pt;
627
628 /// Pointer to body force function
630 };
631
632
633 //============================================================
634 /// AxisymCylindricalPVDElement upgraded to become projectable
635 //============================================================
636 template<class PVD_ELEMENT>
638 : public virtual ProjectableElement<PVD_ELEMENT>
639 {
640 public:
641 /// Constructor [this was only required explicitly
642 /// from gcc 4.5.2 onwards...]
644
645 /// Specify the values associated with field fld.
646 /// The information is returned in a vector of pairs which comprise
647 /// the Data object and the value within it, that correspond to field
648 /// fld. In the underlying PVD elements there are no field values
650 {
651 // Create the vector
653
654 // Return the vector
655 return data_values;
656 }
657
658 /// Number of fields to be projected: 0
660 {
661 return 0;
662 }
663
664 /// Number of history values to be stored for fld-th field
665 /// (Includes the current value!). No nodal data.
666 unsigned nhistory_values_for_projection(const unsigned& fld)
667 {
668 return 0;
669 }
670
671 /// Number of positional history values (Includes the current value!)
676
677 /// Return Jacobian of mapping and shape functions of field fld
678 /// at local coordinate s
679 double jacobian_and_shape_of_field(const unsigned& fld,
680 const Vector<double>& s,
681 Shape& psi)
682 {
683 // Return the Jacobian of the eulerian mapping
684 return this->J_eulerian(s);
685 }
686
687 /// Return interpolated field fld at local coordinate s, at time
688 /// level t (t=0: present; t>0: history values)
689 double get_field(const unsigned& t,
690 const unsigned& fld,
691 const Vector<double>& s)
692 {
693 // Dummy return
694 return 0.0;
695 }
696
697
698 /// Return number of values in field fld
699 unsigned nvalue_of_field(const unsigned& fld)
700 {
701 return 0;
702 }
703
704
705 /// Return local equation number of value j in field fld.
706 int local_equation(const unsigned& fld, const unsigned& j)
707 {
708 return -1;
709 }
710 };
711
712
713 //=======================================================================
714 /// Face geometry for element is the same as that for the underlying
715 /// wrapped element
716 //=======================================================================
717 template<class ELEMENT>
719 : public virtual FaceGeometry<ELEMENT>
720 {
721 public:
722 FaceGeometry() : FaceGeometry<ELEMENT>() {}
723 };
724
725
726 //=======================================================================
727 /// Face geometry of the Face Geometry for element is the same as
728 /// that for the underlying wrapped element
729 //=======================================================================
730 template<class ELEMENT>
733 : public virtual FaceGeometry<FaceGeometry<ELEMENT>>
734 {
735 public:
737 };
738
739
740 //===========================================================================
741 /// QElements
742 //===========================================================================
743 template<unsigned NNODE_1D>
745 : public virtual SolidQElement<2, NNODE_1D>,
747 {
748 public:
749 /// Constructor, there are no internal data points
754
755 /// Output function
760
761 /// Output function
762 void output(std::ostream& outfile, const unsigned& n_plot)
763 {
765 }
766
767 /// C-style output function
772
773 /// C-style output function
778 };
779
780 //============================================================================
781 /// FaceGeometry of a QAxisymCylindricalPVDElement
782 //============================================================================
783 template<unsigned NNODE_1D>
785 : public virtual SolidQElement<1, NNODE_1D>
786 {
787 public:
788 /// Constructor must call the constructor of the underlying solid element
790 };
791
792
793 //============================================================================
794 /// FaceGeometry of the FaceGeometry of a QAxisymCylindricalPVDElement
795 //============================================================================
796 template<unsigned NNODE_1D>
798 : public virtual PointElement
799 {
800 public:
801 // Make sure that we call the constructor of the SolidQElement
802 // Only the Intel compiler seems to need this!
804 };
805
806 //===========================================================================
807 /// An Element that solves the axisymmetric solid mechanics equations,
808 /// based on the principle of virtual displacements in cylindrical polar
809 /// coordinates, using SolidTElements for the interpolation of the
810 /// variable positions.
811 //============================================================================
812 template<unsigned NNODE_1D>
814 : public virtual SolidTElement<2, NNODE_1D>,
816 public virtual ElementWithZ2ErrorEstimator
817 {
818 public:
819 /// Constructor, there are no internal data points
824
825 /// Output function
830
831 /// Output function
832 void output(std::ostream& outfile, const unsigned& n_plot)
833 {
835 }
836
837
838 /// C-style output function
843
844 /// C-style output function
849
850 /// Order of recovery shape functions for Z2 error estimation:
851 /// Same order as shape functions.
853 {
854 return (NNODE_1D - 1);
855 }
856
857 /// Number of vertex nodes in the element
858 unsigned nvertex_node() const
859 {
861 }
862
863 /// Pointer to the j-th vertex node in the element
864 Node* vertex_node_pt(const unsigned& j) const
865 {
867 }
868
869 /// Function to describe the local dofs of the element. The ostream
870 /// specifies the output stream to which the description
871 /// is written; the string stores the currently
872 /// assembled output that is ultimately written to the
873 /// output stream by Data::desribe_dofs(...); it is typically
874 /// built up incrementally as we descend through the
875 /// call hierarchy of this function when called from
876 /// Problem::describe_dofs(...)
878
879 /// Number of 'flux' terms for Z2 error estimation
881 {
882 // Six flux terms
883 return 6;
884 }
885
886 /// Get 'flux' for Z2 error recovery: Upper triangular entries
887 /// in strain tensor.
889 {
890#ifdef PARANOID
891 unsigned num_entries = 6;
892 if (flux.size() != num_entries)
893 {
894 std::ostringstream error_message;
895 error_message << "The flux vector has the wrong number of entries, "
896 << flux.size() << ", whereas it should be " << num_entries
897 << std::endl;
898 throw OomphLibError(error_message.str(),
901 }
902#endif
903
904 // Get strain matrix
906 this->get_strain(s, strain);
907
908 // Pack into flux Vector
909 unsigned icount = 0;
910
911 // Start with diagonal terms
912 for (unsigned i = 0; i < 3; i++)
913 {
914 flux[icount] = strain(i, i);
915 icount++;
916 }
917 // Off diagonals row by row
918 for (unsigned i = 0; i < 3; i++)
919 {
920 for (unsigned j = i + 1; j < 3; j++)
921 {
922 flux[icount] = strain(i, j);
923 icount++;
924 }
925 }
926 }
927 };
928
929
930 //============================================================================
931 /// FaceGeometry of a TAxisymCylindricalPVDElement
932 //============================================================================
933 template<unsigned NNODE_1D>
935 : public virtual SolidTElement<1, NNODE_1D>
936 {
937 public:
938 /// Constructor must call the constructor of the underlying solid
939 /// element
941 };
942
943
944 //============================================================================
945 /// FaceGeometry of the FaceGeometry of the TAxisymCylindricalPVDElement
946 //============================================================================
947 template<unsigned NNODE_1D>
949 : public virtual PointElement
950 {
951 public:
952 // Make sure that we call the constructor of the SolidQElement
953 // Only the Intel compiler seems to need this!
955 };
956} // namespace oomph
957
958#endif
static char t char * s
Definition cfortran.h:568
cstr elem_len * i
Definition cfortran.h:603
char t
Definition cfortran.h:568
A class for elements that solve the equations of solid mechanics, based on the principle of virtual d...
void scalar_value_paraview(std::ofstream &file_out, const unsigned &i, const unsigned &nplot) const
Write values of the i-th scalar field at the plot points. Needs to be implemented for each new specif...
ConstitutiveLaw * Constitutive_law_pt
Pointer to constitutive law.
void get_stress(const DenseMatrix< double > &g, const DenseMatrix< double > &G, DenseMatrix< double > &sigma)
Return the stress tensor, as calculated from the constitutive law.
static double Default_lambda_sq_value
Static default value for timescale ratio (1.0 – for natural scaling)
unsigned nscalar_paraview() const
-----—Paraview stuff---------------------------------------—/// Number of scalars/fields output by th...
void output(FILE *file_pt, const unsigned &n_plot)
Output function.
void output(std::ostream &outfile)
Overload the output function.
double eta_mass()
Return the mass damping parameter.
void body_force(const Vector< double > &xi, Vector< double > &b) const
Evaluate body force at Lagrangian coordinate xi at present time (returns zero vector if no body force...
BodyForceFctPt body_force_fct_pt() const
Access function: Pointer to body force function (const version)
std::string scalar_name_paraview(const unsigned &i) const
Name of the i-th scalar field. Default implementation returns V1 for the first one,...
virtual void fill_in_contribution_to_residuals_axisym_pvd(Vector< double > &residuals, DenseMatrix< double > &jacobian, const unsigned &flag)
Return the residuals for the equations of solid mechanics.
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Fill in the residuals by calling the generic function.
BodyForceFctPt & body_force_fct_pt()
Access function: Pointer to body force function.
unsigned ndof_types() const
returns the number of DOF types associated with this element.
void output(FILE *file_pt)
Overload the output function.
void get_strain(const Vector< double > &s, DenseMatrix< double > &strain) const
Get the strain.
BodyForceFctPt Body_force_fct_pt
Pointer to body force function.
double * Eta_mass_pt
Pointer to the mass damping parameter.
ConstitutiveLaw *& constitutive_law_pt()
Return the constitutive law pointer.
const double & lambda_sq() const
Access function for timescale ratio (nondim density)
void get_d_stress_dG_upper(const DenseMatrix< double > &g, const DenseMatrix< double > &G, const DenseMatrix< double > &sigma, RankFourTensor< double > &d_sigma_dG)
Return the derivatives of the 2nd Piola Kirchhoff stress tensor, as calculated from the constitutive ...
void output(std::ostream &outfile, const unsigned &n_plot)
Output function.
double *& lambda_sq_pt()
Access function for pointer to timescale ratio (nondim density)
void get_energy(double &pot_en, double &kin_en)
Get potential (strain) and kinetic energy.
static double Default_eta_value
Static default value for damping parameters.
double * Lambda_sq_pt
Timescale ratio (non-dim. density)
void(* BodyForceFctPt)(const double &t, const Vector< double > &xi, Vector< double > &b)
Function pointer to function that specifies the body force as a function of the Lagrangian coordinate...
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Fill in the jacobian.
double *& eta_mass_pt()
Access function for mass damping parameter.
A class for constitutive laws for elements that solve the equations of solid mechanics based upon the...
virtual void calculate_d_second_piola_kirchhoff_stress_dG(const DenseMatrix< double > &g, const DenseMatrix< double > &G, const DenseMatrix< double > &sigma, RankFourTensor< double > &d_sigma_dG, const bool &symmetrize_tensor=true)
Calculate the derivatives of the contravariant 2nd Piola Kirchhoff stress tensor with respect to the ...
virtual void calculate_second_piola_kirchhoff_stress(const DenseMatrix< double > &g, const DenseMatrix< double > &G, DenseMatrix< double > &sigma)=0
Calculate the contravariant 2nd Piola Kirchhoff stress tensor. Arguments are the covariant undeformed...
A Class for the derivatives of shape functions The class design is essentially the same as Shape,...
Definition shape.h:278
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
Definition nodes.h:238
Base class for finite elements that can compute the quantities that are required for the Z2 error est...
FaceGeometry()
Constructor must call the constructor of the underlying solid element.
FaceGeometry()
Constructor must call the constructor of the underlying solid element.
FaceGeometry class definition: This policy class is used to allow construction of face elements that ...
Definition elements.h:5002
virtual unsigned nplot_points_paraview(const unsigned &nplot) const
Return the number of actual plot points for paraview plot with parameter nplot. Broken virtual; can b...
Definition elements.h:2866
virtual double J_eulerian(const Vector< double > &s) const
Return the Jacobian of mapping from local to global coordinates at local position s.
Definition elements.cc:4133
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
Definition elements.h:1967
virtual std::string tecplot_zone_string(const unsigned &nplot) const
Return string for tecplot zone header (when plotting nplot points in each "coordinate direction")
Definition elements.h:3165
double size() const
Calculate the size of the element (length, area, volume,...) in Eulerian computational coordinates....
Definition elements.cc:4320
virtual double interpolated_x(const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s.
Definition elements.cc:3992
unsigned nnode() const
Return the number of nodes.
Definition elements.h:2214
virtual void get_s_plot(const unsigned &i, const unsigned &nplot, Vector< double > &s, const bool &shifted_to_interior=false) const
Get cector of local coordinates of plot point i (when plotting nplot points in each "coordinate direc...
Definition elements.h:3152
virtual unsigned nplot_points(const unsigned &nplot) const
Return total number of plot points (when plotting nplot points in each "coordinate direction")
Definition elements.h:3190
double nodal_position(const unsigned &n, const unsigned &i) const
Return the i-th coordinate at local node n. If the node is hanging, the appropriate interpolation is ...
Definition elements.h:2321
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
Definition elements.h:2179
virtual void write_tecplot_zone_footer(std::ostream &outfile, const unsigned &nplot) const
Add tecplot zone "footer" to output stream (when plotting nplot points in each "coordinate direction"...
Definition elements.h:3178
double dnodal_position_dt(const unsigned &n, const unsigned &i) const
Return the i-th component of nodal velocity: dx/dt at local node n.
Definition elements.h:2337
static DenseMatrix< double > Dummy_matrix
Empty dense matrix used as a dummy argument to combined residual and jacobian functions in the case w...
Definition elements.h:227
virtual double knot(const unsigned &i, const unsigned &j) const =0
Return local coordinate s[j] of i-th integration point.
virtual unsigned nweight() const =0
Return the number of integration points of the scheme.
virtual double weight(const unsigned &i) const =0
Return weight of i-th integration point.
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
Definition nodes.h:906
TimeStepper *& position_time_stepper_pt()
Return a pointer to the position timestepper.
Definition nodes.h:1022
An OomphLibError object which should be thrown when an run-time error is encountered....
Point element has just a single node and a single shape function which is identically equal to one.
Definition elements.h:3443
AxisymCylindricalPVDElement upgraded to become projectable.
unsigned nfields_for_projection()
Number of fields to be projected: 0.
unsigned nhistory_values_for_coordinate_projection()
Number of positional history values (Includes the current value!)
double jacobian_and_shape_of_field(const unsigned &fld, const Vector< double > &s, Shape &psi)
Return Jacobian of mapping and shape functions of field fld at local coordinate s.
ProjectableAxisymCylindricalPVDElement()
Constructor [this was only required explicitly from gcc 4.5.2 onwards...].
unsigned nvalue_of_field(const unsigned &fld)
Return number of values in field fld.
int local_equation(const unsigned &fld, const unsigned &j)
Return local equation number of value j in field fld.
Vector< std::pair< Data *, unsigned > > data_values_of_field(const unsigned &fld)
Specify the values associated with field fld. The information is returned in a vector of pairs which ...
unsigned nhistory_values_for_projection(const unsigned &fld)
Number of history values to be stored for fld-th field (Includes the current value!...
double get_field(const unsigned &t, const unsigned &fld, const Vector< double > &s)
Return interpolated field fld at local coordinate s, at time level t (t=0: present; t>0: history valu...
Wrapper class for projectable elements. Adds "projectability" to the underlying ELEMENT.
Definition projection.h:183
void output(FILE *file_pt)
C-style output function.
QAxisymmetricCylindricalPVDElement()
Constructor, there are no internal data points.
void output(std::ostream &outfile, const unsigned &n_plot)
Output function.
void output(FILE *file_pt, const unsigned &n_plot)
C-style output function.
void output(std::ostream &outfile)
Output function.
A Class for shape functions. In simple cases, the shape functions have only one index that can be tho...
Definition shape.h:76
SolidFiniteElement class.
Definition elements.h:3565
double lagrangian_position(const unsigned &n, const unsigned &i) const
Return i-th Lagrangian coordinate at local node n.
Definition elements.h:3909
double dshape_lagrangian(const Vector< double > &s, Shape &psi, DShape &dpsidxi) const
Calculate shape functions and derivatives w.r.t. Lagrangian coordinates at local coordinate s....
Definition elements.cc:6741
virtual double interpolated_xi(const Vector< double > &s, const unsigned &i) const
Return i-th FE-interpolated Lagrangian coordinate xi[i] at local coordinate s.
Definition elements.cc:7135
virtual double dshape_lagrangian_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsidxi) const
Return the geometric shape functions and also first derivatives w.r.t. Lagrangian coordinates at ipt-...
Definition elements.cc:6768
void describe_local_dofs(std::ostream &out, const std::string &current_string) const
Function to describe the local dofs of the element. The ostream specifies the output stream to which ...
Definition elements.cc:6545
SolidQElement elements are quadrilateral elements whose derivatives also include those based upon the...
Definition Qelements.h:1742
SolidTElement elements are triangular/tet elements whose derivatives also include those based upon th...
Definition Telements.h:3728
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
An Element that solves the axisymmetric solid mechanics equations, based on the principle of virtual ...
TAxisymCylindricalPVDElement()
Constructor, there are no internal data points.
void get_Z2_flux(const Vector< double > &s, Vector< double > &flux)
Get 'flux' for Z2 error recovery: Upper triangular entries in strain tensor.
void output(std::ostream &outfile, const unsigned &n_plot)
Output function.
void output(std::ostream &outfile)
Output function.
void output(FILE *file_pt)
C-style output function.
Node * vertex_node_pt(const unsigned &j) const
Pointer to the j-th vertex node in the element.
unsigned num_Z2_flux_terms()
Number of 'flux' terms for Z2 error estimation.
unsigned nrecovery_order()
Order of recovery shape functions for Z2 error estimation: Same order as shape functions.
unsigned nvertex_node() const
Number of vertex nodes in the element.
void output(FILE *file_pt, const unsigned &n_plot)
C-style output function.
General TElement class.
Definition Telements.h:1208
unsigned ntstorage() const
Return the number of doubles required to represent history (one for steady)
Time *const & time_pt() const
Access function for the pointer to time (const version)
double & time()
Return the current value of the continuous time.
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).