30 #ifndef OOMPH_IMPOSE_PARALL_ELEMENTS_HEADER 31 #define OOMPH_IMPOSE_PARALL_ELEMENTS_HEADER 35 #include <oomph-lib-config.h> 47 template <
class ELEMENT>
79 unsigned dim=element_pt->
dim();
107 residuals,jacobian,1);
114 void output(std::ostream &outfile,
const unsigned &nplot)
123 const unsigned &
i)
const 137 const unsigned& flag)
140 unsigned n_node =
nnode();
143 unsigned dim_el=
dim();
164 for(
unsigned i=0;
i<dim_el+1;
i++) {u_index[
i] = el_pt->u_index_nst(
i);}
167 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
185 for(
unsigned j=0;j<n_node;j++)
188 for(
unsigned i=0;
i<dim_el+1;
i++)
202 unsigned first_index=
206 for(
unsigned l=0;l<dim_el;l++)
208 lambda[l]+=nod_pt->
value(first_index+l) * psi(j);
217 for(
unsigned j=0;j<n_node;j++)
225 unsigned first_index=
229 for(
unsigned l=0;l<dim_el;l++)
237 for(
unsigned i=0;
i<dim_el+1;
i++)
240 residuals[local_eqn]+=
241 interpolated_u[
i] * tang_vec[l][
i] * psi(j)*
W;
247 for(
unsigned jj=0;jj<n_node;jj++)
252 if (local_unknown>=0)
254 jacobian(local_eqn,local_unknown)+=
255 tang_vec[l][
i]*psi(jj)*psi(j)*
W;
264 for(
unsigned i=0;
i<dim_el+1;
i++)
275 residuals[local_eqn]-= (*Pressure_pt)* norm_vec[
i]*psi(j)*
W;
279 for(
unsigned l=0;l<dim_el;l++)
282 residuals[local_eqn]+=tang_vec[l][
i]*psi(j)*lambda[l]*
W;
288 for(
unsigned jj=0;jj<n_node;jj++)
298 index_of_first_value_assigned_by_face_element(Id)+l);
299 if (local_unknown>=0)
301 jacobian(local_eqn,local_unknown)+=
302 tang_vec[l][
i]*psi(jj)*psi(j)*
W;
325 return 2 * (this->
dim()) + 1;
345 std::list<std::pair<unsigned long,unsigned> >& dof_lookup_list)
const 349 std::pair<unsigned,unsigned> dof_lookup;
352 const unsigned n_node = this->
nnode();
355 const unsigned dim_el = this->
dim();
359 const unsigned dim_bulk = dim_el + 1;
369 for(
unsigned node_i =0; node_i < n_node; node_i++)
378 for(
unsigned velocity_i = 0; velocity_i < dim_bulk; velocity_i++)
399 dof_lookup.second = velocity_i;
400 dof_lookup_list.push_front(dof_lookup);
410 for(
unsigned dim_i=0;dim_i<dim_el;dim_i++)
429 dof_lookup.first = this->
eqn_number(local_eqn);
430 dof_lookup.second = dim_i + dim_bulk;
433 dof_lookup_list.push_front(dof_lookup);
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...
unsigned ndof_types() const
The number of degrees of freedom types that this element is divided into: The ImposeParallelOutflowEl...
virtual void output(std::ostream &outfile)
Output the element data — typically the values at the nodes in a format suitable for post-processing...
double * Pressure_pt
pointer to imposed pressure – if null then no pressure imposed.
int & face_index()
Index of the face (a number that uniquely identifies the face in the element)
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.
Nodes are derived from Data, but, in addition, have a definite (Eulerian) position in a space of a gi...
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...
virtual double weight(const unsigned &i) const =0
Return weight of i-th integration point.
void add_additional_values(const Vector< unsigned > &nadditional_values, const unsigned &id)
Helper function adding additional values for the unknowns associated with the FaceElement. This function also sets the map containing the position of the first entry of this face element's additional values.The inputs are the number of additional values and the face element's ID. Note the same number of additonal values are allocated at ALL nodes.
ImposeParallelOutflowElement are elements that coincide with the faces of higher-dimensional "bulk" e...
Vector< unsigned > Bulk_node_number
List of indices of the local node numbers in the "bulk" element that correspond to the local node num...
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...
A class that contains the information required by Nodes that are located on Mesh boundaries. A BoundaryNode of a particular type is obtained by combining a given Node with this class. By differentiating between Nodes and BoundaryNodes we avoid a lot of un-necessary storage in the bulk Nodes.
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.
void output(std::ostream &outfile)
Overload the output function.
FaceElement()
Constructor: Initialise all appropriate member data.
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
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...
FiniteElement * Bulk_element_pt
Pointer to the associated higher-dimensional "bulk" element.
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...
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...
double *& pressure_pt()
Access function for the pressure.
unsigned dim() const
Return the spatial dimension of the element, i.e. the number of local coordinates required to paramet...
virtual unsigned nweight() const =0
Return the number of integration points of the scheme.
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...
FiniteElement *& bulk_element_pt()
Pointer to higher-dimensional "bulk" element.
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 fill_in_contribution_to_residuals(Vector< double > &residuals)
Fill in the residuals.
void output(std::ostream &outfile, const unsigned &nplot)
Output function: x,y,[z],u,v,[w],p in tecplot format.
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 ...
unsigned nnode() const
Return the number of nodes.
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Fill in contribution from Jacobian.
double value(const unsigned &i) const
Return i-th value (dofs or pinned) at this node either directly or via hanging node representation...
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...