30 #include "navier_stokes.h"
32 #include "meshes/simple_rectangular_quadmesh.h"
37 using namespace oomph;
62 template<
class ELEMENT>
80 dynamic_cast<ELEMENT*
>(mesh_pt()->element_pt(e))->
81 fix_pressure(pdof,pvalue);
95 unsigned num_nod= mesh_pt()->nboundary_node(ibound);
96 for (
unsigned inod=0;inod<num_nod;inod++)
100 mesh_pt()->boundary_node_pt(ibound,inod)->set_value(i,1.0);
103 mesh_pt()->boundary_node_pt(ibound,inod)->set_value(i,0.0);
107 unsigned num_bound = mesh_pt()->nboundary();
108 for(
unsigned ibound=1;ibound<num_bound;ibound++)
110 unsigned num_nod= mesh_pt()->nboundary_node(ibound);
111 for (
unsigned inod=0;inod<num_nod;inod++)
113 for (
unsigned i=0;i<2;i++)
115 mesh_pt()->boundary_node_pt(ibound,inod)->set_value(i,0.0);
126 return dynamic_cast<SimpleRectangularQuadMesh<ELEMENT>*
>(
132 void doc_solution(DocInfo& doc_info);
140 template<
class ELEMENT>
159 Problem::mesh_pt() =
new SimpleRectangularQuadMesh<ELEMENT>(n_x,n_y,l_x,l_y);
164 unsigned num_bound = mesh_pt()->nboundary();
165 for(
unsigned ibound=0;ibound<num_bound;ibound++)
167 unsigned num_nod= mesh_pt()->nboundary_node(ibound);
168 for (
unsigned inod=0;inod<num_nod;inod++)
171 for (
unsigned i=0;i<2;i++)
173 mesh_pt()->boundary_node_pt(ibound,inod)->pin(i);
181 unsigned n_element = mesh_pt()->nelement();
185 for(
unsigned e=0;e<n_element;e++)
188 ELEMENT* el_pt =
dynamic_cast<ELEMENT*
>(mesh_pt()->element_pt(e));
195 fix_pressure(0,0,0.0);
198 cout <<
"Number of equations: " << assign_eqn_numbers() << std::endl;
206 template<
class ELEMENT>
217 sprintf(filename,
"%s/soln%i.dat",doc_info.directory().c_str(),
219 some_file.open(filename);
220 mesh_pt()->output(some_file,npts);
252 doc_info.set_directory(
"RESLT");
265 cout <<
"Doing QCrouzeixRaviartElement<2>" << std::endl;
268 problem.newton_solve();
283 cout <<
"Doing QTaylorHoodElement<2>" << std::endl;
286 problem.newton_solve();
///////////////////////////////////////////////////////////////////// ///////////////////////////////...
~RectangularDrivenCavityProblem()
Destructor (empty)
SimpleRectangularQuadMesh< ELEMENT > * mesh_pt()
void actions_before_newton_solve()
Update the problem specs before solve. Re-set velocity boundary conditions just to be on the safe sid...
void doc_solution(DocInfo &doc_info)
Doc the solution.
void actions_after_newton_solve()
Update the after solve (empty)
void fix_pressure(const unsigned &e, const unsigned &pdof, const double &pvalue)
Fix pressure in element e at pressure dof pdof and set to pvalue.
RectangularDrivenCavityProblem()
Constructor.
int main()
///////////////////////////////////////////////////////////////////// ///////////////////////////////...
Namespace for physical parameters.
double Re
Reynolds number.