28 #ifndef OOMPH_WAVE_FLUX_ELEMENTS_HEADER
29 #define OOMPH_WAVE_FLUX_ELEMENTS_HEADER
32 #include <oomph-lib-config.h>
36 #include "../generic/Qelements.h"
50 template<
class ELEMENT>
71 "Don't call empty constructor for LinearWaveFluxElement",
106 residuals, jacobian, 1);
116 const unsigned&
i)
const
130 void output(std::ostream& outfile,
const unsigned& n_plot)
145 void output(FILE* file_pt,
const unsigned& n_plot)
160 unsigned n_node =
nnode();
166 for (
unsigned i = 0;
i < n_node;
i++)
188 (*Flux_fct_pt)(time,
x,
flux);
219 template<
class ELEMENT>
232 ELEMENT* elem_pt =
dynamic_cast<ELEMENT*
>(bulk_el_pt);
235 if (elem_pt->dim() == 3)
244 throw OomphLibError(
"This flux element will not work correctly if "
245 "nodes are hanging\n",
281 "Bulk element must inherit from LinearWaveEquations.";
283 "Nodes are one dimensional, but cannot cast the bulk element to\n";
284 error_string +=
"LinearWaveEquations<1>\n.";
285 error_string +=
"If you desire this functionality, you must "
286 "implement it yourself\n";
309 "Bulk element must inherit from LinearWaveEquations.";
311 "Nodes are two dimensional, but cannot cast the bulk element to\n";
312 error_string +=
"LinearWaveEquations<2>\n.";
313 error_string +=
"If you desire this functionality, you must "
314 "implement it yourself\n";
336 "Bulk element must inherit from LinearWaveEquations.";
337 error_string +=
"Nodes are three dimensional, but cannot cast the "
339 error_string +=
"LinearWaveEquations<3>\n.";
340 error_string +=
"If you desire this functionality, you must "
341 "implement it yourself\n";
356 std::ostringstream error_stream;
357 error_stream <<
"Dimension of node is " <<
Dim
358 <<
". It should be 1,2, or 3!" << std::endl;
370 template<
class ELEMENT>
376 const unsigned n_node = nnode();
379 double time = node_pt(0)->time_stepper_pt()->time_pt()->time();
382 Shape psif(n_node), testf(n_node);
385 const unsigned n_intpt = integral_pt()->nweight();
394 const unsigned u_index_lin_wave = U_index_lin_wave;
398 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
401 for (
unsigned i = 0;
i < (
Dim - 1);
i++)
403 s[
i] = integral_pt()->knot(ipt,
i);
407 double w = integral_pt()->weight(ipt);
411 double J = shape_and_test(
s, psif, testf);
420 for (
unsigned i = 0;
i <
Dim;
i++)
422 interpolated_x[
i] = 0.0;
426 for (
unsigned l = 0; l < n_node; l++)
429 for (
unsigned i = 0;
i <
Dim;
i++)
431 interpolated_x[
i] += nodal_position(l,
i) * psif[l];
442 for (
unsigned l = 0; l < n_node; l++)
444 local_eqn = nodal_local_eqn(l, u_index_lin_wave);
449 residuals[local_eqn] -=
flux * testf[l] *
W;
int i
Definition: BiCGSTAB_step_by_step.cpp:9
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
JacobiRotation< float > J
Definition: Jacobi_makeJacobi.cpp:3
RowVector3d w
Definition: Matrix_resize_int.cpp:3
Definition: elements.h:4338
int & face_index()
Definition: elements.h:4626
double zeta_nodal(const unsigned &n, const unsigned &k, const unsigned &i) const
Definition: elements.h:4497
double J_eulerian(const Vector< double > &s) const
Definition: elements.cc:5242
Definition: elements.h:4998
Definition: elements.h:1313
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
Definition: elements.h:2175
virtual void output(std::ostream &outfile)
Definition: elements.h:3050
virtual void build_face_element(const int &face_index, FaceElement *face_element_pt)
Definition: elements.cc:5132
virtual void shape(const Vector< double > &s, Shape &psi) const =0
unsigned nnode() const
Return the number of nodes.
Definition: elements.h:2210
bool has_hanging_nodes() const
Definition: elements.h:2470
static DenseMatrix< double > Dummy_matrix
Definition: elements.h:227
Definition: linear_wave_elements.h:53
virtual unsigned u_index_lin_wave() const
Definition: linear_wave_elements.h:77
Definition: linear_wave_flux_elements.h:53
LinearWavePrescribedFluxFctPt & flux_fct_pt()
Access function for the prescribed-flux function pointer.
Definition: linear_wave_flux_elements.h:84
void output(FILE *file_pt, const unsigned &n_plot)
Definition: linear_wave_flux_elements.h:145
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Compute the element residual vector.
Definition: linear_wave_flux_elements.h:91
void(* LinearWavePrescribedFluxFctPt)(const double &time, const Vector< double > &x, double &flux)
Definition: linear_wave_flux_elements.h:57
unsigned U_index_lin_wave
The index at which the unknown is stored at the nodes.
Definition: linear_wave_flux_elements.h:206
LinearWaveFluxElement(const LinearWaveFluxElement &dummy)=delete
Broken copy constructor.
double zeta_nodal(const unsigned &n, const unsigned &k, const unsigned &i) const
Definition: linear_wave_flux_elements.h:114
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Compute the element's residual vector and its Jacobian matrix.
Definition: linear_wave_flux_elements.h:101
unsigned Dim
The spatial dimension of the problem.
Definition: linear_wave_flux_elements.h:203
void output(FILE *file_pt)
Definition: linear_wave_flux_elements.h:138
void operator=(const LinearWaveFluxElement &)=delete
Broken assignment operator.
LinearWavePrescribedFluxFctPt Flux_fct_pt
Function pointer to the (global) prescribed-flux function.
Definition: linear_wave_flux_elements.h:200
void get_flux(const double &time, const Vector< double > &x, double &flux)
Definition: linear_wave_flux_elements.h:178
LinearWaveFluxElement()
Broken empty constructor.
Definition: linear_wave_flux_elements.h:68
void fill_in_generic_residual_contribution_lin_wave_flux(Vector< double > &residuals, DenseMatrix< double > &jacobian, unsigned flag)
Compute the element's residual vector and the (zero) Jacobian matrix.
Definition: linear_wave_flux_elements.h:372
void output(std::ostream &outfile)
Definition: linear_wave_flux_elements.h:123
void output(std::ostream &outfile, const unsigned &n_plot)
Definition: linear_wave_flux_elements.h:130
double shape_and_test(const Vector< double > &s, Shape &psi, Shape &test) const
Definition: linear_wave_flux_elements.h:155
unsigned ndim() const
Return (Eulerian) spatial dimension of the node.
Definition: nodes.h:1054
Definition: oomph_definitions.h:222
Definition: refineable_elements.h:97
RealScalar s
Definition: level1_cplx_impl.h:130
char char char int int * k
Definition: level2_impl.h:374
static const unsigned Dim
Problem dimension.
Definition: two_d_tilted_square.cc:62
void flux(const double &time, const Vector< double > &x, double &flux)
Get flux applied along boundary x=0.
Definition: pretend_melt.cc:59
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286
@ W
Definition: quadtree.h:63
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
Definition: AnisotropicHookean.h:10
void get_flux(const Vector< double > &s, Vector< double > &flux) const
Get flux: .
Definition: gen_axisym_advection_diffusion_elements.h:424
list x
Definition: plotDoE.py:28
Definition: indexed_view.cpp:20
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86