34 #ifndef OOMPH_UNSTEADY_HEAT_FLUX_ELEMENTS_HEADER 35 #define OOMPH_UNSTEADY_HEAT_FLUX_ELEMENTS_HEADER 39 #include <oomph-lib-config.h> 46 #include "../generic/Qelements.h" 58 template <
class ELEMENT>
121 const unsigned &
i)
const 130 void output(std::ostream &outfile,
const unsigned &n_plot)
140 void output(FILE* file_pt,
const unsigned &n_plot)
152 unsigned n_node =
nnode();
158 for(
unsigned i=0;
i<n_node;
i++) {test[
i] = psi[
i];}
176 (*Flux_fct_pt)(time,x,flux);
211 template<
class ELEMENT>
226 ELEMENT* elem_pt =
dynamic_cast<ELEMENT*
>(bulk_el_pt);
229 if(elem_pt->dim()==3)
238 "This flux element will not work correctly if nodes are hanging\n",
239 OOMPH_CURRENT_FUNCTION,
240 OOMPH_EXCEPTION_LOCATION);
274 "Bulk element must inherit from UnsteadyHeatEquations.";
276 "Nodes are one dimensional, but cannot cast the bulk element to\n";
277 error_string +=
"UnsteadyHeatEquations<1>\n.";
279 "If you desire this functionality, you must implement it yourself\n";
282 OOMPH_CURRENT_FUNCTION,
283 OOMPH_EXCEPTION_LOCATION);
303 "Bulk element must inherit from UnsteadyHeatEquations.";
305 "Nodes are two dimensional, but cannot cast the bulk element to\n";
306 error_string +=
"UnsteadyHeatEquations<2>\n.";
308 "If you desire this functionality, you must implement it yourself\n";
311 OOMPH_CURRENT_FUNCTION,
312 OOMPH_EXCEPTION_LOCATION);
331 "Bulk element must inherit from UnsteadyHeatEquations.";
333 "Nodes are three dimensional, but cannot cast the bulk element to\n";
334 error_string +=
"UnsteadyHeatEquations<3>\n.";
336 "If you desire this functionality, you must implement it yourself\n";
339 OOMPH_CURRENT_FUNCTION,
340 OOMPH_EXCEPTION_LOCATION);
353 std::ostringstream error_stream;
354 error_stream <<
"Dimension of node is " <<
Dim 355 <<
". It should be 1,2, or 3!" << std::endl;
358 OOMPH_CURRENT_FUNCTION,
359 OOMPH_EXCEPTION_LOCATION);
370 template<
class ELEMENT>
377 const unsigned n_node =
nnode();
383 Shape psif(n_node), testf(n_node);
399 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
403 for(
unsigned i=0;
i<(
Dim-1);
i++)
422 for(
unsigned i=0;
i<
Dim;
i++)
424 interpolated_x[
i] = 0.0;
428 for(
unsigned l=0;l<n_node;l++)
431 for(
unsigned i=0;
i<
Dim;
i++)
444 for(
unsigned l=0;l<n_node;l++)
451 residuals[local_eqn] -= flux*testf[l]*
W;
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Compute the element residual vector.
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...
bool has_hanging_nodes() const
Return boolean to indicate if any of the element's nodes are geometrically hanging.
void broken_copy(const std::string &class_name)
Issue error message and terminate execution.
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 get_flux(const double &time, const Vector< double > &x, double &flux)
virtual unsigned u_index_ust_heat() const
Broken assignment operator.
unsigned Dim
The spatial dimension of the problem.
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 ...
unsigned U_index_ust_heat
The index at which the unknown is stored at the nodes.
void output(std::ostream &outfile, const unsigned &n_plot)
Output function – forward to broken version in FiniteElement until somebody decides what exactly the...
int & face_index()
Index of the face (a number that uniquely identifies the face in the element)
void output(FILE *file_pt)
UnsteadyHeatPrescribedFluxFctPt Flux_fct_pt
Function pointer to the (global) prescribed-flux function.
A general Finite Element class.
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, when viewed as part of a compound geometric object is specified using the boundary coordinate defined by the mesh. Note: Boundary coordinates will have been set up when creating the underlying mesh, and their values will have been stored at the nodes.
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...
UnsteadyHeatFluxElement(const UnsteadyHeatFluxElement &dummy)
Broken copy constructor.
virtual double weight(const unsigned &i) const =0
Return weight of i-th integration point.
void output(FILE *file_pt, const unsigned &n_plot)
C-style output function – forward to broken version in FiniteElement until somebody decides what exa...
double J_eulerian(const Vector< double > &s) const
Return the Jacobian of mapping from local to global coordinates at local position s...
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 ndim() const
Return (Eulerian) spatial dimension of the node.
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
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 ...
virtual double knot(const unsigned &i, const unsigned &j) const =0
Return local coordinate s[j] of i-th integration point.
void output(std::ostream &outfile)
double & time()
Return the current value of the continuous time.
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
void output(std::ostream &outfile)
Output with default number of plot points.
A class for elements that allow the imposition of an applied flux on the boundaries of UnsteadyHeat e...
virtual unsigned nweight() const =0
Return the number of integration points of the scheme.
Time *const & time_pt() const
Access function for the pointer to time (const version)
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.
UnsteadyHeatPrescribedFluxFctPt & flux_fct_pt()
Broken assignment operator.
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...
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!
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Compute the element's residual vector and its Jacobian matrix.
unsigned nnode() const
Return the number of nodes.
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...
static DenseMatrix< double > Dummy_matrix
Empty dense matrix used as a dummy argument to combined residual and jacobian functions in the case w...
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...