26 #ifndef OOMPH_IMPOSE_PARALL_ELEMENTS_HEADER
27 #define OOMPH_IMPOSE_PARALL_ELEMENTS_HEADER
31 #include <oomph-lib-config.h>
43 template<
class ELEMENT>
62 const unsigned&
id = 0)
72 unsigned dim = element_pt->
dim();
100 residuals, jacobian, 1);
110 void output(std::ostream& outfile,
const unsigned& nplot)
122 const unsigned&
i)
const
140 const unsigned& flag)
143 unsigned n_node =
nnode();
146 unsigned dim_el =
dim();
156 int local_unknown = 0;
167 for (
unsigned i = 0;
i < dim_el + 1;
i++)
169 u_index[
i] = el_pt->u_index_nst(
i);
173 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
191 for (
unsigned j = 0; j < n_node; j++)
194 for (
unsigned i = 0;
i < dim_el + 1;
i++)
208 unsigned first_index =
212 for (
unsigned l = 0; l < dim_el; l++)
214 lambda[l] += nod_pt->
value(first_index + l) * psi(j);
223 for (
unsigned j = 0; j < n_node; j++)
231 unsigned first_index =
235 for (
unsigned l = 0; l < dim_el; l++)
243 for (
unsigned i = 0;
i < dim_el + 1;
i++)
246 residuals[local_eqn] +=
247 interpolated_u[
i] * tang_vec[l][
i] * psi(j) *
W;
253 for (
unsigned jj = 0; jj < n_node; jj++)
258 if (local_unknown >= 0)
260 jacobian(local_eqn, local_unknown) +=
261 tang_vec[l][
i] * psi(jj) * psi(j) *
W;
270 for (
unsigned i = 0;
i < dim_el + 1;
i++)
281 residuals[local_eqn] -=
282 (*Pressure_pt) * norm_vec[
i] * psi(j) *
W;
286 for (
unsigned l = 0; l < dim_el; l++)
289 residuals[local_eqn] += tang_vec[l][
i] * psi(j) * lambda[l] *
W;
295 for (
unsigned jj = 0; jj < n_node; jj++)
308 if (local_unknown >= 0)
310 jacobian(local_eqn, local_unknown) +=
311 tang_vec[l][
i] * psi(jj) * psi(j) *
W;
334 return 2 * (this->
dim()) + 1;
354 std::list<std::pair<unsigned long, unsigned>>& dof_lookup_list)
const
357 std::pair<unsigned, unsigned> dof_lookup;
360 const unsigned n_node = this->
nnode();
363 const unsigned dim_el = this->
dim();
367 const unsigned dim_bulk = dim_el + 1;
377 for (
unsigned node_i = 0; node_i < n_node; node_i++)
385 for (
unsigned velocity_i = 0; velocity_i < dim_bulk; velocity_i++)
405 dof_lookup.second = velocity_i;
406 dof_lookup_list.push_front(dof_lookup);
416 for (
unsigned dim_i = 0; dim_i < dim_el; dim_i++)
434 dof_lookup.first = this->
eqn_number(local_eqn);
435 dof_lookup.second = dim_i + dim_bulk;
438 dof_lookup_list.push_front(dof_lookup);
A class that contains the information required by Nodes that are located on Mesh boundaries....
unsigned index_of_first_value_assigned_by_face_element(const unsigned &face_id=0) const
Return the index of the first value associated with the i-th face element value. If no argument is sp...
FaceElements are elements that coincide with the faces of higher-dimensional "bulk" elements....
Vector< unsigned > Bulk_node_number
List of indices of the local node numbers in the "bulk" element that correspond to the local node num...
FiniteElement * Bulk_element_pt
Pointer to the associated higher-dimensional "bulk" element.
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,...
void add_additional_values(const Vector< unsigned > &nadditional_values, const unsigned &id)
Helper function adding additional values for the unknowns associated with the FaceElement....
FiniteElement *& bulk_element_pt()
Pointer to higher-dimensional "bulk" element.
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...
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....
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
A general Finite Element class.
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(std::ostream &outfile)
Output the element data — typically the values at the nodes in a format suitable for post-processing.
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.
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
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 shape_at_knot(const unsigned &ipt, Shape &psi) const
Return the geometric shape function at the ipt-th integration point.
unsigned long eqn_number(const unsigned &ieqn_local) const
Return the global equation number corresponding to the ieqn_local-th local equation number.
static DenseMatrix< double > Dummy_matrix
Empty dense matrix used as a dummy argument to combined residual and jacobian functions in the case w...
ImposeParallelOutflowElement are elements that coincide with the faces of higher-dimensional "bulk" e...
void fill_in_generic_contribution_to_residuals_parall_lagr_multiplier(Vector< double > &residuals, DenseMatrix< double > &jacobian, const unsigned &flag)
Helper function to compute the residuals and, if flag==1, the Jacobian.
unsigned ndof_types() const
The number of degrees of freedom types that this element is divided into: The ImposeParallelOutflowEl...
void get_dof_numbers_for_unknowns(std::list< std::pair< unsigned long, unsigned >> &dof_lookup_list) const
Create a list of pairs for all unknowns in this element, so that the first entry in each pair contain...
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Fill in the residuals.
double * Pressure_pt
pointer to imposed pressure – if null then no pressure imposed.
void output(std::ostream &outfile, const unsigned &nplot)
Output function: x,y,[z],u,v,[w],p in tecplot format.
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Fill in contribution from Jacobian.
double *& pressure_pt()
Access function for the pressure.
void output(std::ostream &outfile)
Overload the output function.
ImposeParallelOutflowElement(FiniteElement *const &element_pt, const int &face_index, const unsigned &id=0)
Constructor takes a "bulk" element, the index that identifies which face the ImposeParallelOutflowEle...
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 ...
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.
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
double value(const unsigned &i) const
Return i-th value (dofs or pinned) at this node either directly or via hanging node representation....
A Class for shape functions. In simple cases, the shape functions have only one index that can be tho...
//////////////////////////////////////////////////////////////////// ////////////////////////////////...