30 #ifndef OOMPH_UNSTEADY_HEAT_FLUX_ELEMENTS_HEADER
31 #define OOMPH_UNSTEADY_HEAT_FLUX_ELEMENTS_HEADER
35 #include <oomph-lib-config.h>
42 #include "../generic/Qelements.h"
53 template<
class ELEMENT>
103 residuals, jacobian, 1);
114 const unsigned&
i)
const
128 void output(std::ostream& outfile,
const unsigned& n_plot)
143 void output(FILE* file_pt,
const unsigned& n_plot)
157 unsigned n_node =
nnode();
163 for (
unsigned i = 0;
i < n_node;
i++)
184 (*Flux_fct_pt)(time, x, flux);
214 template<
class ELEMENT>
227 ELEMENT* elem_pt =
dynamic_cast<ELEMENT*
>(bulk_el_pt);
230 if (elem_pt->dim() == 3)
239 throw OomphLibError(
"This flux element will not work correctly if "
240 "nodes are hanging\n",
241 OOMPH_CURRENT_FUNCTION,
242 OOMPH_EXCEPTION_LOCATION);
276 "Bulk element must inherit from UnsteadyHeatEquations.";
278 "Nodes are one dimensional, but cannot cast the bulk element to\n";
279 error_string +=
"UnsteadyHeatEquations<1>\n.";
280 error_string +=
"If you desire this functionality, you must "
281 "implement it yourself\n";
284 error_string, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
304 "Bulk element must inherit from UnsteadyHeatEquations.";
306 "Nodes are two dimensional, but cannot cast the bulk element to\n";
307 error_string +=
"UnsteadyHeatEquations<2>\n.";
308 error_string +=
"If you desire this functionality, you must "
309 "implement it yourself\n";
312 error_string, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
331 "Bulk element must inherit from UnsteadyHeatEquations.";
332 error_string +=
"Nodes are three dimensional, but cannot cast the "
334 error_string +=
"UnsteadyHeatEquations<3>\n.";
335 error_string +=
"If you desire this functionality, you must "
336 "implement it yourself\n";
339 error_string, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
351 std::ostringstream error_stream;
352 error_stream <<
"Dimension of node is " <<
Dim
353 <<
". It should be 1,2, or 3!" << std::endl;
356 error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
365 template<
class ELEMENT>
371 const unsigned n_node = nnode();
374 double time = node_pt(0)->time_stepper_pt()->time_pt()->time();
377 Shape psif(n_node), testf(n_node);
380 const unsigned n_intpt = integral_pt()->nweight();
389 const unsigned u_index_ust_heat = U_index_ust_heat;
393 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
396 for (
unsigned i = 0;
i < (
Dim - 1);
i++)
398 s[
i] = integral_pt()->knot(ipt,
i);
402 double w = integral_pt()->weight(ipt);
406 double J = shape_and_test(
s, psif, testf);
415 for (
unsigned i = 0;
i <
Dim;
i++)
417 interpolated_x[
i] = 0.0;
421 for (
unsigned l = 0; l < n_node; l++)
424 for (
unsigned i = 0;
i <
Dim;
i++)
426 interpolated_x[
i] += nodal_position(l,
i) * psif[l];
432 get_flux(time, interpolated_x, flux);
437 for (
unsigned l = 0; l < n_node; l++)
439 local_eqn = nodal_local_eqn(l, u_index_ust_heat);
444 residuals[local_eqn] -= flux * testf[l] *
W;
FaceElements are elements that coincide with the faces of higher-dimensional "bulk" elements....
int & face_index()
Index of the face (a number that uniquely identifies the face in the element)
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,...
double J_eulerian(const Vector< double > &s) const
Return the Jacobian of mapping from local to global coordinates at local position s....
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
A general Finite Element class.
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
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...
unsigned nnode() const
Return the number of nodes.
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....
bool has_hanging_nodes() const
Return boolean to indicate if any of the element's nodes are geometrically hanging.
static DenseMatrix< double > Dummy_matrix
Empty dense matrix used as a dummy argument to combined residual and jacobian functions in the case w...
unsigned ndim() const
Return (Eulerian) spatial dimension of the node.
An OomphLibError object which should be thrown when an run-time error is encountered....
RefineableElements are FiniteElements that may be subdivided into children to provide a better local ...
A Class for shape functions. In simple cases, the shape functions have only one index that can be tho...
A class for all isoparametric elements that solve the UnsteadyHeat equations.
virtual unsigned u_index_ust_heat() const
Broken assignment operator.
A class for elements that allow the imposition of an applied flux on the boundaries of UnsteadyHeat e...
double shape_and_test(const Vector< double > &s, Shape &psi, Shape &test) const
Function to compute the shape and test functions and to return the Jacobian of mapping between local ...
unsigned Dim
The spatial dimension of the problem.
void get_flux(const double &time, const Vector< double > &x, double &flux)
Function to calculate the prescribed flux at a given spatial position and at a gien time.
UnsteadyHeatPrescribedFluxFctPt Flux_fct_pt
Function pointer to the (global) prescribed-flux function.
double zeta_nodal(const unsigned &n, const unsigned &k, const unsigned &i) const
Specify the value of nodal zeta from the face geometry: The "global" intrinsic coordinate of the elem...
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Compute the element residual vector.
UnsteadyHeatPrescribedFluxFctPt & flux_fct_pt()
Broken assignment operator.
void output(FILE *file_pt)
C-style output function – forward to broken version in FiniteElement until somebody decides what exac...
UnsteadyHeatFluxElement(FiniteElement *const &bulk_el_pt, const int &face_index)
Constructor, takes the pointer to the "bulk" element and the index of the face to be created.
unsigned U_index_ust_heat
The index at which the unknown is stored at the nodes.
void output(FILE *file_pt, const unsigned &n_plot)
C-style output function – forward to broken version in FiniteElement until somebody decides what exac...
void(* UnsteadyHeatPrescribedFluxFctPt)(const double &time, const Vector< double > &x, double &flux)
Function pointer to the prescribed-flux function fct(x,f(x)) – x is a Vector!
UnsteadyHeatFluxElement(const UnsteadyHeatFluxElement &dummy)=delete
Broken copy constructor.
void output(std::ostream &outfile)
Output function – forward to broken version in FiniteElement until somebody decides what exactly they...
void fill_in_generic_residual_contribution_ust_heat_flux(Vector< double > &residuals, DenseMatrix< double > &jacobian, unsigned flag)
Compute the element residual vector. flag=1(or 0): do (or don't) compute the Jacobian as well.
void output(std::ostream &outfile, const unsigned &n_plot)
Output function – forward to broken version in FiniteElement until somebody decides what exactly they...
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Compute the element's residual vector and its Jacobian matrix.
void output()
Doc the command line arguments.
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.
unsigned Dim
Dimension of zeta tuples (set by get_dim_helper) – needed because we store the scalar coordinates in ...
//////////////////////////////////////////////////////////////////// ////////////////////////////////...