30 #ifndef OOMPH_IMPOSE_IMPENETRABLE_ELEMENTS_HEADER 31 #define OOMPH_IMPOSE_IMPENETRABLE_ELEMENTS_HEADER 35 #include <oomph-lib-config.h> 46 template <
class ELEMENT>
98 residuals,jacobian,1);
105 void output(std::ostream &outfile,
const unsigned &nplot)
114 const unsigned &
i)
const 124 const unsigned& flag)
127 unsigned n_node =
nnode();
130 unsigned dim_el=
dim();
148 for(
unsigned i=0;
i<dim_el+1;
i++) {u_index[
i] = el_pt->u_index_nst(
i);}
151 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
171 for(
unsigned j=0;j<n_node;j++)
174 for(
unsigned i=0;
i<dim_el+1;
i++)
188 unsigned first_index=
192 lambda+=nod_pt->
value(first_index) * psi(j);
201 for(
unsigned j=0;j<n_node;j++)
209 unsigned first_index=
218 for(
unsigned i=0;
i<dim_el+1;
i++)
221 residuals[local_eqn]+=
222 interpolated_u[
i] * norm_vec[
i] * psi(j)*
W;
228 for(
unsigned jj=0;jj<n_node;jj++)
233 if (local_unknown>=0)
235 jacobian(local_eqn,local_unknown)+=
236 norm_vec[
i]*psi(jj)*psi(j)*
W;
244 for(
unsigned i=0;
i<dim_el+1;
i++)
254 residuals[local_eqn]+=norm_vec[
i]*psi(j)*lambda*
W;
260 for(
unsigned jj=0;jj<n_node;jj++)
270 index_of_first_value_assigned_by_face_element(Id));
271 if (local_unknown>=0)
273 jacobian(local_eqn,local_unknown)+=
274 norm_vec[
i]*psi(jj)*psi(j)*
W;
301 return (this->
dim() + 1);
311 std::list<std::pair<unsigned long,unsigned> >& dof_lookup_list)
const 315 std::pair<unsigned,unsigned> dof_lookup;
318 const unsigned n_node = this->
nnode();
321 unsigned dim_el = this->
dim();
326 for(
unsigned j=0;j<n_node;j++)
339 dof_lookup.first = this->
eqn_number(local_eqn);
343 dof_lookup_list.push_front(dof_lookup);
362 unsigned const bulk_dim = dim_el + 1;
364 for(
unsigned node_i = 0; node_i < n_node; node_i++)
367 for(
unsigned velocity_i = 0; velocity_i < bulk_dim; velocity_i++)
390 dof_lookup.second = velocity_i;
391 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...
ImposeImpenetrabilityElement are elements that coincide with the faces of higher-dimensional "bulk" e...
void output(std::ostream &outfile)
Overload the output function.
virtual void output(std::ostream &outfile)
Output the element data — typically the values at the nodes in a format suitable for post-processing...
unsigned ndof_types() const
The number of "DOF types" that degrees of freedom in this element are sub-divided into: Just the soli...
int & face_index()
Index of the face (a number that uniquely identifies the face in the element)
void outer_unit_normal(const Vector< double > &s, Vector< double > &unit_normal) const
Compute outer unit normal at the specified local coordinate.
A general Finite Element class.
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Fill in the residuals.
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...
virtual double weight(const unsigned &i) const =0
Return weight of i-th integration point.
unsigned additional_ndof_types() const
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.
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Fill in contribution from Jacobian.
Vector< unsigned > Bulk_node_number
List of indices of the local node numbers in the "bulk" element that correspond to the local node num...
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 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...
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...
void output(std::ostream &outfile, const unsigned &nplot)
Output function: x,y,[z],u,v,[w],p in tecplot format.
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 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 ...
ImposeImpenetrabilityElement(FiniteElement *const &element_pt, const int &face_index, const unsigned &id=0)
Constructor takes a "bulk" element, the index that identifies which face the ImposeImpenetrabilityEle...
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.
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...
unsigned nnode() const
Return the number of 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.
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...