36 #include "young_laplace.h" 39 #include "meshes/simple_rectangular_quadmesh.h" 43 using namespace oomph;
62 return 2.0*Controlled_height/
63 (Controlled_height*Controlled_height+1.0/4.0);
77 Vector<double>& spine_B,
78 Vector< Vector<double> >& dspine_B)
85 dspine_B[0][0] = 1.0 ;
86 dspine_B[1][0] = 0.0 ;
87 dspine_B[0][1] = 0.0 ;
88 dspine_B[1][1] = 1.0 ;
89 dspine_B[0][2] = 0.0 ;
90 dspine_B[1][2] = 0.0 ;
109 Vector<double>& spine,
110 Vector< Vector<double> >& dspine)
119 spine[1]=cos(Alpha_min+(Alpha_max-Alpha_min)*x[1]);
121 dspine[1][1]=-sin(Alpha_min+(Alpha_max-Alpha_min)*x[1])
124 spine[2]=sin(Alpha_min+(Alpha_max-Alpha_min)*x[1]);
126 dspine[1][2]=cos(Alpha_min+(Alpha_max-Alpha_min)*x[1])
142 template<
class ELEMENT>
158 double new_kappa=
Kappa_pt->value(0)-0.5;
167 void doc_solution(DocInfo& doc_info, ofstream& trace_file);
183 template<
class ELEMENT>
203 Problem::mesh_pt()=
new SimpleRectangularQuadMesh<ELEMENT>(n_x,n_y,l_x,l_y);
208 if ((n_x%2!=0)||(n_y%2!=0))
210 cout <<
"n_x n_y should be even" << endl;
215 ELEMENT* prescribed_height_element_pt=
dynamic_cast<ELEMENT*
>(
216 mesh_pt()->element_pt(n_y*n_x/2+n_x/2));
219 Control_node_pt=
static_cast<Node*
>(prescribed_height_element_pt->node_pt(0));
221 std::cout <<
"Controlling height at (x,y) : (" << Control_node_pt->x(0)
222 <<
"," << Control_node_pt->x(1) <<
")" <<
"\n" << endl;
226 HeightControlElement* height_control_element_pt=
new HeightControlElement(
230 Kappa_pt=height_control_element_pt->kappa_pt();
245 unsigned n_bound = mesh_pt()->nboundary();
246 for(
unsigned b=0;b<n_bound;b++)
252 unsigned n_node = mesh_pt()->nboundary_node(b);
253 for (
unsigned n=0;n<n_node;n++)
255 mesh_pt()->boundary_node_pt(b,n)->pin(0);
265 unsigned nelement = mesh_pt()->nelement();
266 for(
unsigned i=0;i<nelement;i++)
269 ELEMENT *el_pt =
dynamic_cast<ELEMENT*
>(mesh_pt()->element_pt(i));
281 mesh_pt()->add_element_pt(height_control_element_pt);
284 cout <<
"\nNumber of equations: " << assign_eqn_numbers() << endl;
294 template<
class ELEMENT>
296 ofstream& trace_file)
301 trace_file << -1.0*
Kappa_pt->value(0) <<
" ";
303 trace_file << Control_node_pt->value(0) ;
313 sprintf(filename,
"%s/soln%i.dat",doc_info.directory().c_str(),
315 some_file.open(filename);
316 mesh_pt()->output(some_file,npts);
332 doc_info.set_directory(
"RESLT");
337 sprintf(filename,
"%s/trace.dat",doc_info.directory().c_str());
338 trace_file.open(filename);
342 <<
"VARIABLES=\"<GREEK>k</GREEK>\",\"<GREEK>k</GREEK>_{ex}\",\"h\"" 344 trace_file <<
"ZONE" << std::endl;
362 double increment=0.1;
366 for (
unsigned istep=0;istep<nstep;istep++)
373 problem.newton_solve();
void doc_solution(DocInfo &doc_info, ofstream &trace_file)
Doc the solution. DocInfo object stores flags/labels for where the output gets written to and the tra...
~YoungLaplaceProblem()
Destructor (empty)
double Controlled_height
Height control value.
double Alpha_min
Min. spine angle against horizontal plane.
YoungLaplaceProblem()
Constructor:
void spine_function(const Vector< double > &x, Vector< double > &spine, Vector< Vector< double > > &dspine)
Spine: The spine vector field as a function of the two coordinates x_1 and x_2, and its derivatives w...
Namespace for "global" problem parameters.
Data * Kappa_pt
Pointer to Data object that stores the prescribed curvature.
void spine_base_function(const Vector< double > &x, Vector< double > &spine_B, Vector< Vector< double > > &dspine_B)
Spine basis: The position vector to the basis of the spine as a function of the two coordinates x_1 a...
Data * Kappa_pt
Pointer to Data object that stores the prescribed curvature.
double Alpha_max
Max. spine angle against horizontal plane.
Node * Control_node_pt
Node at which the height (displacement along spine) is controlled/doced.
void actions_after_newton_solve()
Update the problem after solve: Empty.
void actions_before_newton_solve()
Update the problem before solve.
double get_exact_kappa()
Exact kappa.