28#include <oomph-lib-config.h>
41 template<
unsigned DIM>
43 const unsigned& b, DirichletBCFctPt
u_fn, DirichletBCFctPt
dudn_fn)
46 unsigned n_node = Bulk_element_mesh_pt->nboundary_node(b);
49 int face_index = Bulk_element_mesh_pt->face_index_at_boundary(b, 0);
66 throw OomphLibError(
"Face Index not +/-1 or +/-2: Need 2D QElements",
91 const double h = 10
e-8;
104 Bulk_element_mesh_pt->boundary_node_pt(b,
n)
105 ->get_coordinates_on_boundary(b,
m);
119 (*u_fn)(
m[0] + h,
u_R);
124 (*u_fn)(
m[0] - h,
u_L);
130 (*u_fn)(
m[0] - 0.5 * h,
u_L);
131 (*u_fn)(
m[0] + 0.5 * h,
u_R);
141 Bulk_element_mesh_pt->boundary_node_pt(b,
n)->pin(0);
142 Bulk_element_mesh_pt->boundary_node_pt(b,
n)->set_value(0, u);
145 Bulk_element_mesh_pt->boundary_node_pt(b,
n)->pin(2 -
s_fixed_index);
146 Bulk_element_mesh_pt->boundary_node_pt(b,
n)->set_value(
160 dxds_n[0] = Bulk_element_mesh_pt->boundary_node_pt(b,
n)->x_gen(
162 dxds_n[1] = Bulk_element_mesh_pt->boundary_node_pt(b,
n)->x_gen(
164 dxds_t[0] = Bulk_element_mesh_pt->boundary_node_pt(b,
n)->x_gen(
166 dxds_t[1] = Bulk_element_mesh_pt->boundary_node_pt(b,
n)->x_gen(
172 Bulk_element_mesh_pt->boundary_node_pt(b,
n)->x_gen(3, 0);
174 Bulk_element_mesh_pt->boundary_node_pt(b,
n)->x_gen(3, 1);
208 Bulk_element_mesh_pt->boundary_node_pt(b,
n)
209 ->get_coordinates_on_boundary(b,
m_N);
235 u_N = Bulk_element_mesh_pt->boundary_node_pt(b,
n)->value(0);
252 double duds_t = Bulk_element_mesh_pt->boundary_node_pt(b,
n)->value(
277 Bulk_element_mesh_pt->boundary_node_pt(b,
n)->pin(1 +
s_fixed_index);
278 Bulk_element_mesh_pt->boundary_node_pt(b,
n)->set_value(
282 Bulk_element_mesh_pt->boundary_node_pt(b,
n)->pin(3);
283 Bulk_element_mesh_pt->boundary_node_pt(b,
n)->set_value(3,
d2uds_nds_t);
293 template<
unsigned DIM>
300 if (Face_element_mesh_pt == 0)
302 Face_element_mesh_pt =
new Mesh();
306 unsigned n_element = Bulk_element_mesh_pt->nboundary_element(b);
313 Bulk_element_mesh_pt->boundary_element_pt(b,
e));
316 int face_index = Bulk_element_mesh_pt->face_index_at_boundary(b,
e);
325 if (flux1_fct_pt != 0)
340 template<
unsigned DIM>
456 template<
unsigned DIM>
458 const unsigned& b,
const double&
psi)
461 unsigned n_node = mesh_pt()->nboundary_node(b);
467 for (
unsigned k = 1;
k < 4;
k++)
470 mesh_pt()->boundary_node_pt(b,
n)->pin(
k);
471 mesh_pt()->boundary_node_pt(b,
n)->set_value(
k, 0.0);
473 mesh_pt()->boundary_node_pt(b,
n)->pin(0);
474 mesh_pt()->boundary_node_pt(b,
n)->set_value(0,
psi);
488 template<
unsigned DIM>
492 int face_index = mesh_pt()->face_index_at_boundary(b, 0);
509 throw OomphLibError(
"Face Index not +/-1 or +/-2: Need 2D QElements",
522 unsigned n_node = mesh_pt()->nboundary_node(b);
548 mesh_pt()->boundary_node_pt(b,
n)->set_value(1 +
s_fixed_index, 0.0);
562 mesh_pt()->boundary_element_pt(b,
n - 1));
570 mesh_pt()->boundary_element_pt(b,
n));
582 mesh_pt()->boundary_element_pt(b,
n - 1));
590 mesh_pt()->boundary_element_pt(b,
n));
603 mesh_pt()->boundary_element_pt(b,
n - 1));
611 mesh_pt()->boundary_element_pt(b,
n));
623 mesh_pt()->boundary_element_pt(b,
n - 1));
631 mesh_pt()->boundary_element_pt(b,
n));
657 template<
unsigned DIM>
662 unsigned n_node = mesh_pt()->nboundary_node(b);
665 int face_index = mesh_pt()->face_index_at_boundary(b, 0);
695 throw OomphLibError(
"Face Index not +/-1 or +/-2: Need 2D QElements",
706 const double h = 10
e-8;
713 mesh_pt()->boundary_node_pt(b,
n)->get_coordinates_on_boundary(b,
m_N);
729 d2xds_nds_t[0] = mesh_pt()->boundary_node_pt(b,
n)->x_gen(3, 0);
730 d2xds_nds_t[1] = mesh_pt()->boundary_node_pt(b,
n)->x_gen(3, 1);
751 (*u_imposed_fn)(
m_N[0], u);
763 (*u_imposed_fn)(
m_N[0],
u_L);
764 (*u_imposed_fn)(
m_N[0] + h,
u_R);
768 (*u_imposed_fn)(
m_N[0] - h,
u_L);
769 (*u_imposed_fn)(
m_N[0],
u_R);
773 (*u_imposed_fn)(
m_N[0] - 0.5 * h,
u_L);
774 (*u_imposed_fn)(
m_N[0] + 0.5 * h,
u_R);
799 mesh_pt()->boundary_node_pt(b,
n)->pin(3);
800 mesh_pt()->boundary_node_pt(b,
n)->set_value(3,
d2uds_nds_t);
809 template<
unsigned DIM>
831 unsigned n_element = mesh_pt()->nelement();
832 for (
unsigned i = 0;
i <
n_element - Npoint_element;
i++)
void compute_error(std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
Get error against and norm of exact solution.
Point equation element used to impose the traction free edge (i.e. du/dn = 0) on the boundary when dt...
virtual void fill_in_generic_residual_contribution_biharmonic_boundary(Vector< double > &residuals, DenseMatrix< double > &jacobian, unsigned JFLAG)
Computes the elemental residual vector and the elemental jacobian matrix if JFLAG = 0 Imposes the equ...
void doc_solution(DocInfo &doc_info, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt=0)
documents the solution, and if an exact solution is provided, then the error between the numerical an...
void impose_fluid_flow_on_edge(const unsigned &b, FluidBCFctPt u_imposed_fn)
Impose a prescribed fluid flow comprising the velocity normal to the boundary (u_imposed_fn[0]) and t...
void impose_solid_boundary_on_edge(const unsigned &b, const double &psi=0)
Imposes a solid boundary on boundary b - no flow into boundary or along boundary v_n = 0 and v_t = 0....
void impose_traction_free_edge(const unsigned &b)
Impose a traction free edge - i.e. v_t = 0 or dpsi/dn = 0. In general dpsi/dn = 0 can only be imposed...
void set_neumann_boundary_condition(const unsigned &b, BiharmonicFluxElement< 2 >::FluxFctPt flux0_fct_pt, BiharmonicFluxElement< 2 >::FluxFctPt flux1_fct_pt=0)
Imposes the prescribed Neumann BCs laplacian(u) (flux0_fct_pt) and dlaplacian(u)/dn (flux1_fct_pt) wi...
void doc_solution(DocInfo &doc_info, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt=0)
documents the solution, and if an exact solution is provided, then the error between the numerical an...
void set_dirichlet_boundary_condition(const unsigned &b, DirichletBCFctPt u_fn=0, DirichletBCFctPt dudn_fn=0)
Imposes the prescribed dirichlet BCs u (u_fn) and du/dn (dudn_fn) dirichlet BCs by 'pinning'.
Information for documentation of results: Directory and file number to enable output in the form RESL...
std::string & label()
String used (e.g.) for labeling output files.
std::string directory() const
Output directory.
unsigned & number()
Number used (e.g.) for labeling output files.
A general Finite Element class.
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.
void(* SteadyExactSolutionFctPt)(const Vector< double > &, Vector< double > &)
Function pointer for function that computes vector-valued steady "exact solution" as .
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
int local_eqn_number(const unsigned long &ieqn_global) const
Return the local equation number corresponding to the ieqn_global-th global equation number....
double & x_gen(const unsigned &k, const unsigned &i)
Reference to the generalised position x(k,i). ‘Type’: k; Coordinate direction: i.
double value(const unsigned &i) const
Return i-th value (dofs or pinned) at this node either directly or via hanging node representation....
An OomphLibError object which should be thrown when an run-time error is encountered....
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
void output(std::ostream &outfile)
Output function: x,y,u or x,y,z,u.
TAdvectionDiffusionReactionElement()
Constructor: Call constructors for TElement and AdvectionDiffusionReaction equations.
void output_fct(std::ostream &outfile, const unsigned &n_plot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
Output function for an exact solution: x,y,u_exact.
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
OomphInfo oomph_info
Single (global) instantiation of the OomphInfo object – this is used throughout the library as a "rep...