29 #ifndef OOMPH_GENERIC_ELEMENTS_HEADER
30 #define OOMPH_GENERIC_ELEMENTS_HEADER
34 #include <oomph-lib-config.h>
148 #ifdef RANGE_CHECKING
151 std::ostringstream error_message;
152 error_message <<
"Range Error: Internal data " <<
i
156 OOMPH_CURRENT_FUNCTION,
157 OOMPH_EXCEPTION_LOCATION);
169 #ifdef RANGE_CHECKING
172 std::ostringstream error_message;
173 error_message <<
"Range Error: Internal data " <<
i
177 OOMPH_CURRENT_FUNCTION,
178 OOMPH_EXCEPTION_LOCATION);
189 #ifdef RANGE_CHECKING
192 std::ostringstream error_message;
193 error_message <<
"Range Error: Internal data " <<
i
197 OOMPH_CURRENT_FUNCTION,
198 OOMPH_EXCEPTION_LOCATION);
221 std::deque<unsigned long>
const& global_eqn_numbers,
222 std::deque<double*>
const& global_dof_pt);
242 const bool& store_local_dof_pt);
254 const bool& store_local_dof_pt)
269 #ifdef RANGE_CHECKING
272 std::ostringstream error_message;
273 error_message <<
"Range Error: Internal data " <<
i
277 OOMPH_CURRENT_FUNCTION,
278 OOMPH_EXCEPTION_LOCATION);
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
290 OOMPH_CURRENT_FUNCTION,
291 OOMPH_EXCEPTION_LOCATION);
300 "Internal local equation numbers have not been allocated",
301 OOMPH_CURRENT_FUNCTION,
302 OOMPH_EXCEPTION_LOCATION);
314 #ifdef RANGE_CHECKING
317 std::ostringstream error_message;
318 error_message <<
"Range Error: External data " <<
i
322 OOMPH_CURRENT_FUNCTION,
323 OOMPH_EXCEPTION_LOCATION);
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
335 OOMPH_CURRENT_FUNCTION,
336 OOMPH_EXCEPTION_LOCATION);
344 "External local equation numbers have not been allocated",
345 OOMPH_CURRENT_FUNCTION,
346 OOMPH_EXCEPTION_LOCATION);
360 "Empty fill_in_contribution_to_residuals() has been called.\n";
362 "This function is called from the default implementations of\n";
363 error_message +=
"get_residuals() and get_jacobian();\n";
365 "and must calculate the residuals vector without initialising any of ";
366 error_message +=
"its entries.\n\n";
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";
374 error_message +=
"N.B. the default get_jacobian() function employs "
375 "finite differencing\n";
378 error_message, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
391 const bool& fd_all_data =
false);
402 const bool& fd_all_data =
false)
424 const bool& fd_all_data =
false);
436 const bool& fd_all_data =
false)
553 double*
const& parameter_pt,
565 double*
const& parameter_pt,
584 Vector<std::pair<unsigned, unsigned>>
const& history_index,
624 #ifdef RANGE_CHECKING
627 std::ostringstream error_message;
628 error_message <<
"Range Error: Internal data " <<
i
632 OOMPH_CURRENT_FUNCTION,
633 OOMPH_EXCEPTION_LOCATION);
642 #ifdef RANGE_CHECKING
645 std::ostringstream error_message;
646 error_message <<
"Range Error: Internal data " <<
i
650 OOMPH_CURRENT_FUNCTION,
651 OOMPH_EXCEPTION_LOCATION);
661 #ifdef RANGE_CHECKING
664 std::ostringstream error_message;
665 error_message <<
"Range Error: External data " <<
i
669 OOMPH_CURRENT_FUNCTION,
670 OOMPH_EXCEPTION_LOCATION);
679 #ifdef RANGE_CHECKING
682 std::ostringstream error_message;
683 error_message <<
"Range Error: External data " <<
i
687 OOMPH_CURRENT_FUNCTION,
688 OOMPH_EXCEPTION_LOCATION);
706 #ifdef RANGE_CHECKING
707 if (ieqn_local >=
Ndof)
709 std::ostringstream error_message;
710 error_message <<
"Range Error: Equation number " << ieqn_local
711 <<
" is not in the range (0," <<
Ndof - 1 <<
")";
713 OOMPH_CURRENT_FUNCTION,
714 OOMPH_EXCEPTION_LOCATION);
729 const unsigned n_dof = this->
Ndof;
731 for (
unsigned n = 0; n < n_dof; n++)
759 #ifdef RANGE_CHECKING
762 std::ostringstream error_message;
763 error_message <<
"Range Error: Internal data " <<
i
767 OOMPH_CURRENT_FUNCTION,
768 OOMPH_EXCEPTION_LOCATION);
780 #ifdef RANGE_CHECKING
783 std::ostringstream error_message;
784 error_message <<
"Range Error: External data " <<
i
788 OOMPH_CURRENT_FUNCTION,
789 OOMPH_EXCEPTION_LOCATION);
800 #ifdef RANGE_CHECKING
803 std::ostringstream error_message;
804 error_message <<
"Range Error: External data " <<
i
808 OOMPH_CURRENT_FUNCTION,
809 OOMPH_EXCEPTION_LOCATION);
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";
853 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
857 dof.resize(this->Ndof);
859 for (
unsigned i = 0;
i < this->
Ndof; ++
i)
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";
878 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
882 dof_pt.resize(this->Ndof);
884 for (
unsigned i = 0;
i < this->
Ndof; ++
i)
895 const bool& preserve_existing_data)
898 preserve_existing_data);
934 std::map<unsigned, double*>& map_of_value_pt);
957 const Vector<long>& vector_of_eqn_numbers,
unsigned& index);
1028 residuals, jacobian, mass_matrix);
1056 parameter_pt, dres_dparam, djac_dparam);
1062 double*
const& parameter_pt,
1075 parameter_pt, dres_dparam, djac_dparam, dmass_matrix_dparam);
1096 Vector<std::pair<unsigned, unsigned>>
const& history_index,
1110 const unsigned n_inner_product = inner_product_vector.size();
1111 for (
unsigned i = 0;
i < n_inner_product; ++
i)
1113 inner_product_vector[
i].initialise(0.0);
1116 inner_product_vector);
1131 "compute_norm(...) undefined for this element\n";
1133 error_message, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
1142 std::string error_message =
"compute_norm undefined for this element \n";
1144 error_message, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
1147 #ifdef OOMPH_HAS_MPI
1205 std::ostringstream error_message;
1206 error_message <<
"ndof_types() const has not been implemented for this \n"
1211 error_message.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
1222 std::list<std::pair<unsigned long, unsigned>>& dof_lookup_list)
const
1225 std::ostringstream error_message;
1226 error_message <<
"get_dof_numbers_for_unknowns() const has not been \n"
1227 <<
" implemented for this element\n"
1231 error_message.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
1258 namespace Locate_zeta_helpers
1293 unsigned& interior_direction);
1424 for (
unsigned i = 0;
i < n;
i++)
1434 #ifdef RANGE_CHECKING
1437 std::ostringstream error_message;
1438 error_message <<
"Range Error: Node number " << n
1439 <<
" is not in the range (0," <<
Nnode - 1 <<
")";
1441 OOMPH_CURRENT_FUNCTION,
1442 OOMPH_EXCEPTION_LOCATION);
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 <<
")";
1453 OOMPH_CURRENT_FUNCTION,
1454 OOMPH_EXCEPTION_LOCATION);
1463 "Nodal local equation numbers have not been allocated",
1464 OOMPH_CURRENT_FUNCTION,
1465 OOMPH_EXCEPTION_LOCATION);
1489 template<
unsigned DIM>
1528 const unsigned el_dim =
dim();
1564 template<
unsigned DIM>
1586 const double& det_jacobian,
1603 template<
unsigned DIM>
1605 const double& det_jacobian,
1658 template<
unsigned DIM>
1674 template<
unsigned DIM>
1698 unsigned n_dof =
ndof();
1741 unsigned n_dof =
ndof();
1816 "local_coord_is_valid is not implemented for this element\n",
1817 OOMPH_CURRENT_FUNCTION,
1818 OOMPH_EXCEPTION_LOCATION);
1826 throw OomphLibError(
"move_local_coords_back_into_element() is not "
1827 "implemented for this element\n",
1828 OOMPH_CURRENT_FUNCTION,
1829 OOMPH_EXCEPTION_LOCATION);
1846 "local_coordinate_of_node(...) is not implemented for this element\n",
1847 OOMPH_CURRENT_FUNCTION,
1848 OOMPH_EXCEPTION_LOCATION);
1862 "local one_d_fraction_of_node is not implemented for this element\n";
1864 "It only makes sense for elements that use tensor-product expansions\n";
1867 error_message, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
1938 "get_x_from_macro_element(...) is not implemented for this element\n",
1939 OOMPH_CURRENT_FUNCTION,
1940 OOMPH_EXCEPTION_LOCATION);
1953 "get_x_from_macro_element(...) is not implemented for this element\n",
1954 OOMPH_CURRENT_FUNCTION,
1955 OOMPH_EXCEPTION_LOCATION);
1986 "dshape_local() is not implemented for this element\n",
1987 OOMPH_CURRENT_FUNCTION,
1988 OOMPH_EXCEPTION_LOCATION);
2022 "d2shape_local() is not implemented for this element\n",
2023 OOMPH_CURRENT_FUNCTION,
2024 OOMPH_EXCEPTION_LOCATION);
2085 const unsigned& ipt,
2158 std::ostream& out,
const std::string& current_string)
const;
2165 const bool& store_local_dof_pt)
2169 store_local_dof_pt);
2177 #ifdef RANGE_CHECKING
2180 std::ostringstream error_message;
2181 error_message <<
"Range Error: " << n <<
" is not in the range (0,"
2182 <<
Nnode - 1 <<
")";
2184 OOMPH_CURRENT_FUNCTION,
2185 OOMPH_EXCEPTION_LOCATION);
2194 #ifdef RANGE_CHECKING
2197 std::ostringstream error_message;
2198 error_message <<
"Range Error: " << n <<
" is not in the range (0,"
2199 <<
Nnode - 1 <<
")";
2201 OOMPH_CURRENT_FUNCTION,
2202 OOMPH_EXCEPTION_LOCATION);
2249 const unsigned&
i)
const
2265 const unsigned&
i)
const
2274 const unsigned&
i)
const
2285 const unsigned&
i)
const
2296 const unsigned&
i)
const
2308 const unsigned&
i)
const
2327 const unsigned&
i)
const
2342 const unsigned&
i)
const
2351 const unsigned&
i)
const
2361 const unsigned&
i)
const
2371 const unsigned&
i)
const
2382 const unsigned&
i)
const
2410 std::ostringstream 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"
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);
2432 std::ostringstream 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"
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);
2472 unsigned nnod =
nnode();
2473 for (
unsigned j = 0; j < nnod; j++)
2493 std::string error_msg =
"Not implemented for FiniteElement.";
2495 error_msg, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
2502 std::string error_msg =
"Not implemented for FiniteElement.";
2504 error_msg, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
2586 const unsigned&
i)
const
2603 const unsigned&
i)
const
2621 err, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
2626 const unsigned&
i)
const;
2632 const unsigned&
i)
const;
2724 const unsigned&
i)
const
2756 const bool& use_coordinate_as_initial_guess =
false);
2780 std::set<std::pair<Data*, unsigned>>& paired_field_data);
2795 throw OomphLibError(
"s_min() isn't implemented for this element\n",
2796 OOMPH_CURRENT_FUNCTION,
2797 OOMPH_EXCEPTION_LOCATION);
2805 throw OomphLibError(
"s_max() isn't implemented for this element\n",
2806 OOMPH_CURRENT_FUNCTION,
2807 OOMPH_EXCEPTION_LOCATION);
2818 double size()
const;
2828 "compute_physical_size() isn't implemented for this element\n",
2829 OOMPH_CURRENT_FUNCTION,
2830 OOMPH_EXCEPTION_LOCATION);
2852 unsigned n = data.size();
2853 for (
unsigned i = 0;
i < n;
i++)
2855 outfile << data[
i] <<
" ";
2865 "This function hasn't been implemented for this element",
2866 OOMPH_CURRENT_FUNCTION,
2867 OOMPH_EXCEPTION_LOCATION);
2879 "This function hasn't been implemented for this element",
2880 OOMPH_CURRENT_FUNCTION,
2881 OOMPH_EXCEPTION_LOCATION);
2892 unsigned nnod =
nnode();
2893 if (nnod == 0)
return;
2906 for (
unsigned j = 0; j < plot; j++)
2916 for (
unsigned i = 0;
i < n - 1;
i++)
2918 file_out << x[
i] <<
" ";
2920 file_out << x[n - 1];
2928 <<
" 0" << std::endl;
2932 file_out <<
" 0" << std::endl;
2936 file_out << std::endl;
2942 "Printing PlotPoint to .vtu failed; it has >3 dimensions.",
2943 OOMPH_CURRENT_FUNCTION,
2944 OOMPH_EXCEPTION_LOCATION);
2953 std::ofstream& file_out,
const unsigned& nplot,
unsigned& counter)
const
2956 "This function hasn't been implemented for this element",
2957 OOMPH_CURRENT_FUNCTION,
2958 OOMPH_EXCEPTION_LOCATION);
2965 const unsigned& nplot)
const
2968 "This function hasn't been implemented for this element",
2969 OOMPH_CURRENT_FUNCTION,
2970 OOMPH_EXCEPTION_LOCATION);
2977 const unsigned& nplot,
2978 unsigned& offset_sum)
const
2981 "This function hasn't been implemented for this element",
2982 OOMPH_CURRENT_FUNCTION,
2983 OOMPH_EXCEPTION_LOCATION);
2991 "This function hasn't been implemented for this element",
2992 OOMPH_CURRENT_FUNCTION,
2993 OOMPH_EXCEPTION_LOCATION);
3003 const unsigned& nplot)
const
3006 "This function hasn't been implemented for this element",
3007 OOMPH_CURRENT_FUNCTION,
3008 OOMPH_EXCEPTION_LOCATION);
3014 std::ofstream& file_out,
3016 const unsigned& nplot,
3020 "This function hasn't been implemented for this element",
3021 OOMPH_CURRENT_FUNCTION,
3022 OOMPH_EXCEPTION_LOCATION);
3028 std::ofstream& file_out,
3030 const unsigned& nplot,
3035 "This function hasn't been implemented for this element",
3036 OOMPH_CURRENT_FUNCTION,
3037 OOMPH_EXCEPTION_LOCATION);
3053 "Output function function hasn't been implemented for this element",
3054 OOMPH_CURRENT_FUNCTION,
3055 OOMPH_EXCEPTION_LOCATION);
3060 virtual void output(std::ostream& outfile,
const unsigned& n_plot)
3063 "Output function function hasn't been implemented for this element",
3064 OOMPH_CURRENT_FUNCTION,
3065 OOMPH_EXCEPTION_LOCATION);
3072 std::ostream& outfile,
3073 const unsigned& n_plot)
const
3076 "Output function function hasn't been implemented for this element",
3077 OOMPH_CURRENT_FUNCTION,
3078 OOMPH_EXCEPTION_LOCATION);
3086 throw OomphLibError(
"C-style otput function function hasn't been "
3087 "implemented for this element",
3088 OOMPH_CURRENT_FUNCTION,
3089 OOMPH_EXCEPTION_LOCATION);
3095 virtual void output(FILE* file_pt,
const unsigned& n_plot)
3097 throw OomphLibError(
"C-style output function function hasn't been "
3098 "implemented for this element",
3099 OOMPH_CURRENT_FUNCTION,
3100 OOMPH_EXCEPTION_LOCATION);
3105 std::ostream& outfile,
3106 const unsigned& n_plot,
3110 "Output function function hasn't been implemented for exact solution",
3111 OOMPH_CURRENT_FUNCTION,
3112 OOMPH_EXCEPTION_LOCATION);
3118 std::ostream& outfile,
3119 const unsigned& n_plot,
3124 "Output function function hasn't been implemented for exact solution",
3125 OOMPH_CURRENT_FUNCTION,
3126 OOMPH_EXCEPTION_LOCATION);
3131 const unsigned& n_plot,
3136 "Output function function hasn't been implemented for exact solution",
3137 OOMPH_CURRENT_FUNCTION,
3138 OOMPH_EXCEPTION_LOCATION);
3149 const unsigned& nplot,
3151 const bool& shifted_to_interior =
false)
const
3154 "get_s_plot(...) is not implemented for this element\n",
3155 OOMPH_CURRENT_FUNCTION,
3156 OOMPH_EXCEPTION_LOCATION);
3164 "tecplot_zone_string(...) is not implemented for this element\n",
3165 OOMPH_CURRENT_FUNCTION,
3166 OOMPH_EXCEPTION_LOCATION);
3167 return "dummy return";
3175 const unsigned& nplot)
const {};
3182 const unsigned& nplot)
const {};
3189 "nplot_points(...) is not implemented for this element",
3190 OOMPH_CURRENT_FUNCTION,
3191 OOMPH_EXCEPTION_LOCATION);
3203 std::string error_message =
"compute_error undefined for this element \n";
3205 error_message, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
3215 std::string error_message =
"time-dependent compute_error ";
3216 error_message +=
"undefined for this element \n";
3218 error_message, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
3230 std::string error_message =
"compute_error undefined for this element \n";
3232 error_message, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
3245 std::string error_message =
"time-dependent compute_error ";
3246 error_message +=
"undefined for this element \n";
3248 error_message, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
3257 std::ostream& outfile,
3262 std::string error_message =
"compute_error undefined for this element \n";
3263 outfile << error_message;
3266 error_message, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
3273 std::ostream& outfile,
3280 "time-dependent compute_error undefined for this element \n";
3281 outfile << error_message;
3284 error_message, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
3293 std::ostream& outfile,
3298 std::string error_message =
"compute_error undefined for this element \n";
3299 outfile << error_message;
3302 "FiniteElement::compute_error()",
3303 OOMPH_EXCEPTION_LOCATION);
3312 std::ostream& outfile,
3319 "time-dependent compute_error undefined for this element \n";
3320 outfile << error_message;
3323 "FiniteElement::compute_error()",
3324 OOMPH_EXCEPTION_LOCATION);
3331 std::ostream& outfile,
3336 "compute_abs_error undefined for this element \n";
3337 outfile << error_message;
3340 error_message, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
3372 const unsigned&
i)
const
3374 std::string err =
"Not implemented for this element.";
3376 err, OOMPH_EXCEPTION_LOCATION, OOMPH_CURRENT_FUNCTION);
3382 std::string err =
"Not implemented for this element.";
3384 err, OOMPH_EXCEPTION_LOCATION, OOMPH_CURRENT_FUNCTION);
3389 std::string err =
"Not implemented for this element.";
3391 err, OOMPH_EXCEPTION_LOCATION, OOMPH_CURRENT_FUNCTION);
3397 #ifdef RANGE_CHECKING
3400 std::string err =
"Face node index i out of range on face.";
3402 err, OOMPH_EXCEPTION_LOCATION, OOMPH_CURRENT_FUNCTION);
3410 const int& face_index)
const
3412 std::string err =
"Not implemented for this element.";
3414 err, OOMPH_EXCEPTION_LOCATION, OOMPH_CURRENT_FUNCTION);
3420 const int& face_index)
const
3422 std::string err =
"Not implemented for this element.";
3424 err, OOMPH_EXCEPTION_LOCATION, OOMPH_CURRENT_FUNCTION);
3627 const unsigned n_node = this->
nnode();
3628 for (
unsigned n = 0; n < n_node; n++)
3630 geometric_data_pt.insert(
3644 const unsigned&
i)
const
3666 "get_x_and_xi(...) is not implemented for this element\n",
3667 OOMPH_CURRENT_FUNCTION,
3668 OOMPH_EXCEPTION_LOCATION);
3868 const bool& store_local_dof_pt)
3899 const unsigned&
i)
const
3914 const unsigned&
i)
const
3922 const unsigned&
i)
const;
3940 OOMPH_CURRENT_FUNCTION,
3941 OOMPH_EXCEPTION_LOCATION);
3950 OOMPH_CURRENT_FUNCTION,
3951 OOMPH_EXCEPTION_LOCATION);
4066 const unsigned& flag);
4101 unsigned el_dim =
dim();
4139 const unsigned& j)
const
4141 #ifdef RANGE_CHECKING
4142 std::ostringstream error_message;
4147 error_message <<
"Range Error: Nodal number " << n
4148 <<
" is not in the range (0," <<
nnode() <<
")";
4154 error_message <<
"Range Error: Position type " << k
4162 error_message <<
"Range Error: Nodal coordinate " << j
4170 OOMPH_CURRENT_FUNCTION,
4171 OOMPH_EXCEPTION_LOCATION);
4199 unsigned n_dof =
ndof();
4229 unsigned n_dof =
ndof();
4352 unsigned& interior_direction);
4432 const unsigned n_node =
nnode();
4435 for (
unsigned n = 0; n < n_node; n++)
4439 ->assign_additional_values_with_face_id(nadditional_values[n],
id);
4499 const unsigned&
i)
const
4543 const unsigned&
i)
const
4651 std::ostringstream error_message;
4652 error_message <<
"The pointer tangent_direction_pt is null.\n";
4654 OOMPH_CURRENT_FUNCTION,
4655 OOMPH_EXCEPTION_LOCATION);
4662 if (tang_dir_size != spatial_dimension)
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";
4670 OOMPH_CURRENT_FUNCTION,
4671 OOMPH_EXCEPTION_LOCATION);
4674 if (tang_dir_size == 2)
4676 std::ostringstream 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.";
4682 OOMPH_CURRENT_FUNCTION,
4683 OOMPH_EXCEPTION_LOCATION);
4722 const unsigned& ipt,
4749 #pragma clang diagnostic push
4750 #pragma clang diagnostic ignored "-Woverloaded-virtual"
4783 #pragma clang diagnostic pop
4801 unsigned& interior_direction)
const;
4885 unsigned n_node =
nnode();
4887 for (
unsigned l = 0; l < n_node; l++)
4892 unsigned Nadditional = nadditional_data_values[l];
4894 if ((Initial_Nvalue ==
Nbulk_value[l]) && (Nadditional > 0))
4903 void output_zeta(std::ostream& outfile,
const unsigned& nplot);
4923 const unsigned&
i)
const
4996 template<
class ELEMENT>
5011 template<
class ELEMENT>
5036 const unsigned&
i)
const
5044 outfile <<
"ZONE" << std::endl;
5045 unsigned nnod =
nnode();
5046 for (
unsigned j = 0; j < nnod; j++)
5049 unsigned dim = nod_pt->
ndim();
5050 for (
unsigned i = 0;
i <
dim;
i++)
5052 outfile << nod_pt->
x(
i) <<
" ";
5054 outfile << std::endl;
5059 void output(std::ostream& outfile,
const unsigned& n_plot)
5071 void output(FILE* file_pt,
const unsigned& n_plot)
5117 template<
class ELEMENT>
5156 const unsigned&
i)
const
5162 this->node_pt(n)->get_coordinates_on_boundary(
5253 const unsigned& which_one = 0) = 0;
A class that contains the information required by Nodes that are located on Mesh boundaries....
A template Class for BoundaryNodes; that is Nodes that MAY live on the boundary of a Mesh....
A Class for the derivatives of shape functions The class design is essentially the same as Shape,...
A class that represents a collection of data; each Data object may contain many different individual ...
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
void set_time_stepper(TimeStepper *const &time_stepper_pt, const bool &preserve_existing_data)
Set a new timestepper by resizing the appropriate storage. If already assigned the equation numbering...
void initialise(const T &val)
Initialize all values in the matrix to val.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
DummyFaceElement()
Constructor.
void output(std::ostream &outfile)
Output nodal coordinates.
double zeta_nodal(const unsigned &n, const unsigned &k, const unsigned &i) const
The "global" intrinsic coordinate of the element when viewed as part of a geometric object should be ...
void output(FILE *file_pt, const unsigned &n_plot)
C_style output at n_plot points.
void output(std::ostream &outfile, const unsigned &n_plot)
Output at n_plot points.
DummyFaceElement(FiniteElement *const &element_pt, const int &face_index)
Constructor, which takes a "bulk" element and the face index.
void output(FILE *file_pt)
C-style output.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
virtual void get_drag_and_torque(Vector< double > &drag_force, Vector< double > &drag_torque)=0
Function that specifies the drag force and the torque about the origin.
virtual ~ElementWithDragFunction()
Empty virtual destructor.
ElementWithDragFunction()
Empty constructor.
FaceElements are elements that coincide with the faces of higher-dimensional "bulk" elements....
void interpolated_x(const Vector< double > &s, Vector< double > &x) const
Return FE interpolated position x[] at local coordinate s as Vector Overloaded to get information fro...
void turn_on_warning_for_discontinuous_tangent()
Turn on warning for when there may be discontinuous tangent vectors from continuous_tangent_and_outer...
unsigned & bulk_position_type(const unsigned &i)
Return the position type in the "bulk" element that corresponds to position type i on the FaceElement...
double interpolated_dxdt(const Vector< double > &s, const unsigned &i, const unsigned &t)
Return t-th time-derivative of the i-th FE-interpolated Eulerian coordinate at local coordinate s....
unsigned nbulk_value(const unsigned &n) const
Return the number of values originally stored at local node n (before the FaceElement added additiona...
bool Boundary_number_in_bulk_mesh_has_been_set
Has the Boundary_number_in_bulk_mesh been set? Only included if compiled with PARANOID switched on.
unsigned Boundary_number_in_bulk_mesh
The boundary number in the bulk mesh to which this element is attached.
CoordinateMappingFctPt face_to_bulk_coordinate_fct_pt() const
Return the pointer to the function that maps the face coordinate to the bulk coordinate (const versio...
Vector< unsigned > Bulk_node_number
List of indices of the local node numbers in the "bulk" element that correspond to the local node num...
CoordinateMappingFctPt & face_to_bulk_coordinate_fct_pt()
Return the pointer to the function that maps the face coordinate to the bulk coordinate.
FiniteElement * Bulk_element_pt
Pointer to the associated higher-dimensional "bulk" element.
void bulk_node_number_resize(const unsigned &i)
Resize the storage for the bulk node numbers.
const Vector< double > * tangent_direction_pt() const
Public access function for the tangent direction pointer.
int face_index() const
Index of the face (a number that uniquely identifies the face in the element) (const version)
BulkCoordinateDerivativesFctPt bulk_coordinate_derivatives_fct_pt() const
Return the pointer to the function that returns the derivatives of the bulk coordinates wrt the face ...
int & face_index()
Index of the face (a number that uniquely identifies the face in the element)
void outer_unit_normal(const Vector< double > &s, Vector< double > &unit_normal) const
Compute outer unit normal at the specified local coordinate.
void turn_off_warning_for_discontinuous_tangent()
Turn off warning for when there may be discontinuous tangent vectors from continuous_tangent_and_oute...
int Face_index
Index of the face.
unsigned & nbulk_value(const unsigned &n)
Return the number of values originally stored at local node n (before the FaceElement added additiona...
double zeta_nodal(const unsigned &n, const unsigned &k, const unsigned &i) const
In a FaceElement, the "global" intrinsic coordinate of the element along the boundary,...
int Normal_sign
Sign of outer unit normal (relative to cross-products of tangent vectors in the corresponding "bulk" ...
BulkCoordinateDerivativesFctPt Bulk_coordinate_derivatives_fct_pt
Pointer to a function that returns the derivatives of the local "bulk" coordinates with respect to th...
Vector< double > local_coordinate_in_bulk(const Vector< double > &s) const
Return vector of local coordinates in bulk element, given the local coordinates in this FaceElement.
FaceElement()
Constructor: Initialise all appropriate member data.
void add_additional_values(const Vector< unsigned > &nadditional_values, const unsigned &id)
Helper function adding additional values for the unknowns associated with the FaceElement....
void(* BulkCoordinateDerivativesFctPt)(const Vector< double > &s, DenseMatrix< double > &ds_bulk_dsface, unsigned &interior_direction)
Typedef for the function that returns the partial derivative of the local coordinates in the bulk ele...
Vector< double > * Tangent_direction_pt
A general direction pointer for the tangent vectors. This is used in the function continuous_tangent_...
void interpolated_x(const unsigned &t, const Vector< double > &s, Vector< double > &x) const
Return FE interpolated position x[] at local coordinate s at previous timestep t as Vector (t=0: pres...
FiniteElement *& bulk_element_pt()
Pointer to higher-dimensional "bulk" element.
const unsigned & boundary_number_in_bulk_mesh() const
Broken assignment operator.
int normal_sign() const
Return sign of outer unit normal (relative to cross-products of tangent vectors in the corresponding ...
double interpolated_x(const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s. Overloaded to get information from bulk...
void bulk_position_type_resize(const unsigned &i)
Resize the storage for bulk_position_type to i entries.
FiniteElement * bulk_element_pt() const
Pointer to higher-dimensional "bulk" element (const version)
double J_eulerian(const Vector< double > &s) const
Return the Jacobian of mapping from local to global coordinates at local position s....
Vector< unsigned > Bulk_position_type
Vector holding integers to translate additional position types to those of the "bulk" element; e....
static bool Ignore_discontinuous_tangent_warning
Ignores the warning when the tangent vectors from continuous_tangent_and_outer_unit_normal may not be...
void set_tangent_direction(Vector< double > *tangent_direction_pt)
Set the tangent direction vector.
double J_eulerian_at_knot(const unsigned &ipt) const
Return the Jacobian of the mapping from local to global coordinates at the ipt-th integration point O...
const unsigned & bulk_position_type(const unsigned &i) const
Return the position type in the "bulk" element that corresponds to the position type i on the FaceEle...
void(* CoordinateMappingFctPt)(const Vector< double > &s, Vector< double > &s_bulk)
Typedef for the function that translates the face coordinate to the coordinate in the bulk element.
void set_boundary_number_in_bulk_mesh(const unsigned &b)
Set function for the boundary number in bulk mesh.
void check_J_eulerian_at_knots(bool &passed) const
Check that Jacobian of mapping between local and Eulerian coordinates at all integration points is po...
BulkCoordinateDerivativesFctPt & bulk_coordinate_derivatives_fct_pt()
Return the pointer to the function that returns the derivatives of the bulk coordinates wrt the face ...
Vector< unsigned > Nbulk_value
A vector that will hold the number of data values at the nodes that are associated with the "bulk" el...
void get_ds_bulk_ds_face(const Vector< double > &s, DenseMatrix< double > &dsbulk_dsface, unsigned &interior_direction) const
Calculate the derivatives of the local coordinates in the bulk element with respect to the local coor...
double interpolated_x(const unsigned &t, const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s at previous timestep t (t=0: present; t>...
void continuous_tangent_and_outer_unit_normal(const Vector< double > &s, Vector< Vector< double >> &tang_vec, Vector< double > &unit_normal) const
Compute the tangent vector(s) and the outer unit normal vector at the specified local coordinate....
void get_local_coordinate_in_bulk(const Vector< double > &s, Vector< double > &s_bulk) const
Calculate the vector of local coordinate in the bulk element given the local coordinates in this Face...
const unsigned & bulk_node_number(const unsigned &n) const
Return the bulk node number that corresponds to the n-th local node number (const version)
CoordinateMappingFctPt Face_to_bulk_coordinate_fct_pt
Pointer to a function that translates the face coordinate to the coordinate in the bulk element.
int & normal_sign()
Sign of outer unit normal (relative to cross-products of tangent vectors in the corresponding "bulk" ...
void output_zeta(std::ostream &outfile, const unsigned &nplot)
Output boundary coordinate zeta.
unsigned & bulk_node_number(const unsigned &n)
Return the bulk node number that corresponds to the n-th local node number.
void resize_nodes(Vector< unsigned > &nadditional_data_values)
Provide additional storage for a specified number of values at the nodes of the FaceElement....
void interpolated_dxdt(const Vector< double > &s, const unsigned &t, Vector< double > &dxdt)
Compte t-th time-derivative of the FE-interpolated Eulerian coordinate vector at local coordinate s....
FaceElement(const FaceElement &)=delete
Broken copy constructor.
virtual ~FaceElement()
Empty virtual destructor.
void nbulk_value_resize(const unsigned &i)
Resize the storage for the number of values originally stored at the local nodes to i entries.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
A general Finite Element class.
virtual void scalar_value_paraview(std::ofstream &file_out, const unsigned &i, const unsigned &nplot) const
Write values of the i-th scalar field at the plot points. Broken virtual. Needs to be implemented for...
virtual void write_tecplot_zone_footer(FILE *file_pt, const unsigned &nplot) const
Add tecplot zone "footer" to C-style output. (when plotting nplot points in each "coordinate directio...
virtual void output(const unsigned &t, std::ostream &outfile, const unsigned &n_plot) const
Output the element data at time step t. This is const because it is newly added and so can be done ea...
virtual unsigned nplot_points_paraview(const unsigned &nplot) const
Return the number of actual plot points for paraview plot with parameter nplot. Broken virtual; can b...
virtual double J_eulerian(const Vector< double > &s) const
Return the Jacobian of mapping from local to global coordinates at local position s.
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.
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.
double d2shape_eulerian(const Vector< double > &s, Shape &psi, DShape &dpsidx, DShape &d2psidx) const
Compute the geometric shape functions and also first and second derivatives w.r.t....
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Add the elemental contribution to the jacobian matrix. and the residuals vector. Note that this funct...
virtual void update_before_nodal_fd()
Function that is called before the finite differencing of any nodal data. This may be overloaded to u...
virtual void identify_geometric_data(std::set< Data * > &geometric_data_pt)
The purpose of this function is to identify all Data objects that affect the elements' geometry....
void get_x(const unsigned &t, const Vector< double > &s, Vector< double > &x)
Global coordinates as function of local coordinates at previous time "level" t (t=0: present; t>0: pr...
double dJ_eulerian_at_knot(const unsigned &ipt, Shape &psi, DenseMatrix< double > &djacobian_dX) const
Compute the geometric shape functions (psi) at integration point ipt. Return the determinant of the j...
void set_nodal_dimension(const unsigned &nodal_dim)
Set the dimension of the nodes in the element. This will typically only be required when constructing...
double raw_dnodal_position_gen_dt(const unsigned &j, const unsigned &n, const unsigned &k, const unsigned &i) const
i-th component of j-th time derivative of the generalised position, dx(k,i)/dt at local node n....
void dposition_dt(const Vector< double > &zeta, const unsigned &t, Vector< double > &drdt)
Return the t-th time derivative of the parametrised position of the FiniteElement in its GeomObject i...
virtual void set_macro_elem_pt(MacroElement *macro_elem_pt)
Set pointer to macro element – can be overloaded in derived elements to perform additional tasks.
void position(const Vector< double > &zeta, Vector< double > &r) const
Return the parametrised position of the FiniteElement in its incarnation as a GeomObject,...
double dnodal_position_dt(const unsigned &n, const unsigned &j, const unsigned &i) const
Return the i-th component of j-th derivative of nodal position: d^jx/dt^j at node n.
virtual void dshape_local_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsids) const
Return the geometric shape function and its derivative w.r.t. the local coordinates at the ipt-th int...
virtual void output_fct(std::ostream &outfile, const unsigned &n_plot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
Output an exact solution over the element.
virtual 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 (broken virtual)
virtual Node * construct_node(const unsigned &n)
Construct the local node n and return a pointer to the newly created node object.
double raw_nodal_position(const unsigned &t, const unsigned &n, const unsigned &i) const
Return the i-th coordinate at local node n, at time level t (t=0: present; t>0: previous time level)....
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
Calculate the derivative w.r.t. the nodal coordinates of the derivative of the shape functions w....
Integral * Integral_pt
Pointer to the spatial integration scheme.
void set_nnodal_position_type(const unsigned &nposition_type)
Set the number of types required to interpolate the coordinate.
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
double nodal_value(const unsigned &n, const unsigned &i) const
Return the i-th value stored at local node n. Produces suitably interpolated values for hanging nodes...
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.
virtual void output(std::ostream &outfile)
Output the element data — typically the values at the nodes in a format suitable for post-processing.
virtual void transform_derivatives(const DenseMatrix< double > &inverse_jacobian, DShape &dbasis) const
Convert derivative w.r.t.local coordinates to derivatives w.r.t the coordinates used to assemble the ...
virtual unsigned get_bulk_node_number(const int &face_index, const unsigned &i) const
Get the number of the ith node on face face_index (in the bulk node vector).
virtual Node * get_node_at_local_coordinate(const Vector< double > &s) const
If there is a node at this local coordinate, return the pointer to the node.
virtual std::string tecplot_zone_string(const unsigned &nplot) const
Return string for tecplot zone header (when plotting nplot points in each "coordinate direction")
virtual double s_min() const
Min value of local coordinate.
virtual double dshape_eulerian_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsidx) const
Return the geometric shape functions and also first derivatives w.r.t. global coordinates at the ipt-...
unsigned nnodal_position_type() const
Return the number of coordinate types that the element requires to interpolate the geometry between t...
virtual void compute_error(FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, Vector< double > &error, Vector< double > &norm)
Given the exact solution this function calculates the norm of the error and that of the exact soluti...
double nodal_value(const unsigned &t, const unsigned &n, const unsigned &i) const
Return the i-th value stored at local node n, at time level t (t=0: present; t>0 previous timesteps)....
virtual void assign_nodal_local_eqn_numbers(const bool &store_local_dof_pt)
Assign the local equation numbers for Data stored at the nodes Virtual so that it can be overloaded b...
virtual void local_fraction_of_node(const unsigned &j, Vector< double > &s_fraction)
Get the local fraction of the node j in the element A dumb, but correct default implementation is pro...
virtual double invert_jacobian_mapping(const DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
A template-free interface that takes the matrix passed as jacobian and return its inverse in inverse_...
void interpolated_zeta(const Vector< double > &s, Vector< double > &zeta) const
Calculate the interpolated value of zeta, the intrinsic coordinate of the element when viewed as a co...
virtual void update_in_nodal_fd(const unsigned &i)
Function called within the finite difference loop for nodal data after a change in the i-th nodal val...
virtual unsigned nvertex_node() const
Return the number of vertex nodes in this element. Broken virtual function in "pure" finite elements.
double dnodal_position_gen_dt(const unsigned &n, const unsigned &k, const unsigned &i) const
i-th component of time derivative (velocity) of the generalised position, dx(k,i)/dt at local node n....
virtual double local_to_eulerian_mapping_diagonal(const DShape &dpsids, DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
Calculate the mapping from local to Eulerian coordinates given the derivatives of the shape functions...
double size() const
Calculate the size of the element (length, area, volume,...) in Eulerian computational coordinates....
virtual std::string scalar_name_paraview(const unsigned &i) const
Name of the i-th scalar field. Default implementation returns V1 for the first one,...
static double Tolerance_for_singular_jacobian
Tolerance below which the jacobian is considered singular.
virtual void fill_in_jacobian_from_nodal_by_fd(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Calculate the contributions to the jacobian from the nodal degrees of freedom using finite difference...
void locate_zeta(const Vector< double > &zeta, GeomObject *&geom_object_pt, Vector< double > &s, const bool &use_coordinate_as_initial_guess=false)
For a given value of zeta, the "global" intrinsic coordinate of a mesh of FiniteElements represented ...
void check_jacobian(const double &jacobian) const
Helper function used to check for singular or negative Jacobians in the transform from local to globa...
virtual void d2shape_local_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsids, DShape &d2psids) const
Return the geometric shape function and its first and second derivatives w.r.t. the local coordinates...
virtual void d2shape_local(const Vector< double > &s, Shape &psi, DShape &dpsids, DShape &d2psids) const
Function to compute the geometric shape functions and also first and second derivatives w....
virtual void assign_all_generic_local_eqn_numbers(const bool &store_local_dof_pt)
Overloaded version of the calculation of the local equation numbers. If the boolean argument is true ...
virtual unsigned required_nvalue(const unsigned &n) const
Number of values that must be stored at local node n by the element. The default is 0,...
static const double Node_location_tolerance
Default value for the tolerance to be used when locating nodes via local coordinates.
void point_output(std::ostream &outfile, const Vector< double > &s)
Output solution (as defined by point_output_data()) at local cordinates s.
virtual void shape(const Vector< double > &s, Shape &psi) const =0
Calculate the geometric shape functions at local coordinate s. This function must be overloaded for e...
void set_dimension(const unsigned &dim)
Set the dimension of the element and initially set the dimension of the nodes to be the same as the d...
virtual double interpolated_x(const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s.
int nodal_local_eqn(const unsigned &n, const unsigned &i) const
Return the local equation number corresponding to the i-th value at the n-th local node.
unsigned dim() const
Return the spatial dimension of the element, i.e. the number of local coordinates required to paramet...
MacroElement * Macro_elem_pt
Pointer to the element's macro element (NULL by default)
virtual void assemble_local_to_eulerian_jacobian(const DShape &dpsids, DenseMatrix< double > &jacobian) const
Assemble the jacobian matrix for the mapping from local to Eulerian coordinates, given the derivative...
double nodal_position_gen(const unsigned &n, const unsigned &k, const unsigned &i) const
Return the value of the k-th type of the i-th positional variable at the local node n.
unsigned nnode() const
Return the number of nodes.
virtual void disable_ALE()
This is an empty function that establishes a uniform interface for all (derived) elements that involv...
virtual double s_max() const
Max. value of local coordinate.
virtual ElementGeometry::ElementGeometry element_geometry() const
Return the geometry type of the element (either Q or T usually).
void face_node_number_error_check(const unsigned &i) const
Range check for face node numbers.
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.
unsigned Nodal_dimension
The spatial dimension of the nodes in the element. We assume that nodes have the same spatial dimensi...
virtual void write_paraview_type(std::ofstream &file_out, const unsigned &nplot) const
Return the paraview element type. Broken virtual. Needs to be implemented for each new geometric elem...
void(* SteadyExactSolutionFctPt)(const Vector< double > &, Vector< double > &)
Function pointer for function that computes vector-valued steady "exact solution" as .
virtual void compute_error(std::ostream &outfile, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, Vector< double > &error, Vector< double > &norm)
Plot the error when compared against a given time-dependent exact solution . Also calculates the norm...
double nodal_position_gen(const unsigned &t, const unsigned &n, const unsigned &k, const unsigned &i) const
Return the generalised nodal position (type k, i-th variable) at previous timesteps at local node n.
virtual void reset_in_nodal_fd(const unsigned &i)
Function called within the finite difference loop for nodal data after the i-th nodal values is reset...
void transform_second_derivatives_template(const DenseMatrix< double > &jacobian, const DenseMatrix< double > &inverse_jacobian, const DenseMatrix< double > &jacobian2, DShape &dbasis, DShape &d2basis) const
Convert derivatives and second derivatives w.r.t. local coordinates to derivatives and second derivat...
void dJ_eulerian_dnodal_coordinates_templated_helper(const DenseMatrix< double > &jacobian, const DShape &dpsids, DenseMatrix< double > &djacobian_dX) const
Calculate the derivative of the jacobian of a mapping with respect to the nodal coordinates X_ij usin...
double dnodal_position_gen_dt(const unsigned &j, const unsigned &n, const unsigned &k, const unsigned &i) const
i-th component of j-th time derivative of the generalised position, dx(k,i)/dt at local node n....
void get_x(const Vector< double > &s, Vector< double > &x) const
Global coordinates as function of local coordinates. Either via FE representation or via macro-elemen...
virtual void output(FILE *file_pt)
Output the element data — typically the values at the nodes in a format suitable for post-processing....
virtual void compute_error(std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
Plot the error when compared against a given exact solution . Also calculates the norm of the error a...
virtual void compute_error(FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, Vector< double > &error, Vector< double > &norm)
Given the exact solution this function calculates the norm of the error and that of the exact soluti...
virtual void compute_error(std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, Vector< double > &error, Vector< double > &norm)
Plot the error when compared against a given exact solution . Also calculates the norm of the error a...
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
virtual double compute_physical_size() const
Broken virtual function to compute the actual size (taking into account factors such as 2pi or radii ...
virtual double interpolated_dxdt(const Vector< double > &s, const unsigned &i, const unsigned &t)
Return t-th time-derivative of the i-th FE-interpolated Eulerian coordinate at local coordinate s.
virtual void compute_error(std::ostream &outfile, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, double &error, double &norm)
Plot the error when compared against a given time-dependent exact solution . Also calculates the norm...
virtual void identify_field_data_for_interactions(std::set< std::pair< Data *, unsigned >> &paired_field_data)
The purpose of this function is to identify all possible Data that can affect the fields interpolated...
virtual void get_s_plot(const unsigned &i, const unsigned &nplot, Vector< double > &s, const bool &shifted_to_interior=false) const
Get cector of local coordinates of plot point i (when plotting nplot points in each "coordinate direc...
virtual double zeta_nodal(const unsigned &n, const unsigned &k, const unsigned &i) const
Specify the values of the "global" intrinsic coordinate, zeta, of a compound geometric object (a mesh...
virtual Node * vertex_node_pt(const unsigned &j) const
Pointer to the j-th vertex node in the element. Broken virtual function in "pure" finite elements.
virtual unsigned nscalar_paraview() const
Number of scalars/fields output by this element. Broken virtual. Needs to be implemented for each new...
Node ** Node_pt
Storage for pointers to the nodes in the element.
virtual void compute_abs_error(std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error)
Plot the error when compared against a given exact solution . Also calculates the maximum absolute er...
double raw_dnodal_position_dt(const unsigned &n, const unsigned &j, const unsigned &i) const
Return the i-th component of j-th derivative of nodal position: d^jx/dt^j at node n....
virtual double local_to_eulerian_mapping(const DShape &dpsids, DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
Calculate the mapping from local to Eulerian coordinates, given the derivatives of the shape function...
virtual BulkCoordinateDerivativesFctPt bulk_coordinate_derivatives_fct_pt(const int &face_index) const
Get a pointer to the derivative of the mapping from face to bulk coordinates.
virtual void point_output_data(const Vector< double > &s, Vector< double > &data)
Virtual function to write the double precision numbers that appear in a single line of output into th...
unsigned Nnodal_position_type
The number of coordinate types required to interpolate the element's geometry between the nodes....
void get_centre_of_gravity_and_max_radius_in_terms_of_zeta(Vector< double > &cog, double &max_radius) const
Compute centre of gravity of all nodes and radius of node that is furthest from it....
virtual unsigned nplot_points(const unsigned &nplot) const
Return total number of plot points (when plotting nplot points in each "coordinate direction")
virtual void reset_after_nodal_fd()
Function that is call after the finite differencing of the nodal data. This may be overloaded to rese...
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.
double nodal_position(const unsigned &n, const unsigned &i) const
Return the i-th coordinate at local node n. If the node is hanging, the appropriate interpolation is ...
double dshape_eulerian(const Vector< double > &s, Shape &psi, DShape &dpsidx) const
Compute the geometric shape functions and also first derivatives w.r.t. global coordinates at local c...
virtual void enable_ALE()
(Re-)enable ALE, i.e. take possible mesh motion into account when evaluating the time-derivative....
unsigned Elemental_dimension
The spatial dimension of the element, i.e. the number of local coordinates used to parametrize it.
Node *const & node_pt(const unsigned &n) const
Return a pointer to the local node n (const version)
void transform_second_derivatives_diagonal(const DenseMatrix< double > &jacobian, const DenseMatrix< double > &inverse_jacobian, const DenseMatrix< double > &jacobian2, DShape &dbasis, DShape &d2basis) const
Convert derivatives and second derivatives w.r.t. local coordinates to derivatives and second derivat...
virtual bool local_coord_is_valid(const Vector< double > &s)
Broken assignment operator.
void check_J_eulerian_at_knots(bool &passed) const
Check that Jacobian of mapping between local and Eulerian coordinates at all integration points is po...
virtual void dshape_local(const Vector< double > &s, Shape &psi, DShape &dpsids) const
Function to compute the geometric shape functions and derivatives w.r.t. local coordinates at local c...
virtual void move_local_coord_back_into_element(Vector< double > &s) const
Adjust local coordinates so that they're located inside the element.
Data * geom_data_pt(const unsigned &j)
A standard FiniteElement is fixed, so there are no geometric data when viewed in its GeomObject incar...
double raw_nodal_value(const unsigned &t, const unsigned &n, const unsigned &i) const
Return the i-th value stored at local node n, at time level t (t=0: present; t>0 previous timesteps),...
FiniteElement(const FiniteElement &)=delete
Broken copy constructor.
virtual unsigned nsub_elements_paraview(const unsigned &nplot) const
Return the number of local sub-elements for paraview plot with parameter nplot. Broken virtual; can b...
virtual void assemble_eulerian_base_vectors(const DShape &dpsids, DenseMatrix< double > &interpolated_G) const
Assemble the covariant Eulerian base vectors, assuming that the derivatives of the shape functions wi...
virtual void assemble_local_to_eulerian_jacobian2(const DShape &d2psids, DenseMatrix< double > &jacobian2) const
Assemble the the "jacobian" matrix of second derivatives of the mapping from local to Eulerian coordi...
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
A template-free interface that calculates the derivative w.r.t. the nodal coordinates of the derivat...
void set_n_node(const unsigned &n)
Set the number of nodes in the element to n, by resizing the storage for pointers to the Node objects...
virtual double J_eulerian_at_knot(const unsigned &ipt) const
Return the Jacobian of the mapping from local to global coordinates at the ipt-th integration point.
MacroElement * macro_elem_pt()
Access function to pointer to macro element.
void integrate_fct(FiniteElement::SteadyExactSolutionFctPt integrand_fct_pt, Vector< double > &integral)
Evaluate integral of a Vector-valued function over the element.
double raw_dnodal_position_dt(const unsigned &n, const unsigned &i) const
Return the i-th component of nodal velocity: dx/dt at local node n. Do not use the hanging node repre...
virtual void describe_local_dofs(std::ostream &out, const std::string ¤t_string) const
Function to describe the local dofs of the element[s]. The ostream specifies the output stream to whi...
virtual void build_face_element(const int &face_index, FaceElement *face_element_pt)
Function for building a lower dimensional FaceElement on the specified face of the FiniteElement....
virtual void transform_second_derivatives(const DenseMatrix< double > &jacobian, const DenseMatrix< double > &inverse_jacobian, const DenseMatrix< double > &jacobian2, DShape &dbasis, DShape &d2basis) const
Convert derivatives and second derivatives w.r.t. local coordiantes to derivatives and second derivat...
virtual Node * construct_node(const unsigned &n, TimeStepper *const &time_stepper_pt)
Construct the local node n, including storage for history values required by timestepper,...
virtual void describe_nodal_local_dofs(std::ostream &out, const std::string ¤t_string) const
Function to describe the local dofs of the element[s]. The ostream specifies the output stream to whi...
double raw_dnodal_position_gen_dt(const unsigned &n, const unsigned &k, const unsigned &i) const
i-th component of time derivative (velocity) of the generalised position, dx(k,i)/dt at local node n....
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
Write values of the i-th scalar field at the plot points. Broken virtual. Needs to be implemented for...
virtual unsigned nnode_1d() const
Return the number of nodes along one edge of the element Default is to return zero — must be overload...
unsigned nodal_dimension() const
Return the required Eulerian dimension of the nodes in this element.
int ** Nodal_local_eqn
Storage for the local equation numbers associated with the values stored at the nodes.
virtual ~FiniteElement()
The destructor cleans up the static memory allocated for shape function storage. Internal and externa...
double raw_nodal_value(const unsigned &n, const unsigned &i) const
Return the i-th value stored at local node n but do NOT take hanging nodes into account.
virtual void get_x_from_macro_element(const Vector< double > &s, Vector< double > &x) const
Global coordinates as function of local coordinates using macro element representation....
double raw_nodal_position(const unsigned &n, const unsigned &i) const
Return the i-th coordinate at local node n. Do not use the hanging node representation....
virtual void get_x_from_macro_element(const unsigned &t, const Vector< double > &s, Vector< double > &x)
Global coordinates as function of local coordinates at previous time "level" t (t=0: present; t>0: pr...
virtual void node_update()
Update the positions of all nodes in the element using each node update function. The default impleme...
virtual void write_tecplot_zone_footer(std::ostream &outfile, const unsigned &nplot) const
Add tecplot zone "footer" to output stream (when plotting nplot points in each "coordinate direction"...
virtual void scalar_value_fct_paraview(std::ofstream &file_out, const unsigned &i, const unsigned &nplot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt) const
Write values of the i-th scalar field at the plot points. Broken virtual. Needs to be implemented for...
virtual Node * construct_boundary_node(const unsigned &n)
Construct the local node n as a boundary node; that is a node that MAY be placed on a mesh boundary a...
unsigned Nnode
Number of nodes in the element.
virtual void set_integration_scheme(Integral *const &integral_pt)
Set the spatial integration scheme.
void output_paraview(std::ofstream &file_out, const unsigned &nplot) const
Paraview output – this outputs the coordinates at the plot points (for parameter nplot) to specified ...
static const unsigned N2deriv[]
Static array that holds the number of second derivatives as a function of the dimension of the elemen...
void position(const unsigned &t, const Vector< double > &zeta, Vector< double > &r) const
Return the parametrised position of the FiniteElement in its GeomObject incarnation: r(zeta)....
static bool Accept_negative_jacobian
Boolean that if set to true allows a negative jacobian in the transform between global and local coor...
void(* UnsteadyExactSolutionFctPt)(const double &, const Vector< double > &, Vector< double > &)
Function pointer for function that computes Vector-valued time-dependent function as .
double raw_nodal_position_gen(const unsigned &t, const unsigned &n, const unsigned &k, const unsigned &i) const
Return the generalised nodal position (type k, i-th variable) at previous timesteps at local node n....
virtual unsigned nnode_on_face() const
void transform_derivatives_diagonal(const DenseMatrix< double > &inverse_jacobian, DShape &dbasis) const
Convert derivative w.r.t local coordinates to derivatives w.r.t the coordinates used to assemble the ...
virtual double local_one_d_fraction_of_node(const unsigned &n1d, const unsigned &i)
Get the local fraction of any node in the n-th position in a one dimensional expansion along the i-th...
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.
double raw_nodal_position_gen(const unsigned &n, const unsigned &k, const unsigned &i) const
Return the value of the k-th type of the i-th positional variable at the local node n....
virtual void output(FILE *file_pt, const unsigned &n_plot)
Output the element data — pass (some measure of) the number of plot points per element (C style outpu...
FiniteElement()
Constructor.
unsigned ngeom_data() const
A standard FiniteElement is fixed, so there are no geometric data when viewed in its GeomObject incar...
virtual Node * construct_boundary_node(const unsigned &n, TimeStepper *const &time_stepper_pt)
Construct the local node n, including storage for history values required by timestepper,...
virtual void get_dresidual_dnodal_coordinates(RankThreeTensor< double > &dresidual_dnodal_coordinates)
Compute derivatives of elemental residual vector with respect to nodal coordinates....
double nodal_position(const unsigned &t, const unsigned &n, const unsigned &i) const
Return the i-th coordinate at local node n, at time level t (t=0: present; t>0: previous time level) ...
static bool Suppress_output_while_checking_for_inverted_elements
Static boolean to suppress output while checking for inverted elements.
double invert_jacobian(const DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
Take the matrix passed as jacobian and return its inverse in inverse_jacobian. This function is templ...
int get_node_number(Node *const &node_pt) const
Return the number of the node *node_pt if this node is in the element, else return -1;.
virtual void shape_at_knot(const unsigned &ipt, Shape &psi) const
Return the geometric shape function at the ipt-th integration point.
virtual double d2shape_eulerian_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsidx, DShape &d2psidx) const
Return the geometric shape functions and also first and second derivatives w.r.t. global coordinates ...
virtual void dJ_eulerian_dnodal_coordinates(const DenseMatrix< double > &jacobian, const DShape &dpsids, DenseMatrix< double > &djacobian_dX) const
A template-free interface that calculates the derivative of the jacobian of a mapping with respect to...
virtual void write_paraview_offsets(std::ofstream &file_out, const unsigned &nplot, unsigned &offset_sum) const
Return the offsets for the paraview sub-elements. Broken virtual. Needs to be implemented for each ne...
virtual CoordinateMappingFctPt face_to_bulk_coordinate_fct_pt(const int &face_index) const
Get a pointer to the function mapping face coordinates to bulk coordinates.
static const unsigned Default_Initial_Nvalue
Default return value for required_nvalue(n) which gives the number of "data" values required by the e...
bool has_hanging_nodes() const
Return boolean to indicate if any of the element's nodes are geometrically hanging.
double local_to_eulerian_mapping(const DShape &dpsids, DenseMatrix< double > &inverse_jacobian) const
Calculate the mapping from local to Eulerian coordinates, given the derivatives of the shape function...
virtual unsigned self_test()
Self-test: Check inversion of element & do self-test for GeneralisedElement. Return 0 if OK.
void fill_in_jacobian_from_nodal_by_fd(DenseMatrix< double > &jacobian)
Calculate the contributions to the jacobian from the nodal degrees of freedom using finite difference...
virtual void output(std::ostream &outfile, const unsigned &n_plot)
Output the element data — pass (some measure of) the number of plot points per element.
virtual void write_paraview_output_offset_information(std::ofstream &file_out, const unsigned &nplot, unsigned &counter) const
Fill in the offset information for paraview plot. Broken virtual. Needs to be implemented for each ne...
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
const unsigned & boundary_number_in_bulk_mesh() const
Access function for the boundary number in bulk mesh.
void set_boundary_number_in_bulk_mesh(const unsigned &b)
Set function for the boundary number in bulk mesh.
unsigned Boundary_number_in_bulk_mesh
The boundary number in the bulk mesh to which this element is attached.
FreeStandingFaceElement()
Constructor.
bool Boundary_number_in_bulk_mesh_has_been_set
Has the Boundary_number_in_bulk_mesh been set? Only included if compiled with PARANOID switched on.
double zeta_nodal(const unsigned &n, const unsigned &k, const unsigned &i) const
In a FaceElement, the "global" intrinsic coordinate of the element along the boundary,...
A Generalised Element class.
void set_nonhalo()
Label the element as not being a halo.
void fill_in_jacobian_from_external_by_fd(Vector< double > &residuals, DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
Calculate the contributions to the jacobian from the external degrees of freedom using finite differe...
unsigned nexternal_data() const
Return the number of external data objects.
virtual void reset_in_external_fd(const unsigned &i)
Function called within the finite difference loop for external data after the values in the i-th exte...
virtual void fill_in_contribution_to_mass_matrix(Vector< double > &residuals, DenseMatrix< double > &mass_matrix)
Add the elemental contribution to the mass matrix matrix. and the residuals vector....
virtual unsigned ndof_types() const
The number of types of degrees of freedom in this element are sub-divided into.
virtual void update_in_internal_fd(const unsigned &i)
Function called within the finite difference loop for internal data after a change in any values in t...
bool is_halo() const
Is this element a halo?
virtual void reset_after_external_fd()
Function that is call after the finite differencing of the external data. This may be overloaded to r...
virtual void update_before_external_fd()
Function that is called before the finite differencing of any external data. This may be overloaded t...
bool Must_be_kept_as_halo
Does this element need to be kept as a halo element during a distribute?
void dof_vector(const unsigned &t, Vector< double > &dof)
Return the vector of dof values at time level t.
virtual void get_inner_products(Vector< std::pair< unsigned, unsigned >> const &history_index, Vector< double > &inner_product)
Return the vector of inner product of the given pairs of history values.
void assign_internal_eqn_numbers(unsigned long &global_number, Vector< double * > &Dof_pt)
Assign the global equation numbers to the internal Data. The arguments are the current highest global...
static double Default_fd_jacobian_step
Double used for the default finite difference step in elemental jacobian calculations.
void set_internal_data_time_stepper(const unsigned &i, TimeStepper *const &time_stepper_pt, const bool &preserve_existing_data)
Set the timestepper associated with the i-th internal data object.
void operator=(const GeneralisedElement &)=delete
Broken assignment operator.
static bool Suppress_warning_about_repeated_external_data
Static boolean to suppress warnings about repeated external data. Defaults to true.
virtual void get_hessian_vector_products(Vector< double > const &Y, DenseMatrix< double > const &C, DenseMatrix< double > &product)
Calculate the product of the Hessian (derivative of Jacobian with respect to all variables) an eigenv...
Data *const & internal_data_pt(const unsigned &i) const
Return a pointer to i-th internal data object (const version)
bool internal_data_fd(const unsigned &i) const
Return the status of the boolean flag indicating whether the internal data is included in the finite ...
unsigned long * Eqn_number
Storage for the global equation numbers represented by the degrees of freedom in the element.
void read_internal_eqn_numbers_from_vector(const Vector< long > &vector_of_eqn_numbers, unsigned &index)
Read all equation numbers associated with internal data from the vector starting from index....
virtual void get_dof_numbers_for_unknowns(std::list< std::pair< unsigned long, unsigned >> &dof_lookup_list) const
Create a list of pairs for the unknowns that this element is "in charge of" – ignore any unknowns ass...
virtual void fill_in_contribution_to_jacobian_and_mass_matrix(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
Add the elemental contribution to the jacobian matrix, mass matrix and the residuals vector....
virtual void fill_in_contribution_to_djacobian_and_dmass_matrix_dparameter(double *const ¶meter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam, DenseMatrix< double > &dmass_matrix_dparam)
Add the elemental contribution to the derivative of the jacobian matrix, mass matrix and the residual...
virtual void fill_in_contribution_to_inner_product_vectors(Vector< unsigned > const &history_index, Vector< Vector< double >> &inner_product_vector)
Fill in the contributions to the vectors that when taken as dot product with other history values giv...
void fill_in_jacobian_from_internal_by_fd(DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
Calculate the contributions to the jacobian from the internal degrees of freedom using finite differe...
virtual void fill_in_contribution_to_residuals(Vector< double > &residuals)
Add the elemental contribution to the residuals vector. Note that this function will NOT initialise t...
void fill_in_jacobian_from_internal_by_fd(Vector< double > &residuals, DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
Calculate the contributions to the jacobian from the internal degrees of freedom using finite differe...
bool external_data_fd(const unsigned &i) const
Return the status of the boolean flag indicating whether the external data is included in the finite ...
virtual void assign_all_generic_local_eqn_numbers(const bool &store_local_dof_pt)
Assign all the local equation numbering schemes that can be applied generically for the element....
void exclude_internal_data_fd(const unsigned &i)
Set the boolean flag to exclude the internal datum from the finite difference loop when computing the...
unsigned add_internal_data(Data *const &data_pt, const bool &fd=true)
Add a (pointer to an) internal data object to the element and return the index required to obtain it ...
unsigned ndof() const
Return the number of equations/dofs in the element.
unsigned long eqn_number(const unsigned &ieqn_local) const
Return the global equation number corresponding to the ieqn_local-th local equation number.
int ** Data_local_eqn
Pointer to array storage for local equation numbers associated with internal and external data....
int local_eqn_number(const unsigned long &ieqn_global) const
Return the local equation number corresponding to the ieqn_global-th global equation number....
Data *& external_data_pt(const unsigned &i)
Return a pointer to i-th external data object.
void add_internal_data_values_to_vector(Vector< double > &vector_of_values)
Add all internal data and time history values to the vector in the internal storage order.
void fill_in_jacobian_from_external_by_fd(DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
Calculate the contributions to the jacobian from the external degrees of freedom using finite differe...
Data *& internal_data_pt(const unsigned &i)
Return a pointer to i-th internal data object.
static DenseMatrix< double > Dummy_matrix
Empty dense matrix used as a dummy argument to combined residual and jacobian functions in the case w...
virtual void assign_additional_local_eqn_numbers()
Setup any additional look-up schemes for local equation numbers. Examples of use include using local ...
virtual void get_residuals(Vector< double > &residuals)
Calculate the vector of residuals of the equations in the element. By default initialise the vector t...
int non_halo_proc_ID()
ID of processor ID that holds non-halo counterpart of halo element; negative if not a halo.
Data *const & external_data_pt(const unsigned &i) const
Return a pointer to i-th external data object (const version)
virtual void get_mass_matrix(Vector< double > &residuals, DenseMatrix< double > &mass_matrix)
Calculate the residuals and the elemental "mass" matrix, the matrix that multiplies the time derivati...
void unset_must_be_kept_as_halo()
Do not insist that this element be kept as a halo element during distribution.
virtual void get_dresiduals_dparameter(double *const ¶meter_pt, Vector< double > &dres_dparam)
Calculate the derivatives of the residuals with respect to a parameter.
virtual void fill_in_contribution_to_dresiduals_dparameter(double *const ¶meter_pt, Vector< double > &dres_dparam)
Add the elemental contribution to the derivatives of the residuals with respect to a parameter....
virtual void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Add the elemental contribution to the jacobian matrix. and the residuals vector. Note that this funct...
unsigned ninternal_data() const
Return the number of internal data objects.
bool must_be_kept_as_halo() const
Test whether the element must be kept as a halo element.
int Non_halo_proc_ID
Non-halo processor ID for Data; -1 if it's not a halo.
void clear_global_eqn_numbers()
Clear the storage for the global equation numbers and pointers to dofs (if stored)
void include_internal_data_fd(const unsigned &i)
Set the boolean flag to include the internal datum in the finite difference loop when computing the j...
void dof_pt_vector(Vector< double * > &dof_pt)
Return the vector of pointers to dof values.
unsigned Ninternal_data
Number of internal data.
unsigned Nexternal_data
Number of external data.
void add_internal_value_pt_to_map(std::map< unsigned, double * > &map_of_value_pt)
Add pointers to the internal data values to map indexed by the global equation number.
void add_global_eqn_numbers(std::deque< unsigned long > const &global_eqn_numbers, std::deque< double * > const &global_dof_pt)
Add the contents of the queue global_eqn_numbers to the local storage for the local-to-global transla...
virtual void update_before_internal_fd()
Function that is called before the finite differencing of any internal data. This may be overloaded t...
virtual void fill_in_contribution_to_inner_products(Vector< std::pair< unsigned, unsigned >> const &history_index, Vector< double > &inner_product)
Fill in the contribution to the inner products between given pairs of history values.
virtual void reset_in_internal_fd(const unsigned &i)
Function called within the finite difference loop for internal data after the values in the i-th exte...
virtual void fill_in_contribution_to_djacobian_dparameter(double *const ¶meter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam)
Add the elemental contribution to the derivatives of the elemental Jacobian matrix and residuals with...
virtual void fill_in_contribution_to_hessian_vector_products(Vector< double > const &Y, DenseMatrix< double > const &C, DenseMatrix< double > &product)
Fill in contribution to the product of the Hessian (derivative of Jacobian with respect to all variab...
unsigned Ndof
Number of degrees of freedom.
int internal_local_eqn(const unsigned &i, const unsigned &j) const
Return the local equation number corresponding to the j-th value stored at the i-th internal data.
virtual void describe_local_dofs(std::ostream &out, const std::string ¤t_string) const
Function to describe the local dofs of the element. The ostream specifies the output stream to which ...
virtual void get_inner_product_vectors(Vector< unsigned > const &history_index, Vector< Vector< double >> &inner_product_vector)
Compute the vectors that when taken as a dot product with other history values give the inner product...
static std::deque< double * > Dof_pt_deque
Static storage for deque used to add_global_equation_numbers when pointers to the dofs in each elemen...
virtual void get_djacobian_and_dmass_matrix_dparameter(double *const ¶meter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam, DenseMatrix< double > &dmass_matrix_dparam)
Calculate the derivatives of the elemental Jacobian matrix mass matrix and residuals with respect to ...
virtual void assign_internal_and_external_local_eqn_numbers(const bool &store_local_dof_pt)
Assign the local equation numbers for the internal and external Data This must be called after the gl...
void set_halo(const unsigned &non_halo_proc_ID)
Label the element as halo and specify processor that holds non-halo counterpart.
void add_internal_eqn_numbers_to_vector(Vector< long > &vector_of_eqn_numbers)
Add all equation numbers associated with internal data to the vector in the internal storage order.
virtual void reset_after_internal_fd()
Function that is call after the finite differencing of the internal data. This may be overloaded to r...
void set_must_be_kept_as_halo()
Insist that this element be kept as a halo element during a distribute?
virtual unsigned self_test()
Self-test: Have all internal values been classified as pinned/unpinned? Return 0 if OK.
virtual void get_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Calculate the elemental Jacobian matrix "d equation / d variable".
virtual void get_djacobian_dparameter(double *const ¶meter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam)
Calculate the derivatives of the elemental Jacobian matrix and residuals with respect to a parameter.
virtual void assign_local_eqn_numbers(const bool &store_local_dof_pt)
Setup the arrays of local equation numbers for the element. If the optional boolean argument is true,...
void include_external_data_fd(const unsigned &i)
Set the boolean flag to include the external datum in the the finite difference loop when computing t...
Data ** Data_pt
Storage for pointers to internal and external data. The data is of the same type and so can be addres...
static bool Suppress_warning_about_repeated_internal_data
Static boolean to suppress warnings about repeated internal data. Defaults to false.
virtual void get_jacobian_and_mass_matrix(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
Calculate the residuals and jacobian and elemental "mass" matrix, the matrix that multiplies the time...
virtual void compute_norm(Vector< double > &norm)
Compute norm of solution – broken virtual can be overloaded by element writer to implement whatever n...
double ** Dof_pt
Storage for array of pointers to degrees of freedom ordered by local equation number....
int external_local_eqn(const unsigned &i, const unsigned &j)
Return the local equation number corresponding to the j-th value stored at the i-th external data.
void describe_dofs(std::ostream &out, const std::string ¤t_string) const
Function to describe the dofs of the element. The ostream specifies the output stream to which the de...
std::vector< bool > Data_fd
Storage for boolean flags of size Ninternal_data + Nexternal_data that correspond to the data used in...
void flush_external_data()
Flush all external data.
virtual void complete_setup_of_dependencies()
Complete the setup of any additional dependencies that the element may have. Empty virtual function t...
virtual void compute_norm(double &norm)
Compute norm of solution – broken virtual can be overloaded by element writer to implement whatever n...
GeneralisedElement() GeneralisedElement(const GeneralisedElement &)=delete
Constructor: Initialise all pointers and all values to zero.
void read_internal_data_values_from_vector(const Vector< double > &vector_of_values, unsigned &index)
Read all internal data and time history values from the vector starting from index....
void exclude_external_data_fd(const unsigned &i)
Set the boolean flag to exclude the external datum from the the finite difference loop when computing...
virtual void update_in_external_fd(const unsigned &i)
Function called within the finite difference loop for external data after a change in any values in t...
unsigned add_external_data(Data *const &data_pt, const bool &fd=true)
Add a (pointer to an) external data object to the element and return its index (i....
/////////////////////////////////////////////////////////////////////
TimeStepper *& time_stepper_pt()
Access function for pointer to time stepper: Null if object is not time-dependent.
Generic class for numerical integration schemes:
Base class for MacroElement s that are used during mesh refinement in domains with curvlinear and/or ...
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
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
Compute the diagonal of the velocity/pressure mass matrices. If which one=0, both are computed,...
virtual ~NavierStokesElementWithDiagonalMassMatrices()
Virtual destructor.
NavierStokesElementWithDiagonalMassMatrices(const NavierStokesElementWithDiagonalMassMatrices &)=delete
Broken copy constructor.
NavierStokesElementWithDiagonalMassMatrices()
Empty constructor.
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
double dx_gen_dt(const unsigned &k, const unsigned &i) const
i-th component of time derivative (velocity) of the generalised position, dx(k,i)/dt....
double & x(const unsigned &i)
Return the i-th nodal coordinate.
double & x_gen(const unsigned &k, const unsigned &i)
Reference to the generalised position x(k,i). ‘Type’: k; Coordinate direction: i.
void position(Vector< double > &pos) const
Compute Vector of nodal positions either directly or via hanging node representation.
unsigned ndim() const
Return (Eulerian) spatial dimension of the node.
double position_gen(const unsigned &k, const unsigned &i) const
Return generalised nodal coordinate either directly or via hanging node representation.
virtual void get_coordinates_on_boundary(const unsigned &b, const unsigned &k, Vector< double > &boundary_zeta)
Return the vector of the k-th generalised boundary coordinates on mesh boundary b....
double raw_value(const unsigned &i) const
Return the i-th value stored at the Node. This interface does NOT take the hanging status of the Node...
double dposition_dt(const unsigned &i) const
Return the i-th component of nodal velocity: dx/dt, either directly or via hanging node representatio...
double dx_dt(const unsigned &i) const
Return the i-th component of nodal velocity: dx/dt.
void resize(const unsigned &n_value)
Resize the number of equations.
double dposition_gen_dt(const unsigned &k, const unsigned &i) const
i-th component of time derivative (velocity) of the generalised position, dx(k,i)/dt....
double value(const unsigned &i) const
Return i-th value (dofs or pinned) at this node either directly or via hanging node representation....
An OomphLibError object which should be thrown when an run-time error is encountered....
An OomphLibWarning object which should be created as a temporary object to issue a warning....
/////////////////////////////////////////////////////////////////////// /////////////////////////////...
PointElement()
Constructor.
void shape(const Vector< double > &s, Shape &psi) const
Broken assignment operator.
PointElement(const PointElement &)=delete
Broken copy constructor.
static PointIntegral Default_integration_scheme
Return spatial dimension of element (=number of local coordinates needed to parametrise the element)
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.
Broken pseudo-integration scheme for points elements: Iit's not clear in general what this integratio...
////////////////////////////////////////////////////////////////// //////////////////////////////////...
////////////////////////////////////////////////////////////////// //////////////////////////////////...
A Class for shape functions. In simple cases, the shape functions have only one index that can be tho...
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
SolidElementWithDiagonalMassMatrix()
Empty constructor.
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
Get the diagonal of whatever represents the mass matrix in the specific preconditionable element....
virtual ~SolidElementWithDiagonalMassMatrix()
Virtual destructor.
SolidFaceElements combine FaceElements and SolidFiniteElements and overload various functions so they...
double zeta_nodal(const unsigned &n, const unsigned &k, const unsigned &i) const
The "global" intrinsic coordinate of the element when viewed as part of a geometric object should be ...
double interpolated_xi(const Vector< double > &s, const unsigned &i) const
Return i-th FE-interpolated Lagrangian coordinate xi[i] at local coordinate s. Overloaded from SolidF...
void interpolated_xi(const Vector< double > &s, Vector< double > &xi) const
Compute FE interpolated Lagrangian coordinate vector xi[] at local coordinate s as Vector....
////////////////////////////////////////////////////////////////////// //////////////////////////////...
unsigned lagrangian_dimension() const
Return the number of Lagrangian coordinates that the element requires at all nodes....
virtual void set_macro_elem_pt(MacroElement *macro_elem_pt, MacroElement *undeformed_macro_elem_pt)
Set pointers to "current" and "undeformed" MacroElements. Can be overloaded in derived classes to per...
virtual void set_macro_elem_pt(MacroElement *macro_elem_pt)
Set pointer to MacroElement – overloads generic version and uses the MacroElement also as the default...
double lagrangian_position(const unsigned &n, const unsigned &i) const
Return i-th Lagrangian coordinate at local node n.
void set_undeformed_macro_elem_pt(MacroElement *undeformed_macro_elem_pt)
Set pointer to "undeformed" macro element. Can be overloaded in derived classes to perform additional...
Node * construct_node(const unsigned &n)
Construct the local node n and return a pointer to it.
void disable_solve_for_consistent_newmark_accel()
Set to reset the problem being solved to be the standard problem.
void describe_solid_local_dofs(std::ostream &out, const std::string ¤t_string) const
Classifies dofs locally for solid specific aspects.
double lagrangian_position_gen(const unsigned &n, const unsigned &k, const unsigned &i) const
Return Generalised Lagrangian coordinate at local node n. ‘Direction’ i, ‘Type’ k.
double(* MultiplierFctPt)(const Vector< double > &xi)
Pointer to function that computes the "multiplier" for the inertia terms in the consistent determinat...
double raw_lagrangian_position_gen(const unsigned &n, const unsigned &k, const unsigned &i) const
Return Generalised Lagrangian coordinate at local node n. ‘Direction’ i, ‘Type’ k....
MacroElement * undeformed_macro_elem_pt()
Access function to pointer to "undeformed" macro element.
Data * geom_data_pt(const unsigned &j)
Return pointer to the j-th Data item that the object's shape depends on. (Redirects to the nodes' pos...
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
Eulerian and Lagrangian coordinates as function of the local coordinates: The Eulerian position is re...
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Overload the fill_in_contribution_to_jacobian() function to use finite differences to calculate the s...
int * Position_local_eqn
Array to hold the local equation number information for the solid equations, whatever they may be.
virtual void assemble_local_to_lagrangian_jacobian2(const DShape &d2psids, DenseMatrix< double > &jacobian2) const
Assemble the the "jacobian" matrix of second derivatives, given the second derivatives of the shape f...
void fill_in_jacobian_from_solid_position_by_fd(DenseMatrix< double > &jacobian)
Use finite differences to calculate the Jacobian entries corresponding to the solid positions.
virtual void assign_solid_local_eqn_numbers(const bool &store_local_dof)
Assigns local equation numbers for the generic solid local equation numbering schemes....
double dshape_lagrangian(const Vector< double > &s, Shape &psi, DShape &dpsidxi) const
Calculate shape functions and derivatives w.r.t. Lagrangian coordinates at local coordinate s....
double raw_lagrangian_position(const unsigned &n, const unsigned &i) const
Return i-th Lagrangian coordinate at local node n without using the hanging representation.
unsigned nnodal_lagrangian_type() const
Return the number of types of (generalised) nodal Lagrangian coordinates required to interpolate the ...
void enable_solve_for_consistent_newmark_accel()
Set to alter the problem being solved when assigning the initial conditions for time-dependent proble...
double zeta_nodal(const unsigned &n, const unsigned &k, const unsigned &i) const
In a SolidFiniteElement, the "global" intrinsic coordinate of the element when viewed as part of a co...
unsigned Lagrangian_dimension
The Lagrangian dimension of the nodes stored in the element, / i.e. the number of Lagrangian coordina...
virtual void update_before_solid_position_fd()
Function that is called before the finite differencing of any solid position data....
bool Solve_for_consistent_newmark_accel_flag
Flag to indicate which system of equations to solve when assigning initial conditions for time-depend...
MacroElement * Undeformed_macro_elem_pt
Pointer to the element's "undeformed" macro element (NULL by default)
MultiplierFctPt & multiplier_fct_pt()
Access function: Pointer to multiplicator function for assignment of consistent assignement of initia...
SolidInitialCondition * Solid_ic_pt
Pointer to object that specifies the initial condition.
void fill_in_residuals_for_solid_ic(Vector< double > &residuals)
Fill in the residuals for the setup of an initial condition. The global equations are:
virtual double d2shape_lagrangian_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsidxi, DShape &d2psidxi) const
Return the geometric shape functions and also first and second derivatives w.r.t. Lagrangian coordina...
void fill_in_generic_jacobian_for_solid_ic(Vector< double > &residuals, DenseMatrix< double > &jacobian, const unsigned &flag)
Helper function to fill in the residuals and (if flag==1) the Jacobian for the setup of an initial co...
virtual void J_lagrangian(const Vector< double > &s) const
Return the Jacobian of mapping from local to Lagrangian coordinates at local position s....
unsigned ngeom_data() const
Broken assignment operator.
void set_nnodal_lagrangian_type(const unsigned &nlagrangian_type)
Set the number of types required to interpolate the Lagrangian coordinates.
virtual double local_to_lagrangian_mapping_diagonal(const DShape &dpsids, DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
Calculate the mapping from local to Lagrangian coordinates given the derivatives of the shape functio...
unsigned Nnodal_lagrangian_type
The number of coordinate types requried to intepolate the Lagrangian coordinates in the element....
virtual void update_in_solid_position_fd(const unsigned &i)
Function called within the finite difference loop for the solid position dat after a change in any va...
int position_local_eqn(const unsigned &n, const unsigned &k, const unsigned &j) const
Access function that returns the local equation number that corresponds to the j-th coordinate of the...
virtual double local_to_lagrangian_mapping(const DShape &dpsids, DenseMatrix< double > &jacobian, DenseMatrix< double > &inverse_jacobian) const
Calculate the mapping from local to lagrangian coordinates, given the derivatives of the shape functi...
virtual void get_residuals_for_solid_ic(Vector< double > &residuals)
Compute the residuals for the setup of an initial condition. The global equations are:
virtual void assemble_local_to_lagrangian_jacobian(const DShape &dpsids, DenseMatrix< double > &jacobian) const
Assemble the jacobian matrix for the mapping from local to lagrangian coordinates,...
virtual double interpolated_xi(const Vector< double > &s, const unsigned &i) const
Return i-th FE-interpolated Lagrangian coordinate xi[i] at local coordinate s.
Node * construct_boundary_node(const unsigned &n, TimeStepper *const &time_stepper_pt)
Construct the local node n and return a pointer to it, in the case when the node MAY be located on a ...
void identify_geometric_data(std::set< Data * > &geometric_data_pt)
Specify Data that affects the geometry of the element by adding the position Data to the set that's p...
virtual void reset_in_solid_position_fd(const unsigned &i)
Function called within the finite difference loop for solid position data after the values in the i-t...
virtual void interpolated_dxids(const Vector< double > &s, DenseMatrix< double > &dxids) const
Compute derivatives of FE-interpolated Lagrangian coordinates xi with respect to local coordinates: d...
virtual double dshape_lagrangian_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsidxi) const
Return the geometric shape functions and also first derivatives w.r.t. Lagrangian coordinates at ipt-...
virtual void fill_in_jacobian_from_solid_position_by_fd(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Use finite differences to calculate the Jacobian entries corresponding to the solid positions....
SolidFiniteElement()
Constructor: Set defaults.
virtual bool has_internal_solid_data()
Return whether there is internal solid data (e.g. discontinuous solid pressure). At present,...
void fill_in_jacobian_for_solid_ic(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Fill in the residuals and Jacobian for the setup of an initial condition. The global equations are:
double multiplier(const Vector< double > &xi)
Access to the "multiplier" for the inertia terms in the consistent determination of the initial condi...
virtual void assign_all_generic_local_eqn_numbers(const bool &store_local_dof_pt)
Overload assign_all_generic_local_equation numbers to include the data associated with solid dofs....
SolidInitialCondition *& solid_ic_pt()
Pointer to object that describes the initial condition.
double d2shape_lagrangian(const Vector< double > &s, Shape &psi, DShape &dpsidxi, DShape &d2psidxi) const
Compute the geometric shape functions and also first and second derivatives w.r.t....
Node * construct_boundary_node(const unsigned &n)
Construct the local node n and return a pointer to it. in the case when it is a boundary node; that i...
void compute_norm(double &el_norm)
Calculate the L2 norm of the displacement u=R-r to overload the compute_norm function in the Generali...
virtual double J_lagrangian_at_knot(const unsigned &ipt) const
Return the Jacobian of the mapping from local to Lagrangian coordinates at the ipt-th integration poi...
void describe_local_dofs(std::ostream &out, const std::string ¤t_string) const
Function to describe the local dofs of the element. The ostream specifies the output stream to which ...
SolidFiniteElement(const SolidFiniteElement &)=delete
Broken copy constructor.
Node * construct_node(const unsigned &n, TimeStepper *const &time_stepper_pt)
Construct the local node n and return a pointer to it. Additionally, create storage for ‘history’ val...
MultiplierFctPt Multiplier_fct_pt
Pointer to function that computes the "multiplier" for the inertia terms in the consistent determinat...
virtual ~SolidFiniteElement()
Destructor to clean up any allocated memory.
void fill_in_jacobian_for_newmark_accel(DenseMatrix< double > &jacobian)
Fill in the contributions of the Jacobian matrix for the consistent assignment of the initial "accele...
double local_to_lagrangian_mapping(const DShape &dpsids, DenseMatrix< double > &inverse_jacobian) const
Calculate the mapping from local to lagrangian coordinates, given the derivatives of the shape functi...
virtual void reset_after_solid_position_fd()
Function that is call after the finite differencing of the solid position data. This may be overloade...
void set_lagrangian_dimension(const unsigned &lagrangian_dimension)
Set the lagrangian dimension of the element — the number of lagrangian coordinates stored at the node...
MultiplierFctPt multiplier_fct_pt() const
Access function: Pointer to multiplicator function for assignment of consistent assignement of initia...
A class to specify the initial conditions for a solid body. Solid bodies are often discretised with H...
GeomObject *& geom_object_pt()
(Reference to) pointer to geom object that specifies the initial condition
unsigned IC_time_deriv
Which time derivative (0,1,2) are we currently assigning.
GeomObject * Geom_object_pt
Pointer to the GeomObject that specifies the initial condition (shape, veloc and accel)
void operator=(const SolidInitialCondition &)=delete
Broken assignment operator.
SolidInitialCondition(GeomObject *geom_object_pt)
Constructor: Pass geometric object; initialise time deriv to 0.
SolidInitialCondition(const SolidInitialCondition &)=delete
Broken copy constructor.
unsigned & ic_time_deriv()
Which time derivative are we currently assigning?
A Class for nodes that deform elastically (i.e. position is an unknown in the problem)....
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
Function base class for exact solutions/initial conditions/boundary conditions. This is needed so tha...
////////////////////////////////////////////////////////////////////// //////////////////////////////...
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.
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.
unsigned Max_newton_iterations
Maximum number of newton iterations.
double Newton_tolerance
Convergence tolerance for the newton solver.
unsigned N_local_points
Number of points along one dimension of each element used to create coordinates within the element in...
double Radius_multiplier_for_fast_exit_from_locate_zeta
Multiplier for (zeta-based) outer radius of element used for deciding that point is outside element....
std::string to_string(T object, unsigned float_precision=8)
Conversion function that should work for anything with operator<< defined (at least all basic types).
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
void(* BulkCoordinateDerivativesFctPt)(const Vector< double > &s, DenseMatrix< double > &ds_bulk_dsface, unsigned &interior_direction)
Typedef for the function that returns the partial derivative of the local coordinates in the bulk ele...
void(* CoordinateMappingFctPt)(const Vector< double > &s, Vector< double > &s_bulk)
Typedef for the function that translates the face coordinate to the coordinate in the bulk element.