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 // Header file for classes that define element objects
27 
28 // Include guard to prevent multiple inclusions of the header
29 #ifndef OOMPH_GENERIC_ELEMENTS_HEADER
30 #define OOMPH_GENERIC_ELEMENTS_HEADER
31 
32 // Config header generated by autoconfig
33 #ifdef HAVE_CONFIG_H
34 #include <oomph-lib-config.h>
35 #endif
36 
37 #include <map>
38 #include <deque>
39 #include <string>
40 #include <list>
41 
42 // oomph-lib includes
43 #include "integral.h"
44 #include "nodes.h"
45 #include "geom_objects.h"
46 
47 namespace oomph
48 {
49  // Forward definition for time
50  class Time;
51 
52 
53  //========================================================================
71  //========================================================================
73  {
74  private:
77  unsigned long* Eqn_number;
78 
84  double** Dof_pt;
85 
93 
102 
104  unsigned Ndof;
105 
107  unsigned Ninternal_data;
108 
110  unsigned Nexternal_data;
111 
122  std::vector<bool> Data_fd;
123 
124  protected:
125 #ifdef OOMPH_HAS_MPI
126 
128  int Non_halo_proc_ID;
129 
131  bool Must_be_kept_as_halo;
132 
133 #endif
134 
141  unsigned add_internal_data(Data* const& data_pt, const bool& fd = true);
142 
143 
146  inline bool internal_data_fd(const unsigned& i) const
147  {
148 #ifdef RANGE_CHECKING
149  if (i >= Ninternal_data)
150  {
151  std::ostringstream error_message;
152  error_message << "Range Error: Internal data " << i
153  << " is not in the range (0," << Ninternal_data - 1
154  << ")";
155  throw OomphLibError(error_message.str(),
158  }
159 #endif
160  // Return the value
161  return Data_fd[i];
162  }
163 
164 
167  inline void exclude_internal_data_fd(const unsigned& i)
168  {
169 #ifdef RANGE_CHECKING
170  if (i >= Ninternal_data)
171  {
172  std::ostringstream error_message;
173  error_message << "Range Error: Internal data " << i
174  << " is not in the range (0," << Ninternal_data - 1
175  << ")";
176  throw OomphLibError(error_message.str(),
179  }
180 #endif
181  // Set the value
182  Data_fd[i] = false;
183  }
184 
187  inline void include_internal_data_fd(const unsigned& i)
188  {
189 #ifdef RANGE_CHECKING
190  if (i >= Ninternal_data)
191  {
192  std::ostringstream error_message;
193  error_message << "Range Error: Internal data " << i
194  << " is not in the range (0," << Ninternal_data - 1
195  << ")";
196  throw OomphLibError(error_message.str(),
199  }
200 #endif
201  // Set the value
202  Data_fd[i] = true;
203  }
204 
208  {
209  delete[] Eqn_number;
210  Eqn_number = 0;
211  delete[] Dof_pt;
212  Dof_pt = 0;
213  Ndof = 0;
214  }
215 
221  std::deque<unsigned long> const& global_eqn_numbers,
222  std::deque<double*> const& global_dof_pt);
223 
228 
231  static std::deque<double*> Dof_pt_deque;
232 
242  const bool& store_local_dof_pt);
243 
254  const bool& store_local_dof_pt)
255  {
256  this->assign_internal_and_external_local_eqn_numbers(store_local_dof_pt);
257  }
258 
264 
267  inline int internal_local_eqn(const unsigned& i, const unsigned& j) const
268  {
269 #ifdef RANGE_CHECKING
270  if (i >= Ninternal_data)
271  {
272  std::ostringstream error_message;
273  error_message << "Range Error: Internal data " << i
274  << " is not in the range (0," << Ninternal_data - 1
275  << ")";
276  throw OomphLibError(error_message.str(),
279  }
280  else
281  {
282  unsigned n_value = internal_data_pt(i)->nvalue();
283  if (j >= n_value)
284  {
285  std::ostringstream error_message;
286  error_message << "Range Error: value " << j << " at internal data "
287  << i << " is not in the range (0," << n_value - 1
288  << ")";
289  throw OomphLibError(error_message.str(),
292  }
293  }
294 #endif
295  // Check that the data has been allocated
296 #ifdef PARANOID
297  if (Data_local_eqn == 0)
298  {
299  throw OomphLibError(
300  "Internal local equation numbers have not been allocated",
303  }
304 #endif
305  // Return the local equation number as stored in the Data_local_eqn array
306  return Data_local_eqn[i][j];
307  }
308 
311  inline int external_local_eqn(const unsigned& i, const unsigned& j)
312  {
313  // Check that the data has been allocated
314 #ifdef RANGE_CHECKING
315  if (i >= Nexternal_data)
316  {
317  std::ostringstream error_message;
318  error_message << "Range Error: External data " << i
319  << " is not in the range (0," << Nexternal_data - 1
320  << ")";
321  throw OomphLibError(error_message.str(),
324  }
325  else
326  {
327  unsigned n_value = external_data_pt(i)->nvalue();
328  if (j >= n_value)
329  {
330  std::ostringstream error_message;
331  error_message << "Range Error: value " << j << " at internal data "
332  << i << " is not in the range (0," << n_value - 1
333  << ")";
334  throw OomphLibError(error_message.str(),
337  }
338  }
339 #endif
340 #ifdef PARANOID
341  if (Data_local_eqn == 0)
342  {
343  throw OomphLibError(
344  "External local equation numbers have not been allocated",
347  }
348 #endif
349  // Return the local equation number stored as the j-th value of the
350  // i-th external data object.
351  return Data_local_eqn[Ninternal_data + i][j];
352  }
353 
358  {
359  std::string error_message =
360  "Empty fill_in_contribution_to_residuals() has been called.\n";
361  error_message +=
362  "This function is called from the default implementations of\n";
363  error_message += "get_residuals() and get_jacobian();\n";
364  error_message +=
365  "and must calculate the residuals vector without initialising any of ";
366  error_message += "its entries.\n\n";
367 
368  error_message +=
369  "If you do not wish to use these defaults, you must overload both\n";
370  error_message += "get_residuals() and get_jacobian(), which must "
371  "initialise the entries\n";
372  error_message += "of the residuals vector and jacobian matrix to zero.\n";
373 
374  error_message += "N.B. the default get_jacobian() function employs "
375  "finite differencing\n";
376 
377  throw OomphLibError(
379  }
380 
390  DenseMatrix<double>& jacobian,
391  const bool& fd_all_data = false);
392 
402  const bool& fd_all_data = false)
403  {
404  // Allocate storage for the residuals
405  Vector<double> residuals(Ndof, 0.0);
406  // Get the residuals for the entire element
407  get_residuals(residuals);
408  // Call the jacobian calculation
409  fill_in_jacobian_from_internal_by_fd(residuals, jacobian, fd_all_data);
410  }
411 
412 
423  DenseMatrix<double>& jacobian,
424  const bool& fd_all_data = false);
425 
426 
436  const bool& fd_all_data = false)
437  {
438  // Allocate storage for a residuals vector
439  Vector<double> residuals(Ndof);
440  // Get the residuals for the entire element
441  get_residuals(residuals);
442  // Call the jacobian calculation
443  fill_in_jacobian_from_external_by_fd(residuals, jacobian, fd_all_data);
444  }
445 
449  virtual inline void update_before_internal_fd() {}
450 
454  virtual inline void reset_after_internal_fd() {}
455 
459  virtual inline void update_in_internal_fd(const unsigned& i) {}
460 
464  virtual inline void reset_in_internal_fd(const unsigned& i)
465  {
467  }
468 
469 
473  virtual inline void update_before_external_fd() {}
474 
478  virtual inline void reset_after_external_fd() {}
479 
483  virtual inline void update_in_external_fd(const unsigned& i) {}
484 
488  virtual inline void reset_in_external_fd(const unsigned& i)
489  {
491  }
492 
500  DenseMatrix<double>& jacobian)
501  {
502  // Add the contribution to the residuals
504  // Allocate storage for the full residuals (residuals of entire element)
505  Vector<double> full_residuals(Ndof);
506  // Get the residuals for the entire element
507  get_residuals(full_residuals);
508  // Calculate the contributions from the internal dofs
509  //(finite-difference the lot by default)
510  fill_in_jacobian_from_internal_by_fd(full_residuals, jacobian, true);
511  // Calculate the contributions from the external dofs
512  //(finite-difference the lot by default)
513  fill_in_jacobian_from_external_by_fd(full_residuals, jacobian, true);
514  }
515 
523  Vector<double>& residuals, DenseMatrix<double>& mass_matrix);
524 
531  Vector<double>& residuals,
532  DenseMatrix<double>& jacobian,
533  DenseMatrix<double>& mass_matrix);
534 
542  double* const& parameter_pt, Vector<double>& dres_dparam);
543 
544 
553  double* const& parameter_pt,
554  Vector<double>& dres_dparam,
555  DenseMatrix<double>& djac_dparam);
556 
565  double* const& parameter_pt,
566  Vector<double>& dres_dparam,
567  DenseMatrix<double>& djac_dparam,
568  DenseMatrix<double>& dmass_matrix_dparam);
569 
570 
577  Vector<double> const& Y,
578  DenseMatrix<double> const& C,
580 
584  Vector<std::pair<unsigned, unsigned>> const& history_index,
585  Vector<double>& inner_product);
586 
591  Vector<unsigned> const& history_index,
592  Vector<Vector<double>>& inner_product_vector);
593 
594  public:
597  : Eqn_number(0),
598  Dof_pt(0),
599  Data_pt(0),
600  Data_local_eqn(0),
601  Ndof(0),
602  Ninternal_data(0),
603  Nexternal_data(0)
604 #ifdef OOMPH_HAS_MPI
605  ,
606  Non_halo_proc_ID(-1),
607  Must_be_kept_as_halo(false)
608 #endif
609  {
610  }
611 
613  virtual ~GeneralisedElement();
614 
617 
619  void operator=(const GeneralisedElement&) = delete;
620 
622  Data*& internal_data_pt(const unsigned& i)
623  {
624 #ifdef RANGE_CHECKING
625  if (i >= Ninternal_data)
626  {
627  std::ostringstream error_message;
628  error_message << "Range Error: Internal data " << i
629  << " is not in the range (0," << Ninternal_data - 1
630  << ")";
631  throw OomphLibError(error_message.str(),
634  }
635 #endif
636  return Data_pt[i];
637  }
638 
640  Data* const& internal_data_pt(const unsigned& i) const
641  {
642 #ifdef RANGE_CHECKING
643  if (i >= Ninternal_data)
644  {
645  std::ostringstream error_message;
646  error_message << "Range Error: Internal data " << i
647  << " is not in the range (0," << Ninternal_data - 1
648  << ")";
649  throw OomphLibError(error_message.str(),
652  }
653 #endif
654  return Data_pt[i];
655  }
656 
657 
659  Data*& external_data_pt(const unsigned& i)
660  {
661 #ifdef RANGE_CHECKING
662  if (i >= Nexternal_data)
663  {
664  std::ostringstream error_message;
665  error_message << "Range Error: External data " << i
666  << " is not in the range (0," << Nexternal_data - 1
667  << ")";
668  throw OomphLibError(error_message.str(),
671  }
672 #endif
673  return Data_pt[Ninternal_data + i];
674  }
675 
677  Data* const& external_data_pt(const unsigned& i) const
678  {
679 #ifdef RANGE_CHECKING
680  if (i >= Nexternal_data)
681  {
682  std::ostringstream error_message;
683  error_message << "Range Error: External data " << i
684  << " is not in the range (0," << Nexternal_data - 1
685  << ")";
686  throw OomphLibError(error_message.str(),
689  }
690 #endif
691  return Data_pt[Ninternal_data + i];
692  }
693 
697 
701 
704  unsigned long eqn_number(const unsigned& ieqn_local) const
705  {
706 #ifdef RANGE_CHECKING
707  if (ieqn_local >= Ndof)
708  {
709  std::ostringstream error_message;
710  error_message << "Range Error: Equation number " << ieqn_local
711  << " is not in the range (0," << Ndof - 1 << ")";
712  throw OomphLibError(error_message.str(),
715  }
716 #endif
717  return Eqn_number[ieqn_local];
718  }
719 
720 
726  int local_eqn_number(const unsigned long& ieqn_global) const
727  {
728  // Cache the number of degrees of freedom in the element
729  const unsigned n_dof = this->Ndof;
730  // Loop over the local equation numbers
731  for (unsigned n = 0; n < n_dof; n++)
732  {
733  // If the global equation numbers match return
734  if (ieqn_global == Eqn_number[n])
735  {
736  return n;
737  }
738  }
739 
740  // If we've got all the way to the end the number has not been found
741  // return minus one.
742  return -1;
743  }
744 
745 
753  unsigned add_external_data(Data* const& data_pt, const bool& fd = true);
754 
757  inline bool external_data_fd(const unsigned& i) const
758  {
759 #ifdef RANGE_CHECKING
760  if (i >= Nexternal_data)
761  {
762  std::ostringstream error_message;
763  error_message << "Range Error: Internal data " << i
764  << " is not in the range (0," << Nexternal_data - 1
765  << ")";
766  throw OomphLibError(error_message.str(),
769  }
770 #endif
771  // Return the value
772  return Data_fd[Ninternal_data + i];
773  }
774 
775 
778  inline void exclude_external_data_fd(const unsigned& i)
779  {
780 #ifdef RANGE_CHECKING
781  if (i >= Nexternal_data)
782  {
783  std::ostringstream error_message;
784  error_message << "Range Error: External data " << i
785  << " is not in the range (0," << Nexternal_data - 1
786  << ")";
787  throw OomphLibError(error_message.str(),
790  }
791 #endif
792  // Set the value
793  Data_fd[Ninternal_data + i] = false;
794  }
795 
798  inline void include_external_data_fd(const unsigned& i)
799  {
800 #ifdef RANGE_CHECKING
801  if (i >= Nexternal_data)
802  {
803  std::ostringstream error_message;
804  error_message << "Range Error: External data " << i
805  << " is not in the range (0," << Nexternal_data - 1
806  << ")";
807  throw OomphLibError(error_message.str(),
810  }
811 #endif
812  // Set the value
813  Data_fd[Ninternal_data + i] = true;
814  }
815 
817  void flush_external_data();
818 
820  void flush_external_data(Data* const& data_pt);
821 
823  unsigned ninternal_data() const
824  {
825  return Ninternal_data;
826  }
827 
829  unsigned nexternal_data() const
830  {
831  return Nexternal_data;
832  }
833 
835  unsigned ndof() const
836  {
837  return Ndof;
838  }
839 
841  void dof_vector(const unsigned& t, Vector<double>& dof)
842  {
843  // Check that the internal storage has been set up
844 #ifdef PARANOID
845  if (Dof_pt == 0)
846  {
847  std::stringstream error_stream;
848  error_stream << "Internal dof array not set up in element.\n"
849  << "In order to set it up you must call\n"
850  << " Problem::enable_store_local_dof_in_elements()\n"
851  << "before the call to Problem::assign_eqn_numbers()\n";
852  throw OomphLibError(
853  error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
854  }
855 #endif
856  // Resize the vector
857  dof.resize(this->Ndof);
858  // Loop over the vector and fill in the desired values
859  for (unsigned i = 0; i < this->Ndof; ++i)
860  {
861  dof[i] = Dof_pt[i][t];
862  }
863  }
864 
867  {
868  // Check that the internal storage has been set up
869 #ifdef PARANOID
870  if (Dof_pt == 0)
871  {
872  std::stringstream error_stream;
873  error_stream << "Internal dof array not set up in element.\n"
874  << "In order to set it up you must call\n"
875  << " Problem::enable_store_local_dof_in_elements()\n"
876  << "before the call to Problem::assign_eqn_numbers()\n";
877  throw OomphLibError(
878  error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
879  }
880 #endif
881  // Resize the vector
882  dof_pt.resize(this->Ndof);
883  // Loop over the vector and fill in the desired values
884  for (unsigned i = 0; i < this->Ndof; ++i)
885  {
886  dof_pt[i] = Dof_pt[i];
887  }
888  }
889 
890 
893  void set_internal_data_time_stepper(const unsigned& i,
894  TimeStepper* const& time_stepper_pt,
895  const bool& preserve_existing_data)
896  {
897  this->internal_data_pt(i)->set_time_stepper(time_stepper_pt,
898  preserve_existing_data);
899  }
900 
906  void assign_internal_eqn_numbers(unsigned long& global_number,
908 
917  void describe_dofs(std::ostream& out,
918  const std::string& current_string) const;
919 
928  virtual void describe_local_dofs(std::ostream& out,
929  const std::string& current_string) const;
930 
934  std::map<unsigned, double*>& map_of_value_pt);
935 
936 #ifdef OOMPH_HAS_MPI
939  void add_internal_data_values_to_vector(Vector<double>& vector_of_values);
940 
944  void read_internal_data_values_from_vector(
945  const Vector<double>& vector_of_values, unsigned& index);
946 
949  void add_internal_eqn_numbers_to_vector(
950  Vector<long>& vector_of_eqn_numbers);
951 
956  void read_internal_eqn_numbers_from_vector(
957  const Vector<long>& vector_of_eqn_numbers, unsigned& index);
958 
959 #endif
960 
964  virtual void assign_local_eqn_numbers(const bool& store_local_dof_pt);
965 
975 
980  virtual void get_residuals(Vector<double>& residuals)
981  {
982  // Zero the residuals vector
983  residuals.initialise(0.0);
984  // Add the elemental contribution to the residuals vector
986  }
987 
990  virtual void get_jacobian(Vector<double>& residuals,
991  DenseMatrix<double>& jacobian)
992  {
993  // Zero the residuals vector
994  residuals.initialise(0.0);
995  // Zero the jacobian matrix
996  jacobian.initialise(0.0);
997  // Add the elemental contribution to the residuals vector
998  fill_in_contribution_to_jacobian(residuals, jacobian);
999  }
1000 
1003  virtual void get_mass_matrix(Vector<double>& residuals,
1004  DenseMatrix<double>& mass_matrix)
1005  {
1006  // Zero the residuals vector
1007  residuals.initialise(0.0);
1008  // Zero the mass matrix
1009  mass_matrix.initialise(0.0);
1010  // Add the elemental contribution to the vector and matrix
1011  fill_in_contribution_to_mass_matrix(residuals, mass_matrix);
1012  }
1013 
1017  DenseMatrix<double>& jacobian,
1018  DenseMatrix<double>& mass_matrix)
1019  {
1020  // Zero the residuals vector
1021  residuals.initialise(0.0);
1022  // Zero the jacobian matrix
1023  jacobian.initialise(0.0);
1024  // Zero the mass matrix
1025  mass_matrix.initialise(0.0);
1026  // Add the elemental contribution to the vector and matrix
1028  residuals, jacobian, mass_matrix);
1029  }
1030 
1031 
1034  virtual void get_dresiduals_dparameter(double* const& parameter_pt,
1035  Vector<double>& dres_dparam)
1036  {
1037  // Zero the dres_dparam vector
1038  dres_dparam.initialise(0.0);
1039  // Add the elemental contribution to the residuals vector
1041  dres_dparam);
1042  }
1043 
1046  virtual void get_djacobian_dparameter(double* const& parameter_pt,
1047  Vector<double>& dres_dparam,
1048  DenseMatrix<double>& djac_dparam)
1049  {
1050  // Zero the residuals vector
1051  dres_dparam.initialise(0.0);
1052  // Zero the jacobian matrix
1053  djac_dparam.initialise(0.0);
1054  // Add the elemental contribution to the residuals vector
1056  parameter_pt, dres_dparam, djac_dparam);
1057  }
1058 
1062  double* const& parameter_pt,
1063  Vector<double>& dres_dparam,
1064  DenseMatrix<double>& djac_dparam,
1065  DenseMatrix<double>& dmass_matrix_dparam)
1066  {
1067  // Zero the residuals derivative vector
1068  dres_dparam.initialise(0.0);
1069  // Zero the jacobian derivative matrix
1070  djac_dparam.initialise(0.0);
1071  // Zero the mass matrix derivative
1072  dmass_matrix_dparam.initialise(0.0);
1073  // Add the elemental contribution to the residuals vector and matrices
1075  parameter_pt, dres_dparam, djac_dparam, dmass_matrix_dparam);
1076  }
1077 
1078 
1084  DenseMatrix<double> const& C,
1086  {
1087  // Initialise the product to zero
1088  product.initialise(0.0);
1091  }
1092 
1095  virtual void get_inner_products(
1096  Vector<std::pair<unsigned, unsigned>> const& history_index,
1097  Vector<double>& inner_product)
1098  {
1099  inner_product.initialise(0.0);
1100  this->fill_in_contribution_to_inner_products(history_index,
1101  inner_product);
1102  }
1103 
1107  Vector<unsigned> const& history_index,
1108  Vector<Vector<double>>& inner_product_vector)
1109  {
1110  const unsigned n_inner_product = inner_product_vector.size();
1111  for (unsigned i = 0; i < n_inner_product; ++i)
1112  {
1113  inner_product_vector[i].initialise(0.0);
1114  }
1116  inner_product_vector);
1117  }
1118 
1119 
1122  virtual unsigned self_test();
1123 
1124 
1128  virtual void compute_norm(Vector<double>& norm)
1129  {
1130  std::string error_message =
1131  "compute_norm(...) undefined for this element\n";
1132  throw OomphLibError(
1134  }
1135 
1136 
1140  virtual void compute_norm(double& norm)
1141  {
1142  std::string error_message = "compute_norm undefined for this element \n";
1143  throw OomphLibError(
1145  }
1146 
1147 #ifdef OOMPH_HAS_MPI
1148 
1151  void set_halo(const unsigned& non_halo_proc_ID)
1152  {
1153  Non_halo_proc_ID = non_halo_proc_ID;
1154  }
1155 
1157  void set_nonhalo()
1158  {
1159  Non_halo_proc_ID = -1;
1160  }
1161 
1163  bool is_halo() const
1164  {
1165  return (Non_halo_proc_ID != -1);
1166  }
1167 
1170  int non_halo_proc_ID()
1171  {
1172  return Non_halo_proc_ID;
1173  }
1174 
1176  void set_must_be_kept_as_halo()
1177  {
1178  Must_be_kept_as_halo = true;
1179  }
1180 
1183  void unset_must_be_kept_as_halo()
1184  {
1185  Must_be_kept_as_halo = false;
1186  }
1187 
1189  bool must_be_kept_as_halo() const
1190  {
1191  return Must_be_kept_as_halo;
1192  }
1193 
1194 #endif
1195 
1199 
1202  virtual unsigned ndof_types() const
1203  {
1204  // error message stream
1205  std::ostringstream error_message;
1206  error_message << "ndof_types() const has not been implemented for this \n"
1207  << "element\n"
1208  << std::endl;
1209  // throw error
1210  throw OomphLibError(
1211  error_message.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
1212  }
1213 
1222  std::list<std::pair<unsigned long, unsigned>>& dof_lookup_list) const
1223  {
1224  // error message stream
1225  std::ostringstream error_message;
1226  error_message << "get_dof_numbers_for_unknowns() const has not been \n"
1227  << " implemented for this element\n"
1228  << std::endl;
1229  // throw error
1230  throw OomphLibError(
1231  error_message.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
1232  }
1233  };
1234 
1238  {
1240  {
1241  Q,
1242  T
1243  };
1244  }
1245 
1246  // Forward class definitions that are used in FiniteElements
1247  class FaceElement;
1248  class MacroElement;
1249  class TimeStepper;
1250  class Shape;
1251  class DShape;
1252  class Integral;
1253 
1254  //===========================================================================
1257  //===========================================================================
1258  namespace Locate_zeta_helpers
1259  {
1261  extern double Newton_tolerance;
1262 
1264  extern unsigned Max_newton_iterations;
1265 
1270 
1275  extern unsigned N_local_points;
1276 
1277  } // namespace Locate_zeta_helpers
1278 
1279 
1282  typedef void (*CoordinateMappingFctPt)(const Vector<double>& s,
1283  Vector<double>& s_bulk);
1284 
1291  const Vector<double>& s,
1292  DenseMatrix<double>& ds_bulk_dsface,
1293  unsigned& interior_direction);
1294 
1295 
1296  //========================================================================
1311  //========================================================================
1312  class FiniteElement : public virtual GeneralisedElement, public GeomObject
1313  {
1314  private:
1317 
1320 
1324 
1326  unsigned Nnode;
1327 
1331 
1337 
1345 
1346  protected:
1351  const DShape& dpsids, DenseMatrix<double>& jacobian) const;
1352 
1357  const DShape& d2psids, DenseMatrix<double>& jacobian2) const;
1358 
1362  virtual void assemble_eulerian_base_vectors(
1363  const DShape& dpsids, DenseMatrix<double>& interpolated_G) const;
1364 
1370  static const unsigned Default_Initial_Nvalue;
1371 
1374  static const double Node_location_tolerance;
1375 
1376  public:
1380  void set_dimension(const unsigned& dim)
1381  {
1383  Nodal_dimension = dim;
1384  }
1385 
1390  void set_nodal_dimension(const unsigned& nodal_dim)
1391  {
1392  Nodal_dimension = nodal_dim;
1393  }
1394 
1396  void set_nnodal_position_type(const unsigned& nposition_type)
1397  {
1398  Nnodal_position_type = nposition_type;
1399  }
1400 
1401 
1404  void set_n_node(const unsigned& n)
1405  {
1406  // This should only be done once, in a Node constructor
1407  //#ifdef PARANOID
1408  // if(Node_pt)
1409  // {
1410  // OomphLibWarning(
1411  // "You are resetting the number of nodes in an element -- Be careful",
1412  // "FiniteElement::set_n_node()",
1413  // OOMPH_EXCEPTION_LOCATION);
1414  // }
1415  //#endif
1416  // Delete any previous storage to avoid memory leaks
1417  // This will only happen in very special cases
1418  delete[] Node_pt;
1419  // Set the number of nodes
1420  Nnode = n;
1421  // Allocate the storage
1422  Node_pt = new Node*[n];
1423  // Initialise all the pointers to NULL
1424  for (unsigned i = 0; i < n; i++)
1425  {
1426  Node_pt[i] = 0;
1427  }
1428  }
1429 
1432  inline int nodal_local_eqn(const unsigned& n, const unsigned& i) const
1433  {
1434 #ifdef RANGE_CHECKING
1435  if (n >= Nnode)
1436  {
1437  std::ostringstream error_message;
1438  error_message << "Range Error: Node number " << n
1439  << " is not in the range (0," << Nnode - 1 << ")";
1440  throw OomphLibError(error_message.str(),
1443  }
1444  else
1445  {
1446  unsigned n_value = node_pt(n)->nvalue();
1447  if (i >= n_value)
1448  {
1449  std::ostringstream error_message;
1450  error_message << "Range Error: value " << i << " at node " << n
1451  << " is not in the range (0," << n_value - 1 << ")";
1452  throw OomphLibError(error_message.str(),
1455  }
1456  }
1457 #endif
1458 #ifdef PARANOID
1459  // Check that the equations have been allocated
1460  if (Nodal_local_eqn == 0)
1461  {
1462  throw OomphLibError(
1463  "Nodal local equation numbers have not been allocated",
1466  }
1467 #endif
1468  return Nodal_local_eqn[n][i];
1469  }
1470 
1471 
1476  double dJ_eulerian_at_knot(const unsigned& ipt,
1477  Shape& psi,
1478  DenseMatrix<double>& djacobian_dX) const;
1479 
1480  protected:
1483  static const unsigned N2deriv[];
1484 
1489  template<unsigned DIM>
1490  double invert_jacobian(const DenseMatrix<double>& jacobian,
1491  DenseMatrix<double>& inverse_jacobian) const;
1492 
1493 
1499  virtual double invert_jacobian_mapping(
1500  const DenseMatrix<double>& jacobian,
1501  DenseMatrix<double>& inverse_jacobian) const;
1502 
1503 
1509  const DShape& dpsids,
1510  DenseMatrix<double>& jacobian,
1511  DenseMatrix<double>& inverse_jacobian) const
1512  {
1513  // Assemble the jacobian
1514  assemble_local_to_eulerian_jacobian(dpsids, jacobian);
1515  // Invert the jacobian (use the template-free interface)
1516  return invert_jacobian_mapping(jacobian, inverse_jacobian);
1517  }
1518 
1519 
1525  const DShape& dpsids, DenseMatrix<double>& inverse_jacobian) const
1526  {
1527  // Find the dimension of the element
1528  const unsigned el_dim = dim();
1529  // Assign memory for the jacobian
1530  DenseMatrix<double> jacobian(el_dim);
1531  // Calculate the jacobian and inverse
1532  return local_to_eulerian_mapping(dpsids, jacobian, inverse_jacobian);
1533  }
1534 
1541  virtual double local_to_eulerian_mapping_diagonal(
1542  const DShape& dpsids,
1543  DenseMatrix<double>& jacobian,
1544  DenseMatrix<double>& inverse_jacobian) const;
1545 
1554  virtual void dJ_eulerian_dnodal_coordinates(
1555  const DenseMatrix<double>& jacobian,
1556  const DShape& dpsids,
1557  DenseMatrix<double>& djacobian_dX) const;
1558 
1564  template<unsigned DIM>
1566  const DenseMatrix<double>& jacobian,
1567  const DShape& dpsids,
1568  DenseMatrix<double>& djacobian_dX) const;
1569 
1586  const double& det_jacobian,
1587  const DenseMatrix<double>& jacobian,
1588  const DenseMatrix<double>& djacobian_dX,
1589  const DenseMatrix<double>& inverse_jacobian,
1590  const DShape& dpsids,
1591  RankFourTensor<double>& d_dpsidx_dX) const;
1592 
1603  template<unsigned DIM>
1605  const double& det_jacobian,
1606  const DenseMatrix<double>& jacobian,
1607  const DenseMatrix<double>& djacobian_dX,
1608  const DenseMatrix<double>& inverse_jacobian,
1609  const DShape& dpsids,
1610  RankFourTensor<double>& d_dpsidx_dX) const;
1611 
1619  virtual void transform_derivatives(
1620  const DenseMatrix<double>& inverse_jacobian, DShape& dbasis) const;
1621 
1630  const DenseMatrix<double>& inverse_jacobian, DShape& dbasis) const;
1631 
1644  virtual void transform_second_derivatives(
1645  const DenseMatrix<double>& jacobian,
1646  const DenseMatrix<double>& inverse_jacobian,
1647  const DenseMatrix<double>& jacobian2,
1648  DShape& dbasis,
1649  DShape& d2basis) const;
1650 
1658  template<unsigned DIM>
1660  const DenseMatrix<double>& jacobian,
1661  const DenseMatrix<double>& inverse_jacobian,
1662  const DenseMatrix<double>& jacobian2,
1663  DShape& dbasis,
1664  DShape& d2basis) const;
1665 
1674  template<unsigned DIM>
1676  const DenseMatrix<double>& jacobian,
1677  const DenseMatrix<double>& inverse_jacobian,
1678  const DenseMatrix<double>& jacobian2,
1679  DShape& dbasis,
1680  DShape& d2basis) const;
1681 
1684 
1689  virtual void fill_in_jacobian_from_nodal_by_fd(
1690  Vector<double>& residuals, DenseMatrix<double>& jacobian);
1691 
1696  {
1697  // Allocate storage for a residuals vector and initialise to zero
1698  unsigned n_dof = ndof();
1699  Vector<double> residuals(n_dof, 0.0);
1700  // Get the residuals for the entire element
1701  get_residuals(residuals);
1702  // Call the jacobian calculation
1703  fill_in_jacobian_from_nodal_by_fd(residuals, jacobian);
1704  }
1705 
1709  virtual inline void update_before_nodal_fd() {}
1710 
1714  virtual inline void reset_after_nodal_fd() {}
1715 
1718  virtual inline void update_in_nodal_fd(const unsigned& i) {}
1719 
1723  virtual inline void reset_in_nodal_fd(const unsigned& i)
1724  {
1726  }
1727 
1728 
1736  DenseMatrix<double>& jacobian)
1737  {
1738  // Add the contribution to the residuals
1740  // Allocate storage for the full residuals (residuals of entire element)
1741  unsigned n_dof = ndof();
1742  Vector<double> full_residuals(n_dof);
1743  // Get the residuals for the entire element
1744  get_residuals(full_residuals);
1745  // Calculate the contributions from the internal dofs
1746  //(finite-difference the lot by default)
1747  fill_in_jacobian_from_internal_by_fd(full_residuals, jacobian, true);
1748  // Calculate the contributions from the external dofs
1749  //(finite-difference the lot by default)
1750  fill_in_jacobian_from_external_by_fd(full_residuals, jacobian, true);
1751  // Calculate the contributions from the nodal dofs
1752  fill_in_jacobian_from_nodal_by_fd(full_residuals, jacobian);
1753  }
1754 
1755  public:
1760  Vector<double>&);
1761 
1765  typedef void (*UnsteadyExactSolutionFctPt)(const double&,
1766  const Vector<double>&,
1767  Vector<double>&);
1768 
1771 
1776 
1780 
1783  : GeneralisedElement(),
1784  Integral_pt(0),
1785  Node_pt(0),
1786  Nodal_local_eqn(0),
1787  Nnode(0),
1789  Nodal_dimension(0),
1791  Macro_elem_pt(0)
1792  {
1793  }
1794 
1799  virtual ~FiniteElement();
1800 
1802  FiniteElement(const FiniteElement&) = delete;
1803 
1805  // Commented out broken assignment operator because this can lead to a
1806  // conflict warning when used in the virtual inheritence hierarchy.
1807  // Essentially the compiler doesn't realise that two separate
1808  // implementations of the broken function are the same and so, quite
1809  // rightly, it shouts.
1810  /*void operator=(const FiniteElement&) = delete;*/
1811 
1814  {
1815  throw OomphLibError(
1816  "local_coord_is_valid is not implemented for this element\n",
1819  return true;
1820  }
1821 
1825  {
1826  throw OomphLibError("move_local_coords_back_into_element() is not "
1827  "implemented for this element\n",
1830  }
1831 
1832 
1838  Vector<double>& cog, double& max_radius) const;
1839 
1842  virtual void local_coordinate_of_node(const unsigned& j,
1843  Vector<double>& s) const
1844  {
1845  throw OomphLibError(
1846  "local_coordinate_of_node(...) is not implemented for this element\n",
1849  }
1850 
1853  virtual void local_fraction_of_node(const unsigned& j,
1854  Vector<double>& s_fraction);
1855 
1858  virtual double local_one_d_fraction_of_node(const unsigned& n1d,
1859  const unsigned& i)
1860  {
1861  std::string error_message =
1862  "local one_d_fraction_of_node is not implemented for this element\n";
1863  error_message +=
1864  "It only makes sense for elements that use tensor-product expansions\n";
1865 
1866  throw OomphLibError(
1868  }
1869 
1873  {
1875  }
1876 
1879  {
1880  return Macro_elem_pt;
1881  }
1882 
1885  void get_x(const Vector<double>& s, Vector<double>& x) const
1886  {
1887  // If there is no macro element then return interpolated x
1888  if (Macro_elem_pt == 0)
1889  {
1890  interpolated_x(s, x);
1891  }
1892  // Otherwise call the macro element representation
1893  else
1894  {
1896  }
1897  }
1898 
1899 
1904  void get_x(const unsigned& t, const Vector<double>& s, Vector<double>& x)
1905  {
1906  // Get timestepper from first node
1908 
1909  // Number of previous values
1910  const unsigned nprev = time_stepper_pt->nprev_values();
1911 
1912  // If t > nprev_values(), we're not dealing with a previous value
1913  // but a generalised history value -- this cannot be recovered from
1914  // macro element but must be determined by finite element interpolation
1915 
1916  // If there is no macro element, or we're dealing with a generalised
1917  // history value then use the FE representation
1918  if ((Macro_elem_pt == 0) || (t > nprev))
1919  {
1920  interpolated_x(t, s, x);
1921  }
1922  // Otherwise use the macro element representation
1923  else
1924  {
1926  }
1927  }
1928 
1929 
1935  Vector<double>& x) const
1936  {
1937  throw OomphLibError(
1938  "get_x_from_macro_element(...) is not implemented for this element\n",
1941  }
1942 
1948  virtual void get_x_from_macro_element(const unsigned& t,
1949  const Vector<double>& s,
1950  Vector<double>& x)
1951  {
1952  throw OomphLibError(
1953  "get_x_from_macro_element(...) is not implemented for this element\n",
1956  }
1957 
1958 
1960  virtual void set_integration_scheme(Integral* const& integral_pt);
1961 
1963  Integral* const& integral_pt() const
1964  {
1965  return Integral_pt;
1966  }
1967 
1971  virtual void shape(const Vector<double>& s, Shape& psi) const = 0;
1972 
1975  virtual void shape_at_knot(const unsigned& ipt, Shape& psi) const;
1976 
1981  virtual void dshape_local(const Vector<double>& s,
1982  Shape& psi,
1983  DShape& dpsids) const
1984  {
1985  throw OomphLibError(
1986  "dshape_local() is not implemented for this element\n",
1989  }
1990 
1993  virtual void dshape_local_at_knot(const unsigned& ipt,
1994  Shape& psi,
1995  DShape& dpsids) const;
1996 
2016  virtual void d2shape_local(const Vector<double>& s,
2017  Shape& psi,
2018  DShape& dpsids,
2019  DShape& d2psids) const
2020  {
2021  throw OomphLibError(
2022  "d2shape_local() is not implemented for this element\n",
2025  }
2026 
2044  virtual void d2shape_local_at_knot(const unsigned& ipt,
2045  Shape& psi,
2046  DShape& dpsids,
2047  DShape& d2psids) const;
2048 
2051  virtual double J_eulerian(const Vector<double>& s) const;
2052 
2055  virtual double J_eulerian_at_knot(const unsigned& ipt) const;
2056 
2059  void check_J_eulerian_at_knots(bool& passed) const;
2060 
2064  void check_jacobian(const double& jacobian) const;
2065 
2069  double dshape_eulerian(const Vector<double>& s,
2070  Shape& psi,
2071  DShape& dpsidx) const;
2072 
2075  virtual double dshape_eulerian_at_knot(const unsigned& ipt,
2076  Shape& psi,
2077  DShape& dpsidx) const;
2078 
2084  virtual double dshape_eulerian_at_knot(
2085  const unsigned& ipt,
2086  Shape& psi,
2087  DShape& dpsi,
2088  DenseMatrix<double>& djacobian_dX,
2089  RankFourTensor<double>& d_dpsidx_dX) const;
2090 
2108  double d2shape_eulerian(const Vector<double>& s,
2109  Shape& psi,
2110  DShape& dpsidx,
2111  DShape& d2psidx) const;
2112 
2113 
2131  virtual double d2shape_eulerian_at_knot(const unsigned& ipt,
2132  Shape& psi,
2133  DShape& dpsidx,
2134  DShape& d2psidx) const;
2135 
2140  virtual void assign_nodal_local_eqn_numbers(const bool& store_local_dof_pt);
2141 
2148  virtual void describe_local_dofs(std::ostream& out,
2149  const std::string& current_string) const;
2150 
2157  virtual void describe_nodal_local_dofs(
2158  std::ostream& out, const std::string& current_string) const;
2159 
2165  const bool& store_local_dof_pt)
2166  {
2167  // GeneralisedElement's version assigns internal and external data
2169  store_local_dof_pt);
2170  // Need simply to add the nodal numbering scheme
2171  assign_nodal_local_eqn_numbers(store_local_dof_pt);
2172  }
2173 
2175  Node*& node_pt(const unsigned& n)
2176  {
2177 #ifdef RANGE_CHECKING
2178  if (n >= Nnode)
2179  {
2180  std::ostringstream error_message;
2181  error_message << "Range Error: " << n << " is not in the range (0,"
2182  << Nnode - 1 << ")";
2183  throw OomphLibError(error_message.str(),
2186  }
2187 #endif
2188  return Node_pt[n];
2189  }
2190 
2192  Node* const& node_pt(const unsigned& n) const
2193  {
2194 #ifdef RANGE_CHECKING
2195  if (n >= Nnode)
2196  {
2197  std::ostringstream error_message;
2198  error_message << "Range Error: " << n << " is not in the range (0,"
2199  << Nnode - 1 << ")";
2200  throw OomphLibError(error_message.str(),
2203  }
2204 #endif
2205 
2206  return Node_pt[n];
2207  }
2208 
2210  unsigned nnode() const
2211  {
2212  return Nnode;
2213  }
2214 
2218  virtual unsigned nnode_1d() const
2219  {
2220  return 0;
2221  }
2222 
2232  double raw_nodal_position(const unsigned& n, const unsigned& i) const;
2233  /* { */
2234  /* /\* oomph_info << "n: "<< n << std::endl; *\/ */
2235  /* /\* oomph_info << "i: "<< i << std::endl; *\/ */
2236  /* /\* oomph_info << "node_pt(n): "<< node_pt(n) << std::endl; *\/ */
2237  /* /\* oomph_info << "node_pt(n)->x(i): "<< node_pt(n)->x(i) << std::endl;
2238  * *\/ */
2239  /* double tmp=node_pt(n)->x(i); */
2240  /* //oomph_info << "tmp: "<< tmp << std::endl; */
2241  /* return tmp; // node_pt(n)->x(i); */
2242  /* } */
2243 
2247  double raw_nodal_position(const unsigned& t,
2248  const unsigned& n,
2249  const unsigned& i) const
2250  {
2251  return node_pt(n)->x(t, i);
2252  }
2253 
2256  double raw_dnodal_position_dt(const unsigned& n, const unsigned& i) const
2257  {
2258  return node_pt(n)->dx_dt(i);
2259  }
2260 
2263  double raw_dnodal_position_dt(const unsigned& n,
2264  const unsigned& j,
2265  const unsigned& i) const
2266  {
2267  return node_pt(n)->dx_dt(j, i);
2268  }
2269 
2272  double raw_nodal_position_gen(const unsigned& n,
2273  const unsigned& k,
2274  const unsigned& i) const
2275  {
2276  return node_pt(n)->x_gen(k, i);
2277  }
2278 
2282  double raw_nodal_position_gen(const unsigned& t,
2283  const unsigned& n,
2284  const unsigned& k,
2285  const unsigned& i) const
2286  {
2287  return node_pt(n)->x_gen(t, k, i);
2288  }
2289 
2294  double raw_dnodal_position_gen_dt(const unsigned& n,
2295  const unsigned& k,
2296  const unsigned& i) const
2297  {
2298  return node_pt(n)->dx_gen_dt(k, i);
2299  }
2300 
2305  double raw_dnodal_position_gen_dt(const unsigned& j,
2306  const unsigned& n,
2307  const unsigned& k,
2308  const unsigned& i) const
2309  {
2310  return node_pt(n)->dx_gen_dt(j, k, i);
2311  }
2312 
2313 
2317  double nodal_position(const unsigned& n, const unsigned& i) const
2318  {
2319  return node_pt(n)->position(i);
2320  }
2321 
2325  double nodal_position(const unsigned& t,
2326  const unsigned& n,
2327  const unsigned& i) const
2328  {
2329  return node_pt(n)->position(t, i);
2330  }
2331 
2333  double dnodal_position_dt(const unsigned& n, const unsigned& i) const
2334  {
2335  return node_pt(n)->dposition_dt(i);
2336  }
2337 
2340  double dnodal_position_dt(const unsigned& n,
2341  const unsigned& j,
2342  const unsigned& i) const
2343  {
2344  return node_pt(n)->dposition_dt(j, i);
2345  }
2346 
2349  double nodal_position_gen(const unsigned& n,
2350  const unsigned& k,
2351  const unsigned& i) const
2352  {
2353  return node_pt(n)->position_gen(k, i);
2354  }
2355 
2358  double nodal_position_gen(const unsigned& t,
2359  const unsigned& n,
2360  const unsigned& k,
2361  const unsigned& i) const
2362  {
2363  return node_pt(n)->position_gen(t, k, i);
2364  }
2365 
2369  double dnodal_position_gen_dt(const unsigned& n,
2370  const unsigned& k,
2371  const unsigned& i) const
2372  {
2373  return node_pt(n)->dposition_gen_dt(k, i);
2374  }
2375 
2379  double dnodal_position_gen_dt(const unsigned& j,
2380  const unsigned& n,
2381  const unsigned& k,
2382  const unsigned& i) const
2383  {
2384  return node_pt(n)->dposition_gen_dt(j, k, i);
2385  }
2386 
2387 
2392  virtual void get_dresidual_dnodal_coordinates(
2393  RankThreeTensor<double>& dresidual_dnodal_coordinates);
2394 
2408  virtual void disable_ALE()
2409  {
2410  std::ostringstream warn_message;
2411  warn_message
2412  << "Warning: You have just called the default (empty) function \n\n"
2413  << " FiniteElement::disable_ALE() \n\n"
2414  << "This suggests that you've either tried to call it for an element\n"
2415  << "that \n"
2416  << "(1) does not involve time-derivatives (e.g. a Poisson element) \n"
2417  << "(2) an element for which the time-derivatives aren't implemented \n"
2418  << " in ALE form \n"
2419  << "(3) an element for which the ALE form of the equations can't be \n"
2420  << " be disabled (yet).\n";
2422  warn_message.str(), "Problem::disable_ALE()", OOMPH_EXCEPTION_LOCATION);
2423  }
2424 
2425 
2430  virtual void enable_ALE()
2431  {
2432  std::ostringstream warn_message;
2433  warn_message
2434  << "Warning: You have just called the default (empty) function \n\n"
2435  << " FiniteElement::enable_ALE() \n\n"
2436  << "This suggests that you've either tried to call it for an element\n"
2437  << "that \n"
2438  << "(1) does not involve time-derivatives (e.g. a Poisson element) \n"
2439  << "(2) an element for which the time-derivatives aren't implemented \n"
2440  << " in ALE form \n"
2441  << "(3) an element for which the ALE form of the equations can't be \n"
2442  << " be disabled (yet)\n"
2443  << "(4) an element for which this function has not been (properly) \n "
2444  << " implemented. This is likely to be a bug!\n ";
2446  warn_message.str(), "Problem::enable_ALE()", OOMPH_EXCEPTION_LOCATION);
2447  }
2448 
2455  virtual unsigned required_nvalue(const unsigned& n) const
2456  {
2457  return Default_Initial_Nvalue;
2458  }
2459 
2463  unsigned nnodal_position_type() const
2464  {
2465  return Nnodal_position_type;
2466  }
2467 
2470  bool has_hanging_nodes() const
2471  {
2472  unsigned nnod = nnode();
2473  for (unsigned j = 0; j < nnod; j++)
2474  {
2475  if (node_pt(j)->is_hanging())
2476  {
2477  return true;
2478  }
2479  }
2480  return false;
2481  }
2482 
2484  unsigned nodal_dimension() const
2485  {
2486  return Nodal_dimension;
2487  }
2488 
2491  virtual unsigned nvertex_node() const
2492  {
2493  std::string error_msg = "Not implemented for FiniteElement.";
2494  throw OomphLibError(
2496  }
2497 
2500  virtual Node* vertex_node_pt(const unsigned& j) const
2501  {
2502  std::string error_msg = "Not implemented for FiniteElement.";
2503  throw OomphLibError(
2505  }
2506 
2509  virtual Node* construct_node(const unsigned& n)
2510  {
2511  // Create a node and assign it to the local node pointer
2512  // The dimension and number of values are taken from internal element data
2513  node_pt(n) =
2515  // Now return a pointer to the node, so that the mesh can use it
2516  return node_pt(n);
2517  }
2518 
2522  virtual Node* construct_node(const unsigned& n,
2523  TimeStepper* const& time_stepper_pt)
2524  {
2525  // Create a node and assign it to the local node pointer.
2526  // The dimension and number of values are taken from internal element data
2527  node_pt(n) = new Node(time_stepper_pt,
2530  required_nvalue(n));
2531  // Now return a pointer to the node, so that the mesh can find it
2532  return node_pt(n);
2533  }
2534 
2538  virtual Node* construct_boundary_node(const unsigned& n)
2539  {
2540  // Create a node and assign it to the local node pointer
2541  // The dimension and number of values are taken from internal element data
2542  node_pt(n) = new BoundaryNode<Node>(
2544  // Now return a pointer to the node, so that the mesh can use it
2545  return node_pt(n);
2546  }
2547 
2552  virtual Node* construct_boundary_node(const unsigned& n,
2553  TimeStepper* const& time_stepper_pt)
2554  {
2555  // Create a node and assign it to the local node pointer.
2556  // The dimension and number of values are taken from internal element data
2560  required_nvalue(n));
2561  // Now return a pointer to the node, so that the mesh can find it
2562  return node_pt(n);
2563  }
2564 
2567  int get_node_number(Node* const& node_pt) const;
2568 
2569 
2572  virtual Node* get_node_at_local_coordinate(const Vector<double>& s) const;
2573 
2576  double raw_nodal_value(const unsigned& n, const unsigned& i) const
2577  {
2578  return node_pt(n)->raw_value(i);
2579  }
2580 
2584  double raw_nodal_value(const unsigned& t,
2585  const unsigned& n,
2586  const unsigned& i) const
2587  {
2588  return node_pt(n)->raw_value(t, i);
2589  }
2590 
2593  double nodal_value(const unsigned& n, const unsigned& i) const
2594  {
2595  return node_pt(n)->value(i);
2596  }
2597 
2601  double nodal_value(const unsigned& t,
2602  const unsigned& n,
2603  const unsigned& i) const
2604  {
2605  return node_pt(n)->value(t, i);
2606  }
2607 
2611  unsigned dim() const
2612  {
2613  return Elemental_dimension;
2614  }
2615 
2618  {
2619  std::string err = "Broken virtual function.";
2620  throw OomphLibError(
2622  }
2623 
2625  virtual double interpolated_x(const Vector<double>& s,
2626  const unsigned& i) const;
2627 
2630  virtual double interpolated_x(const unsigned& t,
2631  const Vector<double>& s,
2632  const unsigned& i) const;
2633 
2635  virtual void interpolated_x(const Vector<double>& s,
2636  Vector<double>& x) const;
2637 
2640  virtual void interpolated_x(const unsigned& t,
2641  const Vector<double>& s,
2642  Vector<double>& x) const;
2643 
2647  virtual double interpolated_dxdt(const Vector<double>& s,
2648  const unsigned& i,
2649  const unsigned& t);
2650 
2654  virtual void interpolated_dxdt(const Vector<double>& s,
2655  const unsigned& t,
2656  Vector<double>& dxdt);
2657 
2660  inline unsigned ngeom_data() const
2661  {
2662  return 0;
2663  }
2664 
2667  inline Data* geom_data_pt(const unsigned& j)
2668  {
2669  return 0;
2670  }
2671 
2677  {
2678  this->interpolated_x(zeta, r);
2679  }
2680 
2689  void position(const unsigned& t,
2690  const Vector<double>& zeta,
2691  Vector<double>& r) const
2692  {
2693  this->interpolated_x(t, zeta, r);
2694  }
2695 
2702  const unsigned& t,
2703  Vector<double>& drdt)
2704  {
2705  this->interpolated_dxdt(zeta, t, drdt);
2706  }
2707 
2722  virtual double zeta_nodal(const unsigned& n,
2723  const unsigned& k,
2724  const unsigned& i) const
2725  {
2726  // By default return the value for nodal_position_gen
2727  return nodal_position_gen(n, k, i);
2728  }
2729 
2730 
2742  void interpolated_zeta(const Vector<double>& s, Vector<double>& zeta) const;
2743 
2753  void locate_zeta(const Vector<double>& zeta,
2754  GeomObject*& geom_object_pt,
2755  Vector<double>& s,
2756  const bool& use_coordinate_as_initial_guess = false);
2757 
2758 
2762  virtual void node_update();
2763 
2780  std::set<std::pair<Data*, unsigned>>& paired_field_data);
2781 
2782 
2789  virtual void identify_geometric_data(std::set<Data*>& geometric_data_pt) {}
2790 
2791 
2793  virtual double s_min() const
2794  {
2795  throw OomphLibError("s_min() isn't implemented for this element\n",
2798  // Dummy return
2799  return 0.0;
2800  }
2801 
2803  virtual double s_max() const
2804  {
2805  throw OomphLibError("s_max() isn't implemented for this element\n",
2808  // Dummy return
2809  return 0.0;
2810  }
2811 
2818  double size() const;
2819 
2820 
2825  virtual double compute_physical_size() const
2826  {
2827  throw OomphLibError(
2828  "compute_physical_size() isn't implemented for this element\n",
2831  // Dummy return
2832  return 0.0;
2833  }
2834 
2838  virtual void point_output_data(const Vector<double>& s,
2840  {
2841  }
2842 
2845  void point_output(std::ostream& outfile, const Vector<double>& s)
2846  {
2847  // Get point data
2849  this->point_output_data(s, data);
2850 
2851  // Output
2852  unsigned n = data.size();
2853  for (unsigned i = 0; i < n; i++)
2854  {
2855  outfile << data[i] << " ";
2856  }
2857  }
2858 
2862  virtual unsigned nplot_points_paraview(const unsigned& nplot) const
2863  {
2864  throw OomphLibError(
2865  "This function hasn't been implemented for this element",
2868 
2869  // Dummy unsigned
2870  return 0;
2871  }
2872 
2876  virtual unsigned nsub_elements_paraview(const unsigned& nplot) const
2877  {
2878  throw OomphLibError(
2879  "This function hasn't been implemented for this element",
2882 
2883  // Dummy unsigned
2884  return 0;
2885  }
2886 
2889  void output_paraview(std::ofstream& file_out, const unsigned& nplot) const
2890  {
2891  // Decide the dimensions of the nodes
2892  unsigned nnod = nnode();
2893  if (nnod == 0) return;
2894  unsigned n = node_pt(0)->ndim();
2895 
2896  // Vector for local coordinates
2897  Vector<double> s(n, 0.0);
2898 
2899  // Vector for cartesian coordinates
2900  Vector<double> x(n, 0.0);
2901 
2902  // Determine the total number of plotpoints
2903  unsigned plot = nplot_points_paraview(nplot);
2904 
2905  // Loop over the local points
2906  for (unsigned j = 0; j < plot; j++)
2907  {
2908  // Determine where in the local element the point is
2909  this->get_s_plot(j, nplot, s);
2910 
2911  // Update the cartesian coordinates vector
2912  this->interpolated_x(s, x);
2913 
2914  // Print the global coordinates. Note: no whitespace after last
2915  // coordinate or paraview is very unhappy.
2916  for (unsigned i = 0; i < n - 1; i++)
2917  {
2918  file_out << x[i] << " ";
2919  }
2920  file_out << x[n - 1];
2921 
2922  // Since unstructured grid always needs 3 components for each
2923  // point, output 0's by default
2924  switch (n)
2925  {
2926  case 1:
2927  file_out << " 0"
2928  << " 0" << std::endl;
2929  break;
2930 
2931  case 2:
2932  file_out << " 0" << std::endl;
2933  break;
2934 
2935  case 3:
2936  file_out << std::endl;
2937  break;
2938 
2939  // Paraview can't handle more than 3 dimensions, output error
2940  default:
2941  throw OomphLibError(
2942  "Printing PlotPoint to .vtu failed; it has >3 dimensions.",
2945  }
2946  }
2947  }
2948 
2953  std::ofstream& file_out, const unsigned& nplot, unsigned& counter) const
2954  {
2955  throw OomphLibError(
2956  "This function hasn't been implemented for this element",
2959  }
2960 
2964  virtual void write_paraview_type(std::ofstream& file_out,
2965  const unsigned& nplot) const
2966  {
2967  throw OomphLibError(
2968  "This function hasn't been implemented for this element",
2971  }
2972 
2976  virtual void write_paraview_offsets(std::ofstream& file_out,
2977  const unsigned& nplot,
2978  unsigned& offset_sum) const
2979  {
2980  throw OomphLibError(
2981  "This function hasn't been implemented for this element",
2984  }
2985 
2988  virtual unsigned nscalar_paraview() const
2989  {
2990  throw OomphLibError(
2991  "This function hasn't been implemented for this element",
2994 
2995  // Dummy unsigned
2996  return 0;
2997  }
2998 
3001  virtual void scalar_value_paraview(std::ofstream& file_out,
3002  const unsigned& i,
3003  const unsigned& nplot) const
3004  {
3005  throw OomphLibError(
3006  "This function hasn't been implemented for this element",
3009  }
3010 
3014  std::ofstream& file_out,
3015  const unsigned& i,
3016  const unsigned& nplot,
3017  FiniteElement::SteadyExactSolutionFctPt exact_soln_pt) const
3018  {
3019  throw OomphLibError(
3020  "This function hasn't been implemented for this element",
3023  }
3024 
3028  std::ofstream& file_out,
3029  const unsigned& i,
3030  const unsigned& nplot,
3031  const double& time,
3032  FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt) const
3033  {
3034  throw OomphLibError(
3035  "This function hasn't been implemented for this element",
3038  }
3039 
3043  virtual std::string scalar_name_paraview(const unsigned& i) const
3044  {
3045  return "V" + StringConversion::to_string(i);
3046  }
3047 
3050  virtual void output(std::ostream& outfile)
3051  {
3052  throw OomphLibError(
3053  "Output function function hasn't been implemented for this element",
3056  }
3057 
3060  virtual void output(std::ostream& outfile, const unsigned& n_plot)
3061  {
3062  throw OomphLibError(
3063  "Output function function hasn't been implemented for this element",
3066  }
3067 
3071  virtual void output(const unsigned& t,
3072  std::ostream& outfile,
3073  const unsigned& n_plot) const
3074  {
3075  throw OomphLibError(
3076  "Output function function hasn't been implemented for this element",
3079  }
3080 
3084  virtual void output(FILE* file_pt)
3085  {
3086  throw OomphLibError("C-style otput function function hasn't been "
3087  "implemented for this element",
3090  }
3091 
3095  virtual void output(FILE* file_pt, const unsigned& n_plot)
3096  {
3097  throw OomphLibError("C-style output function function hasn't been "
3098  "implemented for this element",
3101  }
3102 
3104  virtual void output_fct(
3105  std::ostream& outfile,
3106  const unsigned& n_plot,
3108  {
3109  throw OomphLibError(
3110  "Output function function hasn't been implemented for exact solution",
3113  }
3114 
3115 
3117  virtual void output_fct(
3118  std::ostream& outfile,
3119  const unsigned& n_plot,
3120  const double& time,
3122  {
3123  throw OomphLibError(
3124  "Output function function hasn't been implemented for exact solution",
3127  }
3128 
3130  virtual void output_fct(std::ostream& outfile,
3131  const unsigned& n_plot,
3132  const double& time,
3133  const SolutionFunctorBase& exact_soln) const
3134  {
3135  throw OomphLibError(
3136  "Output function function hasn't been implemented for exact solution",
3139  }
3140 
3141 
3148  virtual void get_s_plot(const unsigned& i,
3149  const unsigned& nplot,
3150  Vector<double>& s,
3151  const bool& shifted_to_interior = false) const
3152  {
3153  throw OomphLibError(
3154  "get_s_plot(...) is not implemented for this element\n",
3157  };
3158 
3161  virtual std::string tecplot_zone_string(const unsigned& nplot) const
3162  {
3163  throw OomphLibError(
3164  "tecplot_zone_string(...) is not implemented for this element\n",
3167  return "dummy return";
3168  }
3169 
3174  virtual void write_tecplot_zone_footer(std::ostream& outfile,
3175  const unsigned& nplot) const {};
3176 
3181  virtual void write_tecplot_zone_footer(FILE* file_pt,
3182  const unsigned& nplot) const {};
3183 
3186  virtual unsigned nplot_points(const unsigned& nplot) const
3187  {
3188  throw OomphLibError(
3189  "nplot_points(...) is not implemented for this element",
3192  // Dummy return
3193  return 0;
3194  }
3195 
3196 
3198  virtual void compute_error(
3200  double& error,
3201  double& norm)
3202  {
3203  std::string error_message = "compute_error undefined for this element \n";
3204  throw OomphLibError(
3206  }
3207 
3209  virtual void compute_error(
3211  const double& time,
3212  double& error,
3213  double& norm)
3214  {
3215  std::string error_message = "time-dependent compute_error ";
3216  error_message += "undefined for this element \n";
3217  throw OomphLibError(
3219  }
3220 
3225  virtual void compute_error(
3228  Vector<double>& norm)
3229  {
3230  std::string error_message = "compute_error undefined for this element \n";
3231  throw OomphLibError(
3233  }
3234 
3239  virtual void compute_error(
3241  const double& time,
3243  Vector<double>& norm)
3244  {
3245  std::string error_message = "time-dependent compute_error ";
3246  error_message += "undefined for this element \n";
3247  throw OomphLibError(
3249  }
3250 
3251 
3256  virtual void compute_error(
3257  std::ostream& outfile,
3259  double& error,
3260  double& norm)
3261  {
3262  std::string error_message = "compute_error undefined for this element \n";
3263  outfile << error_message;
3264 
3265  throw OomphLibError(
3267  }
3268 
3272  virtual void compute_error(
3273  std::ostream& outfile,
3275  const double& time,
3276  double& error,
3277  double& norm)
3278  {
3279  std::string error_message =
3280  "time-dependent compute_error undefined for this element \n";
3281  outfile << error_message;
3282 
3283  throw OomphLibError(
3285  }
3286 
3292  virtual void compute_error(
3293  std::ostream& outfile,
3296  Vector<double>& norm)
3297  {
3298  std::string error_message = "compute_error undefined for this element \n";
3299  outfile << error_message;
3300 
3301  throw OomphLibError(error_message,
3302  "FiniteElement::compute_error()",
3304  }
3305 
3311  virtual void compute_error(
3312  std::ostream& outfile,
3314  const double& time,
3316  Vector<double>& norm)
3317  {
3318  std::string error_message =
3319  "time-dependent compute_error undefined for this element \n";
3320  outfile << error_message;
3321 
3322  throw OomphLibError(error_message,
3323  "FiniteElement::compute_error()",
3325  }
3326 
3330  virtual void compute_abs_error(
3331  std::ostream& outfile,
3333  double& error)
3334  {
3335  std::string error_message =
3336  "compute_abs_error undefined for this element \n";
3337  outfile << error_message;
3338 
3339  throw OomphLibError(
3341  }
3342 
3346  Vector<double>& integral);
3347 
3348 
3351  void integrate_fct(
3353  const double& time,
3354  Vector<double>& integral);
3355 
3361  virtual void build_face_element(const int& face_index,
3362  FaceElement* face_element_pt);
3363 
3364 
3367  virtual unsigned self_test();
3368 
3371  virtual unsigned get_bulk_node_number(const int& face_index,
3372  const unsigned& i) const
3373  {
3374  std::string err = "Not implemented for this element.";
3375  throw OomphLibError(
3377  }
3378 
3380  virtual int face_outer_unit_normal_sign(const int& face_index) const
3381  {
3382  std::string err = "Not implemented for this element.";
3383  throw OomphLibError(
3385  }
3386 
3387  virtual unsigned nnode_on_face() const
3388  {
3389  std::string err = "Not implemented for this element.";
3390  throw OomphLibError(
3392  }
3393 
3395  void face_node_number_error_check(const unsigned& i) const
3396  {
3397 #ifdef RANGE_CHECKING
3398  if (i > nnode_on_face())
3399  {
3400  std::string err = "Face node index i out of range on face.";
3401  throw OomphLibError(
3403  }
3404 #endif
3405  }
3406 
3410  const int& face_index) const
3411  {
3412  std::string err = "Not implemented for this element.";
3413  throw OomphLibError(
3415  }
3416 
3420  const int& face_index) const
3421  {
3422  std::string err = "Not implemented for this element.";
3423  throw OomphLibError(
3425  }
3426  };
3427 
3428 
3432 
3433 
3434  //=======================================================================
3437  //=======================================================================
3438  class PointElement : public virtual FiniteElement
3439  {
3440  public:
3443  {
3446  this->set_n_node(1);
3447 
3448  // Set the integration scheme
3450  }
3451 
3453  PointElement(const PointElement&) = delete;
3454 
3456  /*void operator=(const PointElement&) = delete;*/
3457 
3459  void shape(const Vector<double>& s, Shape& psi) const;
3460 
3462  void local_coordinate_of_node(const unsigned& j, Vector<double>& s) const
3463  {
3464  s.resize(0);
3465  }
3466 
3469  // unsigned dim() const {return 0;}
3470 
3471  private:
3474  };
3475 
3476 
3480 
3481 
3482  class GeomObject;
3483 
3484  //=======================================================================
3494  //=======================================================================
3496  {
3497  public:
3501 
3502 
3505 
3507  void operator=(const SolidInitialCondition&) = delete;
3508 
3512  {
3513  return Geom_object_pt;
3514  }
3515 
3517  unsigned& ic_time_deriv()
3518  {
3519  return IC_time_deriv;
3520  }
3521 
3522 
3523  private:
3527 
3529  unsigned IC_time_deriv;
3530  };
3531 
3532 
3536 
3537 
3538  //============================================================================
3559  //============================================================================
3560  class SolidFiniteElement : public virtual FiniteElement
3561  {
3562  public:
3566  {
3568  }
3569 
3575  {
3576  return false;
3577  }
3578 
3582  typedef double (*MultiplierFctPt)(const Vector<double>& xi);
3583 
3586  : FiniteElement(),
3588  Solid_ic_pt(0),
3589  Multiplier_fct_pt(0),
3590  Position_local_eqn(0),
3594  {
3595  }
3596 
3598  virtual ~SolidFiniteElement();
3599 
3602 
3604  /*void operator=(const SolidFiniteElement&) = delete;*/
3605 
3608  inline unsigned ngeom_data() const
3609  {
3610  return nnode();
3611  }
3612 
3615  inline Data* geom_data_pt(const unsigned& j)
3616  {
3617  return static_cast<SolidNode*>(node_pt(j))->variable_position_pt();
3618  }
3619 
3624  void identify_geometric_data(std::set<Data*>& geometric_data_pt)
3625  {
3626  // Loop over the node update data and add to the set
3627  const unsigned n_node = this->nnode();
3628  for (unsigned n = 0; n < n_node; n++)
3629  {
3630  geometric_data_pt.insert(
3631  dynamic_cast<SolidNode*>(this->node_pt(n))->variable_position_pt());
3632  }
3633  }
3634 
3635 
3642  inline double zeta_nodal(const unsigned& n,
3643  const unsigned& k,
3644  const unsigned& i) const
3645  {
3646  return lagrangian_position_gen(n, k, i);
3647  }
3648 
3659  virtual void get_x_and_xi(const Vector<double>& s,
3660  Vector<double>& x_fe,
3661  Vector<double>& x,
3662  Vector<double>& xi_fe,
3663  Vector<double>& xi) const
3664  {
3665  throw OomphLibError(
3666  "get_x_and_xi(...) is not implemented for this element\n",
3669  }
3670 
3681  {
3684  }
3685 
3691  {
3694  }
3695 
3700  {
3702  }
3703 
3704 
3707  {
3708  return Undeformed_macro_elem_pt;
3709  }
3710 
3714  double dshape_lagrangian(const Vector<double>& s,
3715  Shape& psi,
3716  DShape& dpsidxi) const;
3717 
3720  virtual double dshape_lagrangian_at_knot(const unsigned& ipt,
3721  Shape& psi,
3722  DShape& dpsidxi) const;
3723 
3742  double d2shape_lagrangian(const Vector<double>& s,
3743  Shape& psi,
3744  DShape& dpsidxi,
3745  DShape& d2psidxi) const;
3746 
3765  virtual double d2shape_lagrangian_at_knot(const unsigned& ipt,
3766  Shape& psi,
3767  DShape& dpsidxi,
3768  DShape& d2psidxi) const;
3769 
3774  unsigned lagrangian_dimension() const
3775  {
3776  return Lagrangian_dimension;
3777  }
3778 
3785  unsigned nnodal_lagrangian_type() const
3786  {
3787  return Nnodal_lagrangian_type;
3788  }
3789 
3791  Node* construct_node(const unsigned& n)
3792  {
3793  // Construct a solid node and assign it to the local node pointer vector.
3794  // The dimension and number of values are taken from internal element data
3795  // The number of solid pressure dofs are also taken from internal data
3796  // The number of timesteps to be stored comes from the problem!
3799  nodal_dimension(),
3801  required_nvalue(n));
3802  // Now return a pointer to the node, so that the mesh can find it
3803  return node_pt(n);
3804  }
3805 
3809  Node* construct_node(const unsigned& n, TimeStepper* const& time_stepper_pt)
3810  {
3811  // Construct a solid node and assign it to the local node pointer vector
3812  // The dimension and number of values are taken from internal element data
3813  // The number of solid pressure dofs are also taken from internal data
3817  nodal_dimension(),
3819  required_nvalue(n));
3820  // Now return a pointer to the node, so that the mesh can find it
3821  return node_pt(n);
3822  }
3823 
3827  Node* construct_boundary_node(const unsigned& n)
3828  {
3829  // Construct a solid node and assign it to the local node pointer vector.
3830  // The dimension and number of values are taken from internal element data
3831  // The number of solid pressure dofs are also taken from internal data
3832  // The number of timesteps to be stored comes from the problem!
3835  nodal_dimension(),
3837  required_nvalue(n));
3838  // Now return a pointer to the node, so that the mesh can find it
3839  return node_pt(n);
3840  }
3841 
3846  Node* construct_boundary_node(const unsigned& n,
3847  TimeStepper* const& time_stepper_pt)
3848  {
3849  // Construct a solid node and assign it to the local node pointer vector
3850  // The dimension and number of values are taken from internal element data
3851  // The number of solid pressure dofs are also taken from internal data
3855  nodal_dimension(),
3857  required_nvalue(n));
3858  // Now return a pointer to the node, so that the mesh can find it
3859  return node_pt(n);
3860  }
3861 
3868  const bool& store_local_dof_pt)
3869  {
3870  // Call the standard finite element equation numbering
3871  //(internal, external and nodal data).
3873  // Assign the numbering for the solid dofs
3874  assign_solid_local_eqn_numbers(store_local_dof_pt);
3875  }
3876 
3885  void describe_local_dofs(std::ostream& out,
3886  const std::string& current_string) const;
3887 
3890  double raw_lagrangian_position(const unsigned& n, const unsigned& i) const
3891  {
3892  return static_cast<SolidNode*>(node_pt(n))->xi(i);
3893  }
3894 
3897  double raw_lagrangian_position_gen(const unsigned& n,
3898  const unsigned& k,
3899  const unsigned& i) const
3900  {
3901  return static_cast<SolidNode*>(node_pt(n))->xi_gen(k, i);
3902  }
3903 
3905  double lagrangian_position(const unsigned& n, const unsigned& i) const
3906  {
3907  return static_cast<SolidNode*>(node_pt(n))->lagrangian_position(i);
3908  }
3909 
3912  double lagrangian_position_gen(const unsigned& n,
3913  const unsigned& k,
3914  const unsigned& i) const
3915  {
3916  return static_cast<SolidNode*>(node_pt(n))->lagrangian_position_gen(k, i);
3917  }
3918 
3921  virtual double interpolated_xi(const Vector<double>& s,
3922  const unsigned& i) const;
3923 
3926  virtual void interpolated_xi(const Vector<double>& s,
3927  Vector<double>& xi) const;
3928 
3931  virtual void interpolated_dxids(const Vector<double>& s,
3932  DenseMatrix<double>& dxids) const;
3933 
3936  virtual void J_lagrangian(const Vector<double>& s) const
3937  {
3938  // Must be implemented and overloaded in FaceElements
3939  throw OomphLibError("Function not implemented yet",
3942  }
3943 
3946  virtual double J_lagrangian_at_knot(const unsigned& ipt) const
3947  {
3948  // Must be implemented and overloaded in FaceElements
3949  throw OomphLibError("Function not implemented yet",
3952  }
3953 
3956  {
3957  return Solid_ic_pt;
3958  }
3959 
3967  {
3969  }
3970 
3973  {
3975  }
3976 
3980  {
3981  return Multiplier_fct_pt;
3982  }
3983 
3984 
3989  {
3990  return Multiplier_fct_pt;
3991  }
3992 
3993 
4004  {
4005  residuals.initialise(0.0);
4006  fill_in_residuals_for_solid_ic(residuals);
4007  }
4008 
4019  {
4020  // Call the generic residuals function with flag set to 0
4021  // using a dummy matrix argument
4023  residuals, GeneralisedElement::Dummy_matrix, 0);
4024  }
4025 
4036  DenseMatrix<double>& jacobian)
4037  {
4038  // Call the generic routine with the flag set to 1
4039  fill_in_generic_jacobian_for_solid_ic(residuals, jacobian, 1);
4040  }
4041 
4042 
4047 
4048 
4051  void compute_norm(double& el_norm);
4052 
4053  protected:
4065  DenseMatrix<double>& jacobian,
4066  const unsigned& flag);
4067 
4070  void set_nnodal_lagrangian_type(const unsigned& nlagrangian_type)
4071  {
4072  Nnodal_lagrangian_type = nlagrangian_type;
4073  }
4074 
4077 
4083  const DShape& dpsids,
4084  DenseMatrix<double>& jacobian,
4085  DenseMatrix<double>& inverse_jacobian) const
4086  {
4087  // Assemble the jacobian
4088  assemble_local_to_lagrangian_jacobian(dpsids, jacobian);
4089  // Invert the jacobian
4090  return invert_jacobian_mapping(jacobian, inverse_jacobian);
4091  }
4092 
4098  const DShape& dpsids, DenseMatrix<double>& inverse_jacobian) const
4099  {
4100  // Find the dimension of the element
4101  unsigned el_dim = dim();
4102  // Assign memory for the jacobian
4103  DenseMatrix<double> jacobian(el_dim);
4104  // Calculate the jacobian and inverse
4105  return local_to_lagrangian_mapping(dpsids, jacobian, inverse_jacobian);
4106  }
4107 
4114  virtual double local_to_lagrangian_mapping_diagonal(
4115  const DShape& dpsids,
4116  DenseMatrix<double>& jacobian,
4117  DenseMatrix<double>& inverse_jacobian) const;
4118 
4119 
4124  virtual void assign_solid_local_eqn_numbers(const bool& store_local_dof);
4125 
4127  void describe_solid_local_dofs(std::ostream& out,
4128  const std::string& current_string) const;
4129 
4132 
4133  public:
4137  inline int position_local_eqn(const unsigned& n,
4138  const unsigned& k,
4139  const unsigned& j) const
4140  {
4141 #ifdef RANGE_CHECKING
4142  std::ostringstream error_message;
4143  bool error = false;
4144  if (n >= nnode())
4145  {
4146  error = true;
4147  error_message << "Range Error: Nodal number " << n
4148  << " is not in the range (0," << nnode() << ")";
4149  }
4150 
4151  if (k >= nnodal_position_type())
4152  {
4153  error = true;
4154  error_message << "Range Error: Position type " << k
4155  << " is not in the range (0," << nnodal_position_type()
4156  << ")";
4157  }
4158 
4159  if (j >= nodal_dimension())
4160  {
4161  error = true;
4162  error_message << "Range Error: Nodal coordinate " << j
4163  << " is not in the range (0," << nodal_dimension() << ")";
4164  }
4165 
4166  if (error)
4167  {
4168  // Throw the error
4169  throw OomphLibError(error_message.str(),
4172  }
4173 #endif
4174 
4175  // Return the value
4176  return Position_local_eqn[(n * nnodal_position_type() + k) *
4177  nodal_dimension() +
4178  j];
4179  }
4180 
4181  protected:
4186  DenseMatrix<double>& jacobian)
4187  {
4188  // Add the contribution to the residuals
4190 
4191  // Solve for the consistent acceleration in Newmark scheme?
4193  {
4195  return;
4196  }
4197 
4198  // Allocate storage for the full residuals (residuals of entire element)
4199  unsigned n_dof = ndof();
4200  Vector<double> full_residuals(n_dof);
4201  // Get the residuals for the entire element
4202  get_residuals(full_residuals);
4203  // Get the solid entries in the jacobian using finite differences
4204  fill_in_jacobian_from_solid_position_by_fd(full_residuals, jacobian);
4205  // There could be internal data
4206  //(finite-difference the lot by default)
4207  fill_in_jacobian_from_internal_by_fd(full_residuals, jacobian, true);
4208  // There could also be external data
4209  //(finite-difference the lot by default)
4210  fill_in_jacobian_from_external_by_fd(full_residuals, jacobian, true);
4211  // There could also be nodal data
4212  fill_in_jacobian_from_nodal_by_fd(full_residuals, jacobian);
4213  }
4214 
4215 
4220  Vector<double>& residuals, DenseMatrix<double>& jacobian);
4221 
4222 
4226  DenseMatrix<double>& jacobian)
4227  {
4228  // Allocate storage for a residuals vector and initialise to zero
4229  unsigned n_dof = ndof();
4230  Vector<double> residuals(n_dof, 0.0);
4231  // Get the residuals for the entire element
4232  get_residuals(residuals);
4233  // Call the jacobian calculation
4234  fill_in_jacobian_from_solid_position_by_fd(residuals, jacobian);
4235  }
4236 
4240  virtual inline void update_before_solid_position_fd() {}
4241 
4245  virtual inline void reset_after_solid_position_fd() {}
4246 
4250  virtual inline void update_in_solid_position_fd(const unsigned& i) {}
4251 
4255  virtual inline void reset_in_solid_position_fd(const unsigned& i)
4256  {
4258  }
4259 
4260 
4261  private:
4265  const DShape& dpsids, DenseMatrix<double>& jacobian) const;
4266 
4267 
4271  const DShape& d2psids, DenseMatrix<double>& jacobian2) const;
4272 
4277 
4280  // ALH: (This is here so that the numbering can be done automatically)
4282 
4286 
4294 
4295  protected:
4303 
4304  private:
4308  inline double multiplier(const Vector<double>& xi)
4309  {
4310  // If no function has been set, return 1
4311  if (Multiplier_fct_pt == 0)
4312  {
4313  return 1.0;
4314  }
4315  else
4316  {
4317  // Evaluate function pointer
4318  return (*Multiplier_fct_pt)(xi);
4319  }
4320  }
4321  };
4322 
4323 
4324  //========================================================================
4336  //========================================================================
4337  class FaceElement : public virtual FiniteElement
4338  {
4341  typedef void (*CoordinateMappingFctPt)(const Vector<double>& s,
4342  Vector<double>& s_bulk);
4343 
4350  const Vector<double>& s,
4351  DenseMatrix<double>& ds_bulk_dsface,
4352  unsigned& interior_direction);
4353 
4354  private:
4358 
4362 
4371 
4375 
4378 
4385 
4386  protected:
4389 
4390 #ifdef PARANOID
4391 
4394  bool Boundary_number_in_bulk_mesh_has_been_set;
4395 
4396 #endif
4397 
4400 
4404 
4410  // NOTE: This breaks if the nodes have already been resized
4411  // before calling the face element, i.e. two separate sets of equations on
4412  // the face!
4414 
4421 
4428  void add_additional_values(const Vector<unsigned>& nadditional_values,
4429  const unsigned& id)
4430  {
4431  // How many nodes?
4432  const unsigned n_node = nnode();
4433 
4434  // loop over the nodes
4435  for (unsigned n = 0; n < n_node; n++)
4436  {
4437  // Assign the required number of additional nodes to the node
4438  dynamic_cast<BoundaryNodeBase*>(this->node_pt(n))
4439  ->assign_additional_values_with_face_id(nadditional_values[n], id);
4440  }
4441  }
4442 
4443 
4444  public:
4449  Normal_sign(0),
4450  Face_index(0),
4452  Bulk_element_pt(0),
4454  {
4455  // Check whether things have been set
4456 #ifdef PARANOID
4457  Boundary_number_in_bulk_mesh_has_been_set = false;
4458 #endif
4459 
4460  // Bulk_position_type[0] is always 0 (the position)
4461  Bulk_position_type.push_back(0);
4462  }
4463 
4465  virtual ~FaceElement() {}
4466 
4467 
4469  FaceElement(const FaceElement&) = delete;
4470 
4472  /*void operator=(const FaceElement&) = delete;*/
4473 
4475  inline const unsigned& boundary_number_in_bulk_mesh() const
4476  {
4478  }
4479 
4480 
4482  inline void set_boundary_number_in_bulk_mesh(const unsigned& b)
4483  {
4485 #ifdef PARANOID
4486  Boundary_number_in_bulk_mesh_has_been_set = true;
4487 #endif
4488  }
4489 
4497  double zeta_nodal(const unsigned& n,
4498  const unsigned& k,
4499  const unsigned& i) const
4500  {
4501  // Vector in which to hold the intrinsic coordinate
4502  Vector<double> zeta(this->dim());
4503 
4504  // Get the k-th generalised boundary coordinate at node n
4507 
4508  // Return the individual coordinate
4509  return zeta[i];
4510  }
4511 
4515  double J_eulerian(const Vector<double>& s) const;
4516 
4520  double J_eulerian_at_knot(const unsigned& ipt) const;
4521 
4524  void check_J_eulerian_at_knots(bool& passed) const;
4525 
4528  double interpolated_x(const Vector<double>& s, const unsigned& i) const
4529  {
4530  // Local coordinates in bulk element
4531  Vector<double> s_bulk(dim() + 1);
4532  s_bulk = local_coordinate_in_bulk(s);
4533 
4534  // Return Eulerian coordinate as computed by bulk
4535  return bulk_element_pt()->interpolated_x(s_bulk, i);
4536  }
4537 
4541  double interpolated_x(const unsigned& t,
4542  const Vector<double>& s,
4543  const unsigned& i) const
4544  {
4545  // Local coordinates in bulk element
4546  Vector<double> s_bulk(dim() + 1);
4547  s_bulk = local_coordinate_in_bulk(s);
4548 
4549  // Return Eulerian coordinate as computed by bulk
4550  return bulk_element_pt()->interpolated_x(t, s_bulk, i);
4551  }
4552 
4556  {
4557  // Local coordinates in bulk element
4558  Vector<double> s_bulk(dim() + 1);
4559  s_bulk = local_coordinate_in_bulk(s);
4560 
4561  // Get Eulerian position vector
4562  bulk_element_pt()->interpolated_x(s_bulk, x);
4563  }
4564 
4568  void interpolated_x(const unsigned& t,
4569  const Vector<double>& s,
4570  Vector<double>& x) const
4571  {
4572  // Local coordinates in bulk element
4573  Vector<double> s_bulk(dim() + 1);
4574  s_bulk = local_coordinate_in_bulk(s);
4575 
4576  // Get Eulerian position vector
4577  bulk_element_pt()->interpolated_x(t, s_bulk, x);
4578  }
4579 
4584  const unsigned& i,
4585  const unsigned& t)
4586  {
4587  // Local coordinates in bulk element
4588  Vector<double> s_bulk(dim() + 1);
4589  s_bulk = local_coordinate_in_bulk(s);
4590 
4591  // Return Eulerian coordinate as computed by bulk
4592  return bulk_element_pt()->interpolated_dxdt(s_bulk, i, t);
4593  }
4594 
4599  const unsigned& t,
4600  Vector<double>& dxdt)
4601  {
4602  // Local coordinates in bulk element
4603  Vector<double> s_bulk(dim() + 1);
4604  s_bulk = local_coordinate_in_bulk(s);
4605 
4606  // Get Eulerian position vector
4607  bulk_element_pt()->interpolated_dxdt(s_bulk, t, dxdt);
4608  }
4609 
4613  {
4614  return Normal_sign;
4615  }
4616 
4619  int normal_sign() const
4620  {
4621  return Normal_sign;
4622  }
4623 
4626  int& face_index()
4627  {
4628  return Face_index;
4629  }
4630 
4633  int face_index() const
4634  {
4635  return Face_index;
4636  }
4637 
4640  {
4641  return Tangent_direction_pt;
4642  }
4643 
4646  {
4647 #ifdef PARANOID
4648  // Check that tangent_direction_pt is not null.
4649  if (tangent_direction_pt == 0)
4650  {
4651  std::ostringstream error_message;
4652  error_message << "The pointer tangent_direction_pt is null.\n";
4653  throw OomphLibError(error_message.str(),
4656  }
4657 
4658  // Check that the vector is the correct size.
4659  // The size of the tangent vector.
4660  unsigned tang_dir_size = tangent_direction_pt->size();
4661  unsigned spatial_dimension = this->nodal_dimension();
4662  if (tang_dir_size != spatial_dimension)
4663  {
4664  std::ostringstream error_message;
4665  error_message << "The tangent direction vector has size "
4666  << tang_dir_size << "\n"
4667  << "but this element has spatial dimension "
4668  << spatial_dimension << ".\n";
4669  throw OomphLibError(error_message.str(),
4672  }
4673 
4674  if (tang_dir_size == 2)
4675  {
4676  std::ostringstream warning_message;
4677  warning_message
4678  << "The spatial dimension is " << spatial_dimension << ".\n"
4679  << "I do not need a tangent direction vector to create \n"
4680  << "continuous tangent vectors in two spatial dimensions.";
4681  OomphLibWarning(warning_message.str(),
4684  }
4685 #endif
4686 
4687  // Set the direction vector for the tangent.
4689  }
4690 
4694  {
4696  }
4697 
4701  {
4703  }
4704 
4713  const Vector<double>& s,
4714  Vector<Vector<double>>& tang_vec,
4715  Vector<double>& unit_normal) const;
4716 
4722  const unsigned& ipt,
4723  Vector<Vector<double>>& tang_vec,
4724  Vector<double>& unit_normal) const;
4725 
4727  void outer_unit_normal(const Vector<double>& s,
4728  Vector<double>& unit_normal) const;
4729 
4731  void outer_unit_normal(const unsigned& ipt,
4732  Vector<double>& unit_normal) const;
4733 
4736  {
4737  return Bulk_element_pt;
4738  }
4739 
4740 
4743  {
4744  return Bulk_element_pt;
4745  }
4746 
4747  // Clang specific pragma's
4748 #ifdef __clang__
4749 #pragma clang diagnostic push
4750 #pragma clang diagnostic ignored "-Woverloaded-virtual"
4751 #endif
4752 
4756  {
4758  }
4759 
4763  {
4765  }
4766 
4767 
4771  {
4773  }
4774 
4778  {
4780  }
4781 
4782 #ifdef __clang__
4783 #pragma clang diagnostic pop
4784 #endif
4785 
4789 
4793  Vector<double>& s_bulk) const;
4794 
4799  void get_ds_bulk_ds_face(const Vector<double>& s,
4800  DenseMatrix<double>& dsbulk_dsface,
4801  unsigned& interior_direction) const;
4802 
4805  unsigned& bulk_position_type(const unsigned& i)
4806  {
4807  return Bulk_position_type[i];
4808  }
4809 
4812  const unsigned& bulk_position_type(const unsigned& i) const
4813  {
4814  return Bulk_position_type[i];
4815  }
4816 
4818  void bulk_node_number_resize(const unsigned& i)
4819  {
4820  Bulk_node_number.resize(i);
4821  }
4822 
4825  unsigned& bulk_node_number(const unsigned& n)
4826  {
4827  return Bulk_node_number[n];
4828  }
4829 
4832  const unsigned& bulk_node_number(const unsigned& n) const
4833  {
4834  return Bulk_node_number[n];
4835  }
4836 
4838  void bulk_position_type_resize(const unsigned& i)
4839  {
4840  Bulk_position_type.resize(i);
4841  }
4842 
4845  unsigned& nbulk_value(const unsigned& n)
4846  {
4847  return Nbulk_value[n];
4848  }
4849 
4853  unsigned nbulk_value(const unsigned& n) const
4854  {
4855  return Nbulk_value[n];
4856  }
4857 
4860  void nbulk_value_resize(const unsigned& i)
4861  {
4862  Nbulk_value.resize(i);
4863  }
4864 
4882  void resize_nodes(Vector<unsigned>& nadditional_data_values)
4883  {
4884  // Locally cache the number of node
4885  unsigned n_node = nnode();
4886  // Resize the storage for values at the nodes:
4887  for (unsigned l = 0; l < n_node; l++)
4888  {
4889  // Find number of values stored at the node
4890  unsigned Initial_Nvalue = node_pt(l)->nvalue();
4891  // Read out the number of additional values
4892  unsigned Nadditional = nadditional_data_values[l];
4893  // If the node has not already been resized, resize it
4894  if ((Initial_Nvalue == Nbulk_value[l]) && (Nadditional > 0))
4895  {
4896  // Resize the node according to the number of additional values
4897  node_pt(l)->resize(Nbulk_value[l] + Nadditional);
4898  }
4899  } // End of loop over nodes
4900  }
4901 
4903  void output_zeta(std::ostream& outfile, const unsigned& nplot);
4904  };
4905 
4906 
4907  //========================================================================
4911  //========================================================================
4912  class SolidFaceElement : public virtual FaceElement,
4913  public virtual SolidFiniteElement
4914  {
4915  public:
4921  double zeta_nodal(const unsigned& n,
4922  const unsigned& k,
4923  const unsigned& i) const
4924  {
4925  return FaceElement::zeta_nodal(n, k, i);
4926  }
4927 
4928 
4937  double interpolated_xi(const Vector<double>& s, const unsigned& i) const
4938  {
4939  // Local coordinates in bulk element
4940  Vector<double> s_bulk(dim() + 1);
4941  s_bulk = local_coordinate_in_bulk(s);
4942 
4943  // Return Lagrangian coordinate as computed by bulk
4944  return dynamic_cast<SolidFiniteElement*>(bulk_element_pt())
4945  ->interpolated_xi(s_bulk, i);
4946  }
4947 
4948 
4958  {
4959  // Local coordinates in bulk element
4960  Vector<double> s_bulk(dim() + 1);
4961  s_bulk = local_coordinate_in_bulk(s);
4962 
4963  // Get Lagrangian position vector
4964  dynamic_cast<SolidFiniteElement*>(bulk_element_pt())
4965  ->interpolated_xi(s_bulk, xi);
4966  }
4967  };
4968 
4969 
4973 
4974 
4975  //=======================================================================
4977  //=======================================================================
4978  class SolidPointElement : public virtual SolidFiniteElement,
4979  public virtual PointElement
4980  {
4981  };
4982 
4983 
4987 
4988 
4989  //=======================================================================
4995  //=======================================================================
4996  template<class ELEMENT>
4998  {
4999  };
5000 
5001 
5005 
5006 
5007  //======================================================================
5010  //======================================================================
5011  template<class ELEMENT>
5012  class DummyFaceElement : public virtual FaceGeometry<ELEMENT>,
5013  public virtual FaceElement
5014  {
5015  public:
5018  DummyFaceElement(FiniteElement* const& element_pt, const int& face_index)
5019  : FaceGeometry<ELEMENT>(), FaceElement()
5020  {
5021  // Attach the geometrical information to the element. N.B. This function
5022  // also assigns nbulk_value from the required_nvalue of the bulk element
5023  element_pt->build_face_element(face_index, this);
5024  }
5025 
5026 
5029 
5030 
5034  double zeta_nodal(const unsigned& n,
5035  const unsigned& k,
5036  const unsigned& i) const
5037  {
5038  return FaceElement::zeta_nodal(n, k, i);
5039  }
5040 
5042  void output(std::ostream& outfile)
5043  {
5044  outfile << "ZONE" << std::endl;
5045  unsigned nnod = nnode();
5046  for (unsigned j = 0; j < nnod; j++)
5047  {
5048  Node* nod_pt = node_pt(j);
5049  unsigned dim = nod_pt->ndim();
5050  for (unsigned i = 0; i < dim; i++)
5051  {
5052  outfile << nod_pt->x(i) << " ";
5053  }
5054  outfile << std::endl;
5055  }
5056  }
5057 
5059  void output(std::ostream& outfile, const unsigned& n_plot)
5060  {
5061  FiniteElement::output(outfile, n_plot);
5062  }
5063 
5065  void output(FILE* file_pt)
5066  {
5067  FiniteElement::output(file_pt);
5068  }
5069 
5071  void output(FILE* file_pt, const unsigned& n_plot)
5072  {
5073  FiniteElement::output(file_pt, n_plot);
5074  }
5075  };
5076 
5080 
5081 
5082  //=========================================================================
5086  //=========================================================================
5088  {
5089  public:
5092 
5095 
5098  virtual void get_drag_and_torque(Vector<double>& drag_force,
5099  Vector<double>& drag_torque) = 0;
5100  };
5101 
5102 
5106 
5107 
5108  //======================================================================
5116  //======================================================================
5117  template<class ELEMENT>
5118  class FreeStandingFaceElement : public virtual FaceGeometry<ELEMENT>
5119  {
5120  public:
5124  {
5125  // Check whether things have been set
5126 #ifdef PARANOID
5127  Boundary_number_in_bulk_mesh_has_been_set = false;
5128 #endif
5129  }
5130 
5132  inline const unsigned& boundary_number_in_bulk_mesh() const
5133  {
5135  }
5136 
5137 
5139  inline void set_boundary_number_in_bulk_mesh(const unsigned& b)
5140  {
5142 #ifdef PARANOID
5143  Boundary_number_in_bulk_mesh_has_been_set = true;
5144 #endif
5145  }
5146 
5154  double zeta_nodal(const unsigned& n,
5155  const unsigned& k,
5156  const unsigned& i) const
5157  {
5158  // Vector in which to hold the intrinsic coordinate
5159  Vector<double> zeta(this->dim());
5160 
5161  // Get the k-th generalised boundary coordinate at node n
5162  this->node_pt(n)->get_coordinates_on_boundary(
5164 
5165  // Return the individual coordinate
5166  return zeta[i];
5167  }
5168 
5169  protected:
5172 
5173 #ifdef PARANOID
5174 
5177  bool Boundary_number_in_bulk_mesh_has_been_set;
5178 
5179 #endif
5180  };
5181 
5182 
5186 
5187 
5188  //======================================================================
5191  //======================================================================
5193  {
5194  public:
5197 
5200 
5203  const SolidElementWithDiagonalMassMatrix&) = delete;
5204 
5207 
5212  virtual void get_mass_matrix_diagonal(Vector<double>& mass_diag) = 0;
5213  };
5214 
5215 
5219 
5220 
5221  //======================================================================
5229  //======================================================================
5231  {
5232  public:
5235 
5238 
5242 
5245 
5251  Vector<double>& press_mass_diag,
5252  Vector<double>& veloc_mass_diag,
5253  const unsigned& which_one = 0) = 0;
5254  };
5255 
5256 
5260 
5261 } // namespace oomph
5262 
5263 #endif
int i
Definition: BiCGSTAB_step_by_step.cpp:9
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
int data[]
Definition: Map_placement_new.cpp:1
Scalar * b
Definition: benchVecAdd.cpp:17
Allows for timing the algorithms; accurate up to 0.01 sec.
Definition: MercuryTime.h:25
Definition: nodes.h:1996
Definition: nodes.h:2242
Definition: shape.h:278
Definition: nodes.h:86
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
Definition: nodes.h:238
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
Definition: nodes.h:483
void set_time_stepper(TimeStepper *const &time_stepper_pt, const bool &preserve_existing_data)
Definition: nodes.cc:406
void initialise(const T &val)
Initialize all values in the matrix to val.
Definition: matrices.h:514
Definition: elements.h:5014
DummyFaceElement()
Constructor.
Definition: elements.h:5028
void output(std::ostream &outfile)
Output nodal coordinates.
Definition: elements.h:5042
double zeta_nodal(const unsigned &n, const unsigned &k, const unsigned &i) const
Definition: elements.h:5034
void output(FILE *file_pt, const unsigned &n_plot)
C_style output at n_plot points.
Definition: elements.h:5071
void output(std::ostream &outfile, const unsigned &n_plot)
Output at n_plot points.
Definition: elements.h:5059
DummyFaceElement(FiniteElement *const &element_pt, const int &face_index)
Definition: elements.h:5018
void output(FILE *file_pt)
C-style output.
Definition: elements.h:5065
Definition: elements.h:5088
virtual void get_drag_and_torque(Vector< double > &drag_force, Vector< double > &drag_torque)=0
virtual ~ElementWithDragFunction()
Empty virtual destructor.
Definition: elements.h:5094
ElementWithDragFunction()
Empty constructor.
Definition: elements.h:5091
Definition: elements.h:4338
void interpolated_x(const Vector< double > &s, Vector< double > &x) const
Definition: elements.h:4555
void turn_on_warning_for_discontinuous_tangent()
Definition: elements.h:4693
unsigned & bulk_position_type(const unsigned &i)
Definition: elements.h:4805
double interpolated_dxdt(const Vector< double > &s, const unsigned &i, const unsigned &t)
Definition: elements.h:4583
unsigned nbulk_value(const unsigned &n) const
Definition: elements.h:4853
unsigned Boundary_number_in_bulk_mesh
The boundary number in the bulk mesh to which this element is attached.
Definition: elements.h:4388
CoordinateMappingFctPt face_to_bulk_coordinate_fct_pt() const
Definition: elements.h:4762
Vector< unsigned > Bulk_node_number
Definition: elements.h:4403
CoordinateMappingFctPt & face_to_bulk_coordinate_fct_pt()
Definition: elements.h:4755
FiniteElement * Bulk_element_pt
Pointer to the associated higher-dimensional "bulk" element.
Definition: elements.h:4399
void bulk_node_number_resize(const unsigned &i)
Resize the storage for the bulk node numbers.
Definition: elements.h:4818
const Vector< double > * tangent_direction_pt() const
Public access function for the tangent direction pointer.
Definition: elements.h:4639
int face_index() const
Definition: elements.h:4633
BulkCoordinateDerivativesFctPt bulk_coordinate_derivatives_fct_pt() const
Definition: elements.h:4777
int & face_index()
Definition: elements.h:4626
void outer_unit_normal(const Vector< double > &s, Vector< double > &unit_normal) const
Compute outer unit normal at the specified local coordinate.
Definition: elements.cc:6006
void turn_off_warning_for_discontinuous_tangent()
Definition: elements.h:4700
int Face_index
Index of the face.
Definition: elements.h:4377
unsigned & nbulk_value(const unsigned &n)
Definition: elements.h:4845
double zeta_nodal(const unsigned &n, const unsigned &k, const unsigned &i) const
Definition: elements.h:4497
int Normal_sign
Definition: elements.h:4374
BulkCoordinateDerivativesFctPt Bulk_coordinate_derivatives_fct_pt
Definition: elements.h:4361
Vector< double > local_coordinate_in_bulk(const Vector< double > &s) const
Definition: elements.cc:6353
FaceElement()
Constructor: Initialise all appropriate member data.
Definition: elements.h:4446
void add_additional_values(const Vector< unsigned > &nadditional_values, const unsigned &id)
Definition: elements.h:4428
void(* BulkCoordinateDerivativesFctPt)(const Vector< double > &s, DenseMatrix< double > &ds_bulk_dsface, unsigned &interior_direction)
Definition: elements.h:4349
Vector< double > * Tangent_direction_pt
Definition: elements.h:4420
void interpolated_x(const unsigned &t, const Vector< double > &s, Vector< double > &x) const
Definition: elements.h:4568
FiniteElement *& bulk_element_pt()
Pointer to higher-dimensional "bulk" element.
Definition: elements.h:4735
const unsigned & boundary_number_in_bulk_mesh() const
Broken assignment operator.
Definition: elements.h:4475
int normal_sign() const
Definition: elements.h:4619
double interpolated_x(const Vector< double > &s, const unsigned &i) const
Definition: elements.h:4528
void bulk_position_type_resize(const unsigned &i)
Resize the storage for bulk_position_type to i entries.
Definition: elements.h:4838
FiniteElement * bulk_element_pt() const
Pointer to higher-dimensional "bulk" element (const version)
Definition: elements.h:4742
double J_eulerian(const Vector< double > &s) const
Definition: elements.cc:5242
Vector< unsigned > Bulk_position_type
Definition: elements.h:4370
static bool Ignore_discontinuous_tangent_warning
Definition: elements.h:4384
void set_tangent_direction(Vector< double > *tangent_direction_pt)
Set the tangent direction vector.
Definition: elements.h:4645
double J_eulerian_at_knot(const unsigned &ipt) const
Definition: elements.cc:5328
const unsigned & bulk_position_type(const unsigned &i) const
Definition: elements.h:4812
void(* CoordinateMappingFctPt)(const Vector< double > &s, Vector< double > &s_bulk)
Definition: elements.h:4341
void set_boundary_number_in_bulk_mesh(const unsigned &b)
Set function for the boundary number in bulk mesh.
Definition: elements.h:4482
void check_J_eulerian_at_knots(bool &passed) const
Definition: elements.cc:5410
BulkCoordinateDerivativesFctPt & bulk_coordinate_derivatives_fct_pt()
Definition: elements.h:4770
Vector< unsigned > Nbulk_value
Definition: elements.h:4413
void get_ds_bulk_ds_face(const Vector< double > &s, DenseMatrix< double > &dsbulk_dsface, unsigned &interior_direction) const
Definition: elements.cc:6409
double interpolated_x(const unsigned &t, const Vector< double > &s, const unsigned &i) const
Definition: elements.h:4541
void continuous_tangent_and_outer_unit_normal(const Vector< double > &s, Vector< Vector< double >> &tang_vec, Vector< double > &unit_normal) const
Definition: elements.cc:5512
void get_local_coordinate_in_bulk(const Vector< double > &s, Vector< double > &s_bulk) const
Definition: elements.cc:6384
const unsigned & bulk_node_number(const unsigned &n) const
Definition: elements.h:4832
CoordinateMappingFctPt Face_to_bulk_coordinate_fct_pt
Definition: elements.h:4357
int & normal_sign()
Definition: elements.h:4612
void output_zeta(std::ostream &outfile, const unsigned &nplot)
Output boundary coordinate zeta.
Definition: elements.cc:5200
unsigned & bulk_node_number(const unsigned &n)
Definition: elements.h:4825
void resize_nodes(Vector< unsigned > &nadditional_data_values)
Definition: elements.h:4882
void interpolated_dxdt(const Vector< double > &s, const unsigned &t, Vector< double > &dxdt)
Definition: elements.h:4598
FaceElement(const FaceElement &)=delete
Broken copy constructor.
virtual ~FaceElement()
Empty virtual destructor.
Definition: elements.h:4465
void nbulk_value_resize(const unsigned &i)
Definition: elements.h:4860
Definition: elements.h:4998
Definition: elements.h:1313
virtual void scalar_value_paraview(std::ofstream &file_out, const unsigned &i, const unsigned &nplot) const
Definition: elements.h:3001
virtual void write_tecplot_zone_footer(FILE *file_pt, const unsigned &nplot) const
Definition: elements.h:3181
virtual void output(const unsigned &t, std::ostream &outfile, const unsigned &n_plot) const
Definition: elements.h:3071
virtual void fill_in_jacobian_from_nodal_by_fd(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Definition: elements.cc:3660
virtual unsigned nplot_points_paraview(const unsigned &nplot) const
Definition: elements.h:2862
virtual void output_fct(std::ostream &outfile, const unsigned &n_plot, const double &time, const SolutionFunctorBase &exact_soln) const
Output a time-dependent exact solution over the element.
Definition: elements.h:3130
virtual int face_outer_unit_normal_sign(const int &face_index) const
Get the sign of the outer unit normal on the face given by face_index.
Definition: elements.h:3380
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Definition: elements.h:1735
virtual void update_before_nodal_fd()
Definition: elements.h:1709
void interpolated_zeta(const Vector< double > &s, Vector< double > &zeta) const
Definition: elements.cc:4675
virtual void d_dshape_eulerian_dnodal_coordinates(const double &det_jacobian, const DenseMatrix< double > &jacobian, const DenseMatrix< double > &djacobian_dX, const DenseMatrix< double > &inverse_jacobian, const DShape &dpsids, RankFourTensor< double > &d_dpsidx_dX) const
Definition: elements.cc:2749
virtual void identify_geometric_data(std::set< Data * > &geometric_data_pt)
Definition: elements.h:2789
void get_x(const unsigned &t, const Vector< double > &s, Vector< double > &x)
Definition: elements.h:1904
void set_nodal_dimension(const unsigned &nodal_dim)
Definition: elements.h:1390
double raw_dnodal_position_gen_dt(const unsigned &j, const unsigned &n, const unsigned &k, const unsigned &i) const
Definition: elements.h:2305
void dposition_dt(const Vector< double > &zeta, const unsigned &t, Vector< double > &drdt)
Definition: elements.h:2701
virtual void set_macro_elem_pt(MacroElement *macro_elem_pt)
Definition: elements.h:1872
void position(const Vector< double > &zeta, Vector< double > &r) const
Definition: elements.h:2676
double dnodal_position_dt(const unsigned &n, const unsigned &j, const unsigned &i) const
Definition: elements.h:2340
virtual void output_fct(std::ostream &outfile, const unsigned &n_plot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
Output an exact solution over the element.
Definition: elements.h:3104
virtual void local_coordinate_of_node(const unsigned &j, Vector< double > &s) const
Definition: elements.h:1842
virtual Node * construct_node(const unsigned &n)
Definition: elements.h:2509
double raw_nodal_position(const unsigned &t, const unsigned &n, const unsigned &i) const
Definition: elements.h:2247
void d_dshape_eulerian_dnodal_coordinates_templated_helper(const double &det_jacobian, const DenseMatrix< double > &jacobian, const DenseMatrix< double > &djacobian_dX, const DenseMatrix< double > &inverse_jacobian, const DShape &dpsids, RankFourTensor< double > &d_dpsidx_dX) const
Integral * Integral_pt
Pointer to the spatial integration scheme.
Definition: elements.h:1316
void check_J_eulerian_at_knots(bool &passed) const
Definition: elements.cc:4237
virtual double invert_jacobian_mapping(const DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
Definition: elements.cc:2166
void set_nnodal_position_type(const unsigned &nposition_type)
Set the number of types required to interpolate the coordinate.
Definition: elements.h:1396
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
Definition: elements.h:2175
double nodal_value(const unsigned &n, const unsigned &i) const
Definition: elements.h:2593
virtual void output_fct(std::ostream &outfile, const unsigned &n_plot, const double &time, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt)
Output a time-dependent exact solution over the element.
Definition: elements.h:3117
virtual void output(std::ostream &outfile)
Definition: elements.h:3050
virtual unsigned get_bulk_node_number(const int &face_index, const unsigned &i) const
Definition: elements.h:3371
double size() const
Definition: elements.cc:4290
virtual void assemble_local_to_eulerian_jacobian2(const DShape &d2psids, DenseMatrix< double > &jacobian2) const
Definition: elements.cc:1963
virtual std::string tecplot_zone_string(const unsigned &nplot) const
Definition: elements.h:3161
virtual void describe_local_dofs(std::ostream &out, const std::string &current_string) const
Definition: elements.cc:1709
static const double Node_location_tolerance
Definition: elements.h:1374
virtual double s_min() const
Min value of local coordinate.
Definition: elements.h:2793
unsigned nnodal_position_type() const
Definition: elements.h:2463
virtual void compute_error(FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, Vector< double > &error, Vector< double > &norm)
Definition: elements.h:3239
virtual void node_update()
Definition: elements.cc:5072
double nodal_value(const unsigned &t, const unsigned &n, const unsigned &i) const
Definition: elements.h:2601
static double Tolerance_for_singular_jacobian
Tolerance below which the jacobian is considered singular.
Definition: elements.h:1770
static bool Accept_negative_jacobian
Definition: elements.h:1775
virtual void build_face_element(const int &face_index, FaceElement *face_element_pt)
Definition: elements.cc:5132
virtual void update_in_nodal_fd(const unsigned &i)
Definition: elements.h:1718
virtual unsigned nvertex_node() const
Definition: elements.h:2491
double dnodal_position_gen_dt(const unsigned &n, const unsigned &k, const unsigned &i) const
Definition: elements.h:2369
virtual std::string scalar_name_paraview(const unsigned &i) const
Definition: elements.h:3043
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:3962
virtual void dJ_eulerian_dnodal_coordinates(const DenseMatrix< double > &jacobian, const DShape &dpsids, DenseMatrix< double > &djacobian_dX) const
Definition: elements.cc:2669
virtual void d2shape_local(const Vector< double > &s, Shape &psi, DShape &dpsids, DShape &d2psids) const
Definition: elements.h:2016
virtual void dshape_local_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsids) const
Definition: elements.cc:3239
virtual void assign_all_generic_local_eqn_numbers(const bool &store_local_dof_pt)
Definition: elements.h:2164
virtual unsigned required_nvalue(const unsigned &n) const
Definition: elements.h:2455
void point_output(std::ostream &outfile, const Vector< double > &s)
Definition: elements.h:2845
virtual void shape(const Vector< double > &s, Shape &psi) const =0
void set_dimension(const unsigned &dim)
Definition: elements.h:1380
void check_jacobian(const double &jacobian) const
Definition: elements.cc:1750
int nodal_local_eqn(const unsigned &n, const unsigned &i) const
Definition: elements.h:1432
static const unsigned N2deriv[]
Definition: elements.h:1483
unsigned dim() const
Definition: elements.h:2611
MacroElement * Macro_elem_pt
Pointer to the element's macro element (NULL by default)
Definition: elements.h:1683
double nodal_position_gen(const unsigned &n, const unsigned &k, const unsigned &i) const
Definition: elements.h:2349
unsigned nnode() const
Return the number of nodes.
Definition: elements.h:2210
virtual void disable_ALE()
Definition: elements.h:2408
virtual double s_max() const
Max. value of local coordinate.
Definition: elements.h:2803
void locate_zeta(const Vector< double > &zeta, GeomObject *&geom_object_pt, Vector< double > &s, const bool &use_coordinate_as_initial_guess=false)
Definition: elements.cc:4734
virtual ElementGeometry::ElementGeometry element_geometry() const
Return the geometry type of the element (either Q or T usually).
Definition: elements.h:2617
void face_node_number_error_check(const unsigned &i) const
Range check for face node numbers.
Definition: elements.h:3395
virtual void compute_error(FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
Calculate the norm of the error and that of the exact solution.
Definition: elements.h:3198
unsigned Nodal_dimension
Definition: elements.h:1336
virtual void write_paraview_type(std::ofstream &file_out, const unsigned &nplot) const
Definition: elements.h:2964
void(* SteadyExactSolutionFctPt)(const Vector< double > &, Vector< double > &)
Definition: elements.h:1759
void get_centre_of_gravity_and_max_radius_in_terms_of_zeta(Vector< double > &cog, double &max_radius) const
Definition: elements.cc:3924
virtual void compute_error(std::ostream &outfile, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, Vector< double > &error, Vector< double > &norm)
Definition: elements.h:3311
double nodal_position_gen(const unsigned &t, const unsigned &n, const unsigned &k, const unsigned &i) const
Definition: elements.h:2358
virtual void reset_in_nodal_fd(const unsigned &i)
Definition: elements.h:1723
void transform_second_derivatives_template(const DenseMatrix< double > &jacobian, const DenseMatrix< double > &inverse_jacobian, const DenseMatrix< double > &jacobian2, DShape &dbasis, DShape &d2basis) const
void dJ_eulerian_dnodal_coordinates_templated_helper(const DenseMatrix< double > &jacobian, const DShape &dpsids, DenseMatrix< double > &djacobian_dX) const
double dnodal_position_gen_dt(const unsigned &j, const unsigned &n, const unsigned &k, const unsigned &i) const
Definition: elements.h:2379
void get_x(const Vector< double > &s, Vector< double > &x) const
Definition: elements.h:1885
virtual void assign_nodal_local_eqn_numbers(const bool &store_local_dof_pt)
Definition: elements.cc:3544
virtual void output(FILE *file_pt)
Definition: elements.h:3084
virtual void compute_error(std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
Definition: elements.h:3256
virtual void compute_error(FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, Vector< double > &error, Vector< double > &norm)
Definition: elements.h:3225
virtual void compute_error(std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, Vector< double > &error, Vector< double > &norm)
Definition: elements.h:3292
virtual Node * get_node_at_local_coordinate(const Vector< double > &s) const
Definition: elements.cc:3882
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
Definition: elements.h:1963
virtual void assemble_local_to_eulerian_jacobian(const DShape &dpsids, DenseMatrix< double > &jacobian) const
Definition: elements.cc:1905
int get_node_number(Node *const &node_pt) const
Definition: elements.cc:3814
virtual double compute_physical_size() const
Definition: elements.h:2825
virtual void compute_error(std::ostream &outfile, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, double &error, double &norm)
Definition: elements.h:3272
virtual void get_s_plot(const unsigned &i, const unsigned &nplot, Vector< double > &s, const bool &shifted_to_interior=false) const
Definition: elements.h:3148
virtual double zeta_nodal(const unsigned &n, const unsigned &k, const unsigned &i) const
Definition: elements.h:2722
double d2shape_eulerian(const Vector< double > &s, Shape &psi, DShape &dpsidx, DShape &d2psidx) const
Definition: elements.cc:3448
virtual Node * vertex_node_pt(const unsigned &j) const
Definition: elements.h:2500
virtual unsigned nscalar_paraview() const
Definition: elements.h:2988
Node ** Node_pt
Storage for pointers to the nodes in the element.
Definition: elements.h:1319
virtual void compute_abs_error(std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error)
Definition: elements.h:3330
double raw_dnodal_position_dt(const unsigned &n, const unsigned &j, const unsigned &i) const
Definition: elements.h:2263
virtual double local_to_eulerian_mapping(const DShape &dpsids, DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
Definition: elements.h:1508
virtual BulkCoordinateDerivativesFctPt bulk_coordinate_derivatives_fct_pt(const int &face_index) const
Definition: elements.h:3419
virtual void point_output_data(const Vector< double > &s, Vector< double > &data)
Definition: elements.h:2838
unsigned Nnodal_position_type
Definition: elements.h:1344
virtual unsigned nplot_points(const unsigned &nplot) const
Definition: elements.h:3186
void transform_derivatives_diagonal(const DenseMatrix< double > &inverse_jacobian, DShape &dbasis) const
Definition: elements.cc:2877
virtual void reset_after_nodal_fd()
Definition: elements.h:1714
virtual void compute_error(FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, double &error, double &norm)
Calculate the norm of the error and that of the exact solution.
Definition: elements.h:3209
double nodal_position(const unsigned &n, const unsigned &i) const
Definition: elements.h:2317
virtual void transform_derivatives(const DenseMatrix< double > &inverse_jacobian, DShape &dbasis) const
Definition: elements.cc:2833
virtual void enable_ALE()
Definition: elements.h:2430
unsigned Elemental_dimension
Definition: elements.h:1330
Node *const & node_pt(const unsigned &n) const
Return a pointer to the local node n (const version)
Definition: elements.h:2192
void transform_second_derivatives_diagonal(const DenseMatrix< double > &jacobian, const DenseMatrix< double > &inverse_jacobian, const DenseMatrix< double > &jacobian2, DShape &dbasis, DShape &d2basis) const
virtual double dshape_eulerian_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsidx) const
Definition: elements.cc:3325
virtual bool local_coord_is_valid(const Vector< double > &s)
Broken assignment operator.
Definition: elements.h:1813
virtual void dshape_local(const Vector< double > &s, Shape &psi, DShape &dpsids) const
Definition: elements.h:1981
virtual void move_local_coord_back_into_element(Vector< double > &s) const
Definition: elements.h:1824
Data * geom_data_pt(const unsigned &j)
Definition: elements.h:2667
double raw_nodal_value(const unsigned &t, const unsigned &n, const unsigned &i) const
Definition: elements.h:2584
FiniteElement(const FiniteElement &)=delete
Broken copy constructor.
virtual unsigned nsub_elements_paraview(const unsigned &nplot) const
Definition: elements.h:2876
virtual void d2shape_local_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsids, DShape &d2psids) const
Definition: elements.cc:3274
void set_n_node(const unsigned &n)
Definition: elements.h:1404
MacroElement * macro_elem_pt()
Access function to pointer to macro element.
Definition: elements.h:1878
double raw_dnodal_position_dt(const unsigned &n, const unsigned &i) const
Definition: elements.h:2256
virtual Node * construct_node(const unsigned &n, TimeStepper *const &time_stepper_pt)
Definition: elements.h:2522
static bool Suppress_output_while_checking_for_inverted_elements
Definition: elements.h:1779
double raw_dnodal_position_gen_dt(const unsigned &n, const unsigned &k, const unsigned &i) const
Definition: elements.h:2294
virtual void scalar_value_fct_paraview(std::ofstream &file_out, const unsigned &i, const unsigned &nplot, const double &time, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt) const
Definition: elements.h:3027
virtual unsigned nnode_1d() const
Definition: elements.h:2218
unsigned nodal_dimension() const
Return the required Eulerian dimension of the nodes in this element.
Definition: elements.h:2484
virtual double interpolated_dxdt(const Vector< double > &s, const unsigned &i, const unsigned &t)
Definition: elements.cc:4596
int ** Nodal_local_eqn
Definition: elements.h:1323
double raw_nodal_value(const unsigned &n, const unsigned &i) const
Definition: elements.h:2576
virtual void describe_nodal_local_dofs(std::ostream &out, const std::string &current_string) const
Definition: elements.cc:1727
virtual void get_x_from_macro_element(const Vector< double > &s, Vector< double > &x) const
Definition: elements.h:1934
virtual void get_x_from_macro_element(const unsigned &t, const Vector< double > &s, Vector< double > &x)
Definition: elements.h:1948
virtual void local_fraction_of_node(const unsigned &j, Vector< double > &s_fraction)
Definition: elements.cc:3191
virtual void write_tecplot_zone_footer(std::ostream &outfile, const unsigned &nplot) const
Definition: elements.h:3174
virtual void scalar_value_fct_paraview(std::ofstream &file_out, const unsigned &i, const unsigned &nplot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt) const
Definition: elements.h:3013
virtual Node * construct_boundary_node(const unsigned &n)
Definition: elements.h:2538
unsigned Nnode
Number of nodes in the element.
Definition: elements.h:1326
virtual double J_eulerian_at_knot(const unsigned &ipt) const
Definition: elements.cc:4168
virtual unsigned self_test()
Definition: elements.cc:4440
virtual void identify_field_data_for_interactions(std::set< std::pair< Data *, unsigned >> &paired_field_data)
Definition: elements.cc:5096
virtual ~FiniteElement()
Definition: elements.cc:3173
virtual double d2shape_eulerian_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsidx, DShape &d2psidx) const
Definition: elements.cc:3502
virtual void set_integration_scheme(Integral *const &integral_pt)
Set the spatial integration scheme.
Definition: elements.cc:3210
void output_paraview(std::ofstream &file_out, const unsigned &nplot) const
Definition: elements.h:2889
void position(const unsigned &t, const Vector< double > &zeta, Vector< double > &r) const
Definition: elements.h:2689
virtual void shape_at_knot(const unsigned &ipt, Shape &psi) const
Definition: elements.cc:3220
void(* UnsteadyExactSolutionFctPt)(const double &, const Vector< double > &, Vector< double > &)
Definition: elements.h:1765
double raw_nodal_position_gen(const unsigned &t, const unsigned &n, const unsigned &k, const unsigned &i) const
Definition: elements.h:2282
virtual unsigned nnode_on_face() const
Definition: elements.h:3387
virtual double local_to_eulerian_mapping_diagonal(const DShape &dpsids, DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
Definition: elements.cc:2588
double dshape_eulerian(const Vector< double > &s, Shape &psi, DShape &dpsidx) const
Definition: elements.cc:3298
virtual double local_one_d_fraction_of_node(const unsigned &n1d, const unsigned &i)
Definition: elements.h:1858
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:2333
double raw_nodal_position_gen(const unsigned &n, const unsigned &k, const unsigned &i) const
Definition: elements.h:2272
virtual void transform_second_derivatives(const DenseMatrix< double > &jacobian, const DenseMatrix< double > &inverse_jacobian, const DenseMatrix< double > &jacobian2, DShape &dbasis, DShape &d2basis) const
Definition: elements.cc:3125
virtual void output(FILE *file_pt, const unsigned &n_plot)
Definition: elements.h:3095
FiniteElement()
Constructor.
Definition: elements.h:1782
unsigned ngeom_data() const
Definition: elements.h:2660
static const unsigned Default_Initial_Nvalue
Default value for the number of values at a node.
Definition: elements.h:1370
virtual Node * construct_boundary_node(const unsigned &n, TimeStepper *const &time_stepper_pt)
Definition: elements.h:2552
double nodal_position(const unsigned &t, const unsigned &n, const unsigned &i) const
Definition: elements.h:2325
double invert_jacobian(const DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
virtual void get_dresidual_dnodal_coordinates(RankThreeTensor< double > &dresidual_dnodal_coordinates)
Definition: elements.cc:3744
virtual void write_paraview_offsets(std::ofstream &file_out, const unsigned &nplot, unsigned &offset_sum) const
Definition: elements.h:2976
virtual CoordinateMappingFctPt face_to_bulk_coordinate_fct_pt(const int &face_index) const
Definition: elements.h:3409
virtual double J_eulerian(const Vector< double > &s) const
Definition: elements.cc:4103
bool has_hanging_nodes() const
Definition: elements.h:2470
double raw_nodal_position(const unsigned &n, const unsigned &i) const
Definition: elements.cc:1686
double local_to_eulerian_mapping(const DShape &dpsids, DenseMatrix< double > &inverse_jacobian) const
Definition: elements.h:1524
void fill_in_jacobian_from_nodal_by_fd(DenseMatrix< double > &jacobian)
Definition: elements.h:1695
virtual void output(std::ostream &outfile, const unsigned &n_plot)
Definition: elements.h:3060
double dJ_eulerian_at_knot(const unsigned &ipt, Shape &psi, DenseMatrix< double > &djacobian_dX) const
Definition: elements.cc:3354
virtual void assemble_eulerian_base_vectors(const DShape &dpsids, DenseMatrix< double > &interpolated_G) const
Definition: elements.cc:2009
virtual void write_paraview_output_offset_information(std::ofstream &file_out, const unsigned &nplot, unsigned &counter) const
Definition: elements.h:2952
void integrate_fct(FiniteElement::SteadyExactSolutionFctPt integrand_fct_pt, Vector< double > &integral)
Integrate Vector-valued function over element.
Definition: elements.cc:4377
Definition: elements.h:5119
const unsigned & boundary_number_in_bulk_mesh() const
Access function for the boundary number in bulk mesh.
Definition: elements.h:5132
void set_boundary_number_in_bulk_mesh(const unsigned &b)
Set function for the boundary number in bulk mesh.
Definition: elements.h:5139
unsigned Boundary_number_in_bulk_mesh
The boundary number in the bulk mesh to which this element is attached.
Definition: elements.h:5171
FreeStandingFaceElement()
Constructor.
Definition: elements.h:5122
double zeta_nodal(const unsigned &n, const unsigned &k, const unsigned &i) const
Definition: elements.h:5154
Definition: elements.h:73
unsigned nexternal_data() const
Return the number of external data objects.
Definition: elements.h:829
virtual void reset_in_external_fd(const unsigned &i)
Definition: elements.h:488
void flush_external_data()
Flush all external data.
Definition: elements.cc:387
virtual unsigned ndof_types() const
Definition: elements.h:1202
virtual void update_in_internal_fd(const unsigned &i)
Definition: elements.h:459
virtual void reset_after_external_fd()
Definition: elements.h:478
virtual void update_before_external_fd()
Definition: elements.h:473
static bool Suppress_warning_about_repeated_external_data
Definition: elements.h:700
void dof_vector(const unsigned &t, Vector< double > &dof)
Return the vector of dof values at time level t.
Definition: elements.h:841
virtual void get_inner_products(Vector< std::pair< unsigned, unsigned >> const &history_index, Vector< double > &inner_product)
Definition: elements.h:1095
void set_internal_data_time_stepper(const unsigned &i, TimeStepper *const &time_stepper_pt, const bool &preserve_existing_data)
Definition: elements.h:893
void operator=(const GeneralisedElement &)=delete
Broken assignment operator.
virtual void get_hessian_vector_products(Vector< double > const &Y, DenseMatrix< double > const &C, DenseMatrix< double > &product)
Definition: elements.h:1083
static double Default_fd_jacobian_step
Definition: elements.h:1198
Data *const & internal_data_pt(const unsigned &i) const
Return a pointer to i-th internal data object (const version)
Definition: elements.h:640
bool internal_data_fd(const unsigned &i) const
Definition: elements.h:146
unsigned long * Eqn_number
Definition: elements.h:77
virtual void assign_local_eqn_numbers(const bool &store_local_dof_pt)
Definition: elements.cc:691
virtual void get_dof_numbers_for_unknowns(std::list< std::pair< unsigned long, unsigned >> &dof_lookup_list) const
Definition: elements.h:1221
void fill_in_jacobian_from_internal_by_fd(DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
Definition: elements.h:401
virtual void fill_in_contribution_to_residuals(Vector< double > &residuals)
Definition: elements.h:357
void assign_internal_eqn_numbers(unsigned long &global_number, Vector< double * > &Dof_pt)
Definition: elements.cc:529
bool external_data_fd(const unsigned &i) const
Definition: elements.h:757
virtual void assign_all_generic_local_eqn_numbers(const bool &store_local_dof_pt)
Definition: elements.h:253
void exclude_internal_data_fd(const unsigned &i)
Definition: elements.h:167
unsigned ndof() const
Return the number of equations/dofs in the element.
Definition: elements.h:835
unsigned long eqn_number(const unsigned &ieqn_local) const
Definition: elements.h:704
static std::deque< double * > Dof_pt_deque
Definition: elements.h:231
int ** Data_local_eqn
Definition: elements.h:101
int local_eqn_number(const unsigned long &ieqn_global) const
Definition: elements.h:726
Data *& external_data_pt(const unsigned &i)
Return a pointer to i-th external data object.
Definition: elements.h:659
void fill_in_jacobian_from_external_by_fd(DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
Definition: elements.h:435
Data *& internal_data_pt(const unsigned &i)
Return a pointer to i-th internal data object.
Definition: elements.h:622
virtual void fill_in_contribution_to_djacobian_dparameter(double *const &parameter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam)
Definition: elements.cc:1402
virtual void assign_additional_local_eqn_numbers()
Definition: elements.h:263
GeneralisedElement(const GeneralisedElement &)=delete
Broken copy constructor.
virtual void get_residuals(Vector< double > &residuals)
Definition: elements.h:980
Data *const & external_data_pt(const unsigned &i) const
Return a pointer to i-th external data object (const version)
Definition: elements.h:677
virtual void fill_in_contribution_to_inner_products(Vector< std::pair< unsigned, unsigned >> const &history_index, Vector< double > &inner_product)
Definition: elements.cc:1543
virtual void get_mass_matrix(Vector< double > &residuals, DenseMatrix< double > &mass_matrix)
Definition: elements.h:1003
virtual void fill_in_contribution_to_jacobian_and_mass_matrix(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
Definition: elements.cc:1322
virtual void get_dresiduals_dparameter(double *const &parameter_pt, Vector< double > &dres_dparam)
Definition: elements.h:1034
virtual void assign_internal_and_external_local_eqn_numbers(const bool &store_local_dof_pt)
Definition: elements.cc:938
virtual void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Definition: elements.h:499
unsigned ninternal_data() const
Return the number of internal data objects.
Definition: elements.h:823
void clear_global_eqn_numbers()
Definition: elements.h:207
void include_internal_data_fd(const unsigned &i)
Definition: elements.h:187
void dof_pt_vector(Vector< double * > &dof_pt)
Return the vector of pointers to dof values.
Definition: elements.h:866
virtual void describe_local_dofs(std::ostream &out, const std::string &current_string) const
Definition: elements.cc:573
unsigned Ninternal_data
Number of internal data.
Definition: elements.h:107
unsigned Nexternal_data
Number of external data.
Definition: elements.h:110
unsigned add_external_data(Data *const &data_pt, const bool &fd=true)
Definition: elements.cc:307
static bool Suppress_warning_about_repeated_internal_data
Definition: elements.h:696
virtual void update_before_internal_fd()
Definition: elements.h:449
virtual void reset_in_internal_fd(const unsigned &i)
Definition: elements.h:464
virtual void fill_in_contribution_to_dresiduals_dparameter(double *const &parameter_pt, Vector< double > &dres_dparam)
Definition: elements.cc:1358
virtual void fill_in_contribution_to_mass_matrix(Vector< double > &residuals, DenseMatrix< double > &mass_matrix)
Definition: elements.cc:1292
unsigned Ndof
Number of degrees of freedom.
Definition: elements.h:104
int internal_local_eqn(const unsigned &i, const unsigned &j) const
Definition: elements.h:267
virtual void get_inner_product_vectors(Vector< unsigned > const &history_index, Vector< Vector< double >> &inner_product_vector)
Definition: elements.h:1106
virtual ~GeneralisedElement()
Virtual destructor to clean up any memory allocated by the object.
Definition: elements.cc:276
virtual void fill_in_contribution_to_hessian_vector_products(Vector< double > const &Y, DenseMatrix< double > const &C, DenseMatrix< double > &product)
Definition: elements.cc:1503
virtual void get_djacobian_and_dmass_matrix_dparameter(double *const &parameter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam, DenseMatrix< double > &dmass_matrix_dparam)
Definition: elements.h:1061
virtual void fill_in_contribution_to_inner_product_vectors(Vector< unsigned > const &history_index, Vector< Vector< double >> &inner_product_vector)
Definition: elements.cc:1571
static DenseMatrix< double > Dummy_matrix
Definition: elements.h:227
void fill_in_jacobian_from_external_by_fd(Vector< double > &residuals, DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
Definition: elements.cc:1199
virtual void reset_after_internal_fd()
Definition: elements.h:454
virtual void get_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Definition: elements.h:990
virtual void get_djacobian_dparameter(double *const &parameter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam)
Definition: elements.h:1046
void describe_dofs(std::ostream &out, const std::string &current_string) const
Definition: elements.cc:551
void fill_in_jacobian_from_internal_by_fd(Vector< double > &residuals, DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
Definition: elements.cc:1102
void include_external_data_fd(const unsigned &i)
Definition: elements.h:798
Data ** Data_pt
Definition: elements.h:92
virtual void get_jacobian_and_mass_matrix(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
Definition: elements.h:1016
virtual void compute_norm(Vector< double > &norm)
Definition: elements.h:1128
double ** Dof_pt
Definition: elements.h:84
void add_global_eqn_numbers(std::deque< unsigned long > const &global_eqn_numbers, std::deque< double * > const &global_dof_pt)
Definition: elements.cc:156
void add_internal_value_pt_to_map(std::map< unsigned, double * > &map_of_value_pt)
Definition: elements.cc:611
int external_local_eqn(const unsigned &i, const unsigned &j)
Definition: elements.h:311
virtual unsigned self_test()
Definition: elements.cc:1603
std::vector< bool > Data_fd
Definition: elements.h:122
GeneralisedElement()
Constructor: Initialise all pointers and all values to zero.
Definition: elements.h:596
virtual void complete_setup_of_dependencies()
Definition: elements.h:974
virtual void compute_norm(double &norm)
Definition: elements.h:1140
unsigned add_internal_data(Data *const &data_pt, const bool &fd=true)
Definition: elements.cc:62
void exclude_external_data_fd(const unsigned &i)
Definition: elements.h:778
virtual void fill_in_contribution_to_djacobian_and_dmass_matrix_dparameter(double *const &parameter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam, DenseMatrix< double > &dmass_matrix_dparam)
Definition: elements.cc:1453
virtual void update_in_external_fd(const unsigned &i)
Definition: elements.h:483
Definition: geom_objects.h:101
TimeStepper *& time_stepper_pt()
Definition: geom_objects.h:192
Definition: integral.h:49
Definition: macro_element.h:73
Definition: matrices.h:74
void operator=(const NavierStokesElementWithDiagonalMassMatrices &)=delete
Broken assignment operator.
virtual void get_pressure_and_velocity_mass_matrix_diagonal(Vector< double > &press_mass_diag, Vector< double > &veloc_mass_diag, const unsigned &which_one=0)=0
virtual ~NavierStokesElementWithDiagonalMassMatrices()
Virtual destructor.
Definition: elements.h:5237
NavierStokesElementWithDiagonalMassMatrices(const NavierStokesElementWithDiagonalMassMatrices &)=delete
Broken copy constructor.
NavierStokesElementWithDiagonalMassMatrices()
Empty constructor.
Definition: elements.h:5234
Definition: nodes.h:906
double dx_gen_dt(const unsigned &k, const unsigned &i) const
Definition: nodes.cc:1865
double & x(const unsigned &i)
Return the i-th nodal coordinate.
Definition: nodes.h:1060
double & x_gen(const unsigned &k, const unsigned &i)
Definition: nodes.h:1126
void position(Vector< double > &pos) const
Definition: nodes.cc:2499
unsigned ndim() const
Return (Eulerian) spatial dimension of the node.
Definition: nodes.h:1054
double position_gen(const unsigned &k, const unsigned &i) const
Definition: nodes.cc:2592
virtual void get_coordinates_on_boundary(const unsigned &b, const unsigned &k, Vector< double > &boundary_zeta)
Definition: nodes.cc:2379
double raw_value(const unsigned &i) const
Definition: nodes.h:1455
double dposition_dt(const unsigned &i) const
Definition: nodes.cc:2659
double dx_dt(const unsigned &i) const
Return the i-th component of nodal velocity: dx/dt.
Definition: nodes.cc:1817
void resize(const unsigned &n_value)
Resize the number of equations.
Definition: nodes.cc:2167
double dposition_gen_dt(const unsigned &k, const unsigned &i) const
Definition: nodes.cc:2708
double value(const unsigned &i) const
Definition: nodes.cc:2408
Definition: oomph_definitions.h:222
Definition: oomph_definitions.h:267
Definition: elements.h:3439
PointElement()
Constructor.
Definition: elements.h:3442
void shape(const Vector< double > &s, Shape &psi) const
Broken assignment operator.
Definition: elements.cc:7529
PointElement(const PointElement &)=delete
Broken copy constructor.
static PointIntegral Default_integration_scheme
Default integration scheme.
Definition: elements.h:3473
void local_coordinate_of_node(const unsigned &j, Vector< double > &s) const
Get local coordinates of node j in the element; vector sets its own size.
Definition: elements.h:3462
Definition: integral.h:89
A Rank 4 Tensor class.
Definition: matrices.h:1701
A Rank 3 Tensor class.
Definition: matrices.h:1370
Definition: shape.h:76
SolidElementWithDiagonalMassMatrix()
Empty constructor.
Definition: elements.h:5196
void operator=(const SolidElementWithDiagonalMassMatrix &)=delete
Broken assignment operator.
SolidElementWithDiagonalMassMatrix(const SolidElementWithDiagonalMassMatrix &)=delete
Broken copy constructor.
virtual void get_mass_matrix_diagonal(Vector< double > &mass_diag)=0
virtual ~SolidElementWithDiagonalMassMatrix()
Virtual destructor.
Definition: elements.h:5199
Definition: elements.h:4914
double zeta_nodal(const unsigned &n, const unsigned &k, const unsigned &i) const
Definition: elements.h:4921
double interpolated_xi(const Vector< double > &s, const unsigned &i) const
Definition: elements.h:4937
void interpolated_xi(const Vector< double > &s, Vector< double > &xi) const
Definition: elements.h:4957
Definition: elements.h:3561
unsigned lagrangian_dimension() const
Definition: elements.h:3774
virtual void set_macro_elem_pt(MacroElement *macro_elem_pt, MacroElement *undeformed_macro_elem_pt)
Definition: elements.h:3689
virtual void set_macro_elem_pt(MacroElement *macro_elem_pt)
Definition: elements.h:3680
double lagrangian_position(const unsigned &n, const unsigned &i) const
Return i-th Lagrangian coordinate at local node n.
Definition: elements.h:3905
void set_undeformed_macro_elem_pt(MacroElement *undeformed_macro_elem_pt)
Definition: elements.h:3699
Node * construct_node(const unsigned &n)
Construct the local node n and return a pointer to it.
Definition: elements.h:3791
void disable_solve_for_consistent_newmark_accel()
Set to reset the problem being solved to be the standard problem.
Definition: elements.h:3972
void describe_solid_local_dofs(std::ostream &out, const std::string &current_string) const
Classifies dofs locally for solid specific aspects.
Definition: elements.cc:6874
double lagrangian_position_gen(const unsigned &n, const unsigned &k, const unsigned &i) const
Definition: elements.h:3912
double(* MultiplierFctPt)(const Vector< double > &xi)
Definition: elements.h:3582
double raw_lagrangian_position_gen(const unsigned &n, const unsigned &k, const unsigned &i) const
Definition: elements.h:3897
MacroElement * undeformed_macro_elem_pt()
Access function to pointer to "undeformed" macro element.
Definition: elements.h:3706
Data * geom_data_pt(const unsigned &j)
Definition: elements.h:3615
virtual void get_x_and_xi(const Vector< double > &s, Vector< double > &x_fe, Vector< double > &x, Vector< double > &xi_fe, Vector< double > &xi) const
Definition: elements.h:3659
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Definition: elements.h:4185
int * Position_local_eqn
Definition: elements.h:4281
virtual void assemble_local_to_lagrangian_jacobian2(const DShape &d2psids, DenseMatrix< double > &jacobian2) const
Definition: elements.cc:6586
void fill_in_jacobian_from_solid_position_by_fd(DenseMatrix< double > &jacobian)
Definition: elements.h:4225
virtual void assign_solid_local_eqn_numbers(const bool &store_local_dof)
Assign local equation numbers for the solid equations in the element.
Definition: elements.cc:6898
double dshape_lagrangian(const Vector< double > &s, Shape &psi, DShape &dpsidxi) const
Definition: elements.cc:6710
double raw_lagrangian_position(const unsigned &n, const unsigned &i) const
Definition: elements.h:3890
unsigned nnodal_lagrangian_type() const
Definition: elements.h:3785
void enable_solve_for_consistent_newmark_accel()
Definition: elements.h:3966
double zeta_nodal(const unsigned &n, const unsigned &k, const unsigned &i) const
Definition: elements.h:3642
unsigned Lagrangian_dimension
Definition: elements.h:4285
virtual void update_before_solid_position_fd()
Definition: elements.h:4240
bool Solve_for_consistent_newmark_accel_flag
Definition: elements.h:4302
MacroElement * Undeformed_macro_elem_pt
Pointer to the element's "undeformed" macro element (NULL by default)
Definition: elements.h:4076
MultiplierFctPt & multiplier_fct_pt()
Definition: elements.h:3979
SolidInitialCondition * Solid_ic_pt
Pointer to object that specifies the initial condition.
Definition: elements.h:4131
void fill_in_residuals_for_solid_ic(Vector< double > &residuals)
Definition: elements.h:4018
virtual double d2shape_lagrangian_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsidxi, DShape &d2psidxi) const
Definition: elements.cc:6832
void fill_in_generic_jacobian_for_solid_ic(Vector< double > &residuals, DenseMatrix< double > &jacobian, const unsigned &flag)
Definition: elements.cc:7376
virtual void J_lagrangian(const Vector< double > &s) const
Definition: elements.h:3936
unsigned ngeom_data() const
Broken assignment operator.
Definition: elements.h:3608
void set_nnodal_lagrangian_type(const unsigned &nlagrangian_type)
Definition: elements.h:4070
virtual double local_to_lagrangian_mapping_diagonal(const DShape &dpsids, DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
Definition: elements.cc:6643
unsigned Nnodal_lagrangian_type
Definition: elements.h:4293
virtual void update_in_solid_position_fd(const unsigned &i)
Definition: elements.h:4250
int position_local_eqn(const unsigned &n, const unsigned &k, const unsigned &j) const
Definition: elements.h:4137
virtual double local_to_lagrangian_mapping(const DShape &dpsids, DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
Definition: elements.h:4082
virtual void get_residuals_for_solid_ic(Vector< double > &residuals)
Definition: elements.h:4003
virtual void assemble_local_to_lagrangian_jacobian(const DShape &dpsids, DenseMatrix< double > &jacobian) const
Definition: elements.cc:6528
virtual double interpolated_xi(const Vector< double > &s, const unsigned &i) const
Definition: elements.cc:7104
Node * construct_boundary_node(const unsigned &n, TimeStepper *const &time_stepper_pt)
Definition: elements.h:3846
void identify_geometric_data(std::set< Data * > &geometric_data_pt)
Definition: elements.h:3624
virtual void reset_in_solid_position_fd(const unsigned &i)
Definition: elements.h:4255
virtual void interpolated_dxids(const Vector< double > &s, DenseMatrix< double > &dxids) const
Definition: elements.cc:7180
virtual double dshape_lagrangian_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsidxi) const
Definition: elements.cc:6737
virtual void fill_in_jacobian_from_solid_position_by_fd(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Definition: elements.cc:6985
SolidFiniteElement()
Constructor: Set defaults.
Definition: elements.h:3585
virtual bool has_internal_solid_data()
Definition: elements.h:3574
void fill_in_jacobian_for_solid_ic(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Definition: elements.h:4035
double multiplier(const Vector< double > &xi)
Definition: elements.h:4308
virtual void assign_all_generic_local_eqn_numbers(const bool &store_local_dof_pt)
Definition: elements.h:3867
SolidInitialCondition *& solid_ic_pt()
Pointer to object that describes the initial condition.
Definition: elements.h:3955
double d2shape_lagrangian(const Vector< double > &s, Shape &psi, DShape &dpsidxi, DShape &d2psidxi) const
Definition: elements.cc:6781
Node * construct_boundary_node(const unsigned &n)
Definition: elements.h:3827
void compute_norm(double &el_norm)
Definition: elements.cc:6442
virtual double J_lagrangian_at_knot(const unsigned &ipt) const
Definition: elements.h:3946
void describe_local_dofs(std::ostream &out, const std::string &current_string) const
Definition: elements.cc:6514
SolidFiniteElement(const SolidFiniteElement &)=delete
Broken copy constructor.
Node * construct_node(const unsigned &n, TimeStepper *const &time_stepper_pt)
Definition: elements.h:3809
MultiplierFctPt Multiplier_fct_pt
Definition: elements.h:4276
virtual ~SolidFiniteElement()
Destructor to clean up any allocated memory.
Definition: elements.cc:6629
void fill_in_jacobian_for_newmark_accel(DenseMatrix< double > &jacobian)
Definition: elements.cc:7227
double local_to_lagrangian_mapping(const DShape &dpsids, DenseMatrix< double > &inverse_jacobian) const
Definition: elements.h:4097
virtual void reset_after_solid_position_fd()
Definition: elements.h:4245
void set_lagrangian_dimension(const unsigned &lagrangian_dimension)
Definition: elements.h:3565
MultiplierFctPt multiplier_fct_pt() const
Definition: elements.h:3988
Definition: elements.h:3496
GeomObject *& geom_object_pt()
Definition: elements.h:3511
unsigned IC_time_deriv
Which time derivative (0,1,2) are we currently assigning.
Definition: elements.h:3529
GeomObject * Geom_object_pt
Definition: elements.h:3526
void operator=(const SolidInitialCondition &)=delete
Broken assignment operator.
SolidInitialCondition(GeomObject *geom_object_pt)
Constructor: Pass geometric object; initialise time deriv to 0.
Definition: elements.h:3499
SolidInitialCondition(const SolidInitialCondition &)=delete
Broken copy constructor.
unsigned & ic_time_deriv()
Which time derivative are we currently assigning?
Definition: elements.h:3517
Definition: nodes.h:1686
Solid point element.
Definition: elements.h:4980
Definition: oomph_utilities.h:1109
Definition: timesteppers.h:231
virtual unsigned nprev_values() const =0
Number of previous values available: 0 for static, 1 for BDF<1>,...
void initialise(const _Tp &__value)
Iterate over all values and set to the desired value.
Definition: oomph-lib/src/generic/Vector.h:167
RealScalar s
Definition: level1_cplx_impl.h:130
char char char int int * k
Definition: level2_impl.h:374
EIGEN_STRONG_INLINE const Eigen::CwiseBinaryOp< Eigen::internal::scalar_zeta_op< typename DerivedX::Scalar >, const DerivedX, const DerivedQ > zeta(const Eigen::ArrayBase< DerivedX > &x, const Eigen::ArrayBase< DerivedQ > &q)
Definition: SpecialFunctionsArrayAPI.h:152
void plot()
Plot.
Definition: sphere_scattering.cc:180
void exact_soln(const double &time, const Vector< double > &x, Vector< double > &soln)
Definition: unstructured_two_d_curved.cc:301
r
Definition: UniformPSDSelfTest.py:20
int error
Definition: calibrate.py:297
ElementGeometry
Definition: elements.h:1240
@ Q
Definition: elements.h:1241
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286
unsigned Max_newton_iterations
Maximum number of newton iterations.
Definition: elements.cc:1654
double Newton_tolerance
Convergence tolerance for the newton solver.
Definition: elements.cc:1651
unsigned N_local_points
Definition: elements.cc:1665
double Radius_multiplier_for_fast_exit_from_locate_zeta
Definition: elements.cc:1659
std::string to_string(T object, unsigned float_precision=8)
Definition: oomph_utilities.h:189
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
Definition: AnisotropicHookean.h:10
void(* BulkCoordinateDerivativesFctPt)(const Vector< double > &s, DenseMatrix< double > &ds_bulk_dsface, unsigned &interior_direction)
Definition: elements.h:1290
void(* CoordinateMappingFctPt)(const Vector< double > &s, Vector< double > &s_bulk)
Definition: elements.h:1282
list x
Definition: plotDoE.py:28
t
Definition: plotPSD.py:36
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86
unsigned el_dim
dimension
Definition: overloaded_cartesian_element_body.h:30
void product(const MatrixType &m)
Definition: product.h:42
void set(Container &c, Position position, const Value &value)
Definition: stdlist_overload.cpp:36
std::ofstream out("Result.txt")
const char Y
Definition: test/EulerAngles.cpp:32
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2