30#ifndef OOMPH_MULTI_DOMAIN_BOUSSINESQ_ELEMENTS_HEADER
31#define OOMPH_MULTI_DOMAIN_BOUSSINESQ_ELEMENTS_HEADER
36#include "advection_diffusion.h"
37#include "navier_stokes.h"
45 namespace MultiDomainBoussinesqHelper
62 template<
class NST_ELEMENT,
class AD_ELEMENT>
64 :
public virtual NST_ELEMENT,
82 const double&
ra()
const
99 NST_ELEMENT::further_build();
106 this->father_element_pt());
110 this->
Ra_pt = cast_father_element_pt->ra_pt();
147 for (
unsigned i = 0;
i < n_dim;
i++)
160 NST_ELEMENT::fill_in_contribution_to_jacobian(
residuals, jacobian);
162#ifdef USE_FD_FOR_DERIVATIVES_WRT_EXTERNAL_DATA_IN_MULTI_DOMAIN_BOUSSINESQ
210 for (
unsigned i = 0;
i <
n_dim;
i++)
238 double J = this->dshape_and_dtest_eulerian_at_knot_nst(
305 for (
unsigned i = 0;
i <
n_dim;
i++)
328 global_eqn_number_of_external_element_data[
l2]);
355 return NST_ELEMENT::ndof_types();
374 template<
class AD_ELEMENT,
class NST_ELEMENT>
376 :
public virtual AD_ELEMENT,
417 for (
unsigned i = 0;
i <
n_dim;
i++)
423 outfile << AD_ELEMENT::interpolated_u_adv_diff(
s) << std::endl;
480 AD_ELEMENT::fill_in_contribution_to_jacobian(
residuals, jacobian);
482#ifdef USE_FD_FOR_DERIVATIVES_WRT_EXTERNAL_DATA_IN_MULTI_DOMAIN_BOUSSINESQ
575 const double peclet = this->pe();
584 double J = this->dshape_and_dtest_eulerian_at_knot_adv_diff(
596 for (
unsigned j = 0;
j <
n_dim;
j++)
598 interpolated_dudx[
j] +=
685 global_eqn_number_of_external_element_data[
l2]);
718 for (
unsigned v = 0;
v <
nv;
v++)
762 template<
class AD_ELEMENT,
class NST_ELEMENT>
773 for (std::set<FiniteElement*>::iterator
it =
783 for (
unsigned j = 0;
j <
nnod;
j++)
790 for (
unsigned i = 0;
i <
n_dim;
i++)
814 template<
class NST_ELEMENT,
class AD_ELEMENT>
816 :
public virtual NST_ELEMENT,
837 const double&
ra()
const
870#ifdef USE_FD_JACOBIAN_NST_IN_MULTI_DOMAIN_BOUSSINESQ
879 NST_ELEMENT::fill_in_contribution_to_jacobian(
residuals, jacobian);
910 for (
unsigned i = 0;
i <
n_dim;
i++)
935 double J = this->dshape_and_dtest_eulerian_at_knot_nst(
969 for (
unsigned i = 0;
i <
n_dim;
i++)
981 global_eqn_number_of_external_element_data[
l2]);
1001 template<
class NST_ELEMENT,
class AD_ELEMENT>
1004 const unsigned&
ipt,
1015 ->interpolated_u_adv_diff(
1023 const unsigned n_dim = this->
dim();
1024 for (
unsigned i = 0;
i <
n_dim;
i++)
1032 template<
class NST_ELEMENT,
class AD_ELEMENT>
1045 template<
class NST_ELEMENT,
class AD_ELEMENT>
1048 :
public virtual FaceGeometry<FaceGeometry<NST_ELEMENT>>
1069 template<
class AD_ELEMENT,
class NST_ELEMENT>
1071 :
public virtual AD_ELEMENT,
1107 const unsigned n_dim = this->
dim();
1123 for (
unsigned i = 0;
i <
n_dim;
i++)
1129 outfile << AD_ELEMENT::interpolated_u_adv_diff(
s) << std::endl;
1161 const unsigned&
ipt,
1172#ifdef USE_FD_JACOBIAN_IN_MULTI_DOMAIN_BOUSSINESQ
1181 AD_ELEMENT::fill_in_contribution_to_jacobian(
residuals, jacobian);
1216 const unsigned n_dim = this->
dim();
1229 const double peclet = this->pe();
1238 double J = this->dshape_and_dtest_eulerian_at_knot_adv_diff(
1250 for (
unsigned j = 0;
j <
n_dim;
j++)
1252 interpolated_dudx[
j] +=
1296 global_eqn_number_of_external_element_data[
l2]);
1302 interpolated_dudx[
i2] *
test(
l) * W;
1319 template<
class AD_ELEMENT,
class NST_ELEMENT>
1331 dynamic_cast<NST_ELEMENT*
>(external_element_pt(
interaction,
ipt));
1342 template<
class AD_ELEMENT,
class NST_ELEMENT>
1345 const unsigned&
ipt,
1355 dynamic_cast<NST_ELEMENT*
>(external_element_pt(
interaction,
ipt));
1375 template<
class NST_ELEMENT,
class AD_ELEMENT>
1378 const unsigned&
ipt,
1394 dynamic_cast<AD_ELEMENT*
>(external_element_pt(
interaction,
ipt));
1398 throw OomphLibError(
"External element could not be cast to AD_ELEMENT\n",
1414 const unsigned n_dim = this->
dim();
1418 for (
unsigned i = 0;
i <
n_dim;
i++)
1433 template<
class NST_ELEMENT,
class AD_ELEMENT>
1436 const unsigned&
ipt,
1452 dynamic_cast<AD_ELEMENT*
>(external_element_pt(
interaction,
ipt));
1456 throw OomphLibError(
"External element could not be cast to AD_ELEMENT\n",
1472 const unsigned n_dim = this->
dim();
1476 for (
unsigned i = 0;
i <
n_dim;
i++)
Build AdvectionDiffusionBoussinesqElement that inherits from ElementWithExternalElement so that it ca...
void fill_in_contribution_to_jacobian_and_mass_matrix(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
Add the element's contribution to its residuals vector, jacobian matrix and mass matrix.
AdvectionDiffusionBoussinesqElement()
Constructor: call the underlying constructors.
void get_wind_adv_diff(const unsigned &ipt, const Vector< double > &s, const Vector< double > &x, Vector< double > &wind) const
Overload the wind function in the advection-diffusion equations. This provides the coupling from the ...
void get_dwind_adv_diff_dexternal_element_data(const unsigned &ipt, const unsigned &i, Vector< double > &result, Vector< unsigned > &global_eqn_number)
Fill in the derivatives of the wind with respect to the external unknowns.
void fill_in_off_diagonal_block_analytic(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Compute the contribution of the external degrees of freedom (velocities) on the AdvectionDiffusion eq...
void output(std::ostream &outfile)
Overload the standard output function with the broken default.
void output(FILE *file_pt)
C-style output function: Broken default.
void output(FILE *file_pt, const unsigned &n_plot)
C-style output function: Broken default.
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Compute the element's residual vector and the Jacobian matrix. Jacobian is computed by finite-differe...
void output(std::ostream &outfile, const unsigned &nplot)
Output function: Output x, y, theta at Nplot^DIM plot points.
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 ...
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
This is a base class for all elements that require external sources (e.g. FSI, multi-domain problems ...
Vector< double > & external_element_local_coord(const unsigned &interaction_index, const unsigned &ipt)
Access function to get source element's local coords for specified interaction index at specified int...
void set_ninteraction(const unsigned &n_interaction)
Set the number of interactions in the element This function is usually called in the specific element...
void fill_in_jacobian_from_external_interaction_by_fd(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Calculate the contributions to the jacobian from all external interaction degrees of freedom (geometr...
FiniteElement *& external_element_pt(const unsigned &interaction_index, const unsigned &ipt)
Access function to source element for specified interaction index at specified integration point.
void ignore_external_geometric_data()
Do not include any external geometric data when computing the element's Jacobian. This function shoul...
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Fill in the element's contribution to the Jacobian matrix and the residual vector: Done by finite dif...
FaceGeometry()
Constructor calls the constructor of the NST_ELEMENT (Only the Intel compiler seems to need this!...
FaceGeometry()
Constructor calls the constructor of the NST_ELEMENT (Only the Intel compiler seems to need this!...
FaceGeometry class definition: This policy class is used to allow construction of face elements that ...
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
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(std::ostream &outfile)
Output the element data — typically the values at the nodes in a format suitable for post-processing.
virtual std::string tecplot_zone_string(const unsigned &nplot) const
Return string for tecplot zone header (when plotting nplot points in each "coordinate direction")
double size() const
Calculate the size of the element (length, area, volume,...) in Eulerian computational coordinates....
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...
unsigned nnode() const
Return the number of nodes.
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 unsigned nplot_points(const unsigned &nplot) const
Return total number of plot points (when plotting nplot points in each "coordinate direction")
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
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 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 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....
unsigned long eqn_number(const unsigned &ieqn_local) const
Return the global equation number corresponding to the ieqn_local-th local equation number.
int local_eqn_number(const unsigned long &ieqn_global) const
Return the local equation number corresponding to the ieqn_global-th global equation number....
Class that contains data for hanging nodes.
virtual unsigned nweight() const =0
Return the number of integration points of the scheme.
virtual double weight(const unsigned &i) const =0
Return weight of i-th integration point.
Build NavierStokesBoussinesqElement that inherits from ElementWithExternalElement so that it can "com...
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Compute the element's residual vector and the Jacobian matrix. Jacobian is computed by finite-differe...
double * Ra_pt
Pointer to a private data member, the Rayleigh number.
void get_body_force_nst(const double &time, const unsigned &ipt, const Vector< double > &s, const Vector< double > &x, Vector< double > &result)
Overload get_body_force_nst to get the temperature "body force" from the "source" AdvectionDiffusion ...
void fill_in_off_diagonal_block_analytic(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Compute the contribution of the external degrees of freedom (temperatures) on the Navier-Stokes equat...
double *& ra_pt()
Access function for the pointer to the Rayleigh number.
void fill_in_contribution_to_jacobian_and_mass_matrix(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
Add the element's contribution to its residuals vector, jacobian matrix and mass matrix.
void get_dbody_force_nst_dexternal_element_data(const unsigned &ipt, DenseMatrix< double > &result, Vector< unsigned > &global_eqn_number)
Fill in the derivatives of the body force with respect to the external unknowns.
const double & ra() const
Access function for the Rayleigh number (const version)
NavierStokesBoussinesqElement()
Constructor: call the underlying constructors and initialise the pointer to the Rayleigh number to po...
bool is_hanging() const
Test whether the node is geometrically hanging.
HangInfo *const & hanging_pt() const
Return pointer to hanging node data (this refers to the geometric hanging node status) (const version...
An OomphLibError object which should be thrown when an run-time error is encountered....
Build an AdvectionDiffusionElement that inherits from ElementWithExternalElement so that it can "comm...
void identify_all_field_data_for_external_interaction(Vector< std::set< FiniteElement * > > const &external_elements_pt, std::set< std::pair< Data *, unsigned > > &paired_interaction_data)
Overload the function that must return all field data involved in the interaction with the external (...
void fill_in_contribution_to_jacobian_and_mass_matrix(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
Add the element's contribution to its residuals vector, jacobian matrix and mass matrix.
RefineableAdvectionDiffusionBoussinesqElement()
Constructor: call the underlying constructors.
void get_dwind_adv_diff_dexternal_element_data(const unsigned &ipt, const unsigned &i, Vector< double > &result, Vector< unsigned > &global_eqn_number)
Fill in the derivatives of the wind with respect to the external unknowns.
void output(FILE *file_pt, const unsigned &n_plot)
C-style output function: Broken default.
void get_wind_adv_diff(const unsigned &ipt, const Vector< double > &s, const Vector< double > &x, Vector< double > &wind) const
Overload the wind function in the advection-diffusion equations. This provides the coupling from the ...
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Compute the element's residual vector and the Jacobian matrix.
void output(std::ostream &outfile, const unsigned &nplot)
Output function: Output x, y, theta at Nplot^DIM plot points.
void get_dof_numbers_for_unknowns(std::list< std::pair< unsigned long, unsigned > > &dof_lookup_list) const
Classify dofs for use in block preconditioner.
void fill_in_off_diagonal_block_analytic(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Compute the contribution of the external degrees of freedom (velocities) on the advection-diffusion e...
void output(FILE *file_pt)
C-style output function: Broken default.
unsigned ndof_types() const
Specify number of dof types for use in block preconditioner.
void output(std::ostream &outfile)
Overload the standard output function with the broken default.
Build a refineable Navier Stokes element that inherits from ElementWithExternalElement so that it can...
void fill_in_contribution_to_jacobian_and_mass_matrix(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
Add the element's contribution to its residuals vector, jacobian matrix and mass matrix.
void get_dbody_force_nst_dexternal_element_data(const unsigned &ipt, DenseMatrix< double > &result, Vector< unsigned > &global_eqn_number)
Fill in the derivatives of the body force with respect to the external unknowns.
double * Ra_pt
Pointer to a private data member, the Rayleigh number.
void get_body_force_nst(const double &time, const unsigned &ipt, const Vector< double > &s, const Vector< double > &x, Vector< double > &body_force)
Overload get_body_force_nst() to return the temperature-dependent buoyancy force, using the temperatu...
void further_build()
Call the underlying single-physics element's further_build() functions and make sure that the pointer...
unsigned ndof_types() const
Get number of dof types from underlying element.
const double & ra() const
Access function for the Rayleigh number (const version)
void fill_in_off_diagonal_block_analytic(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Compute the contribution of the external degrees of freedom (temperatures) on the Navier-Stokes equat...
void get_dof_numbers_for_unknowns(std::list< std::pair< unsigned long, unsigned > > &dof_lookup_list) const
Classify dof numbers as in underlying element.
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Compute the element's residual vector and the Jacobian matrix.
double *& ra_pt()
Access function for the pointer to the Rayleigh number.
RefineableNavierStokesBoussinesqElement()
Constructor: call the underlying constructors and initialise the pointer to the Rayleigh number to po...
A Class for shape functions. In simple cases, the shape functions have only one index that can be tho...
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
TAdvectionDiffusionReactionElement()
Constructor: Call constructors for TElement and AdvectionDiffusionReaction equations.
A slight extension to the standard template vector class so that we can include "graceful" array rang...
double Default_Physical_Constant_Value
Default value for physical constants.
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).