36 #include "young_laplace.h" 40 #include "meshes/quarter_circle_sector_mesh.h" 44 using namespace oomph;
56 template<
class ELEMENT>
75 void increment_parameters();
79 void doc_solution(DocInfo& doc_info, ofstream& trace_file);
90 Mesh* Height_control_mesh_pt;
93 HeightControlElement* Height_control_element_pt;
96 Node* Control_node_pt;
104 template<
class ELEMENT>
118 Boundary_pt=
new Circle(0.0,0.0,1.0);
122 double xi_hi=MathematicalConstants::Pi/2.0;
127 double fract_mid=0.5;
128 Bulk_mesh_pt =
new RefineableQuarterCircleSectorMesh<ELEMENT>(
129 Boundary_pt,xi_lo,fract_mid,xi_hi);
132 Bulk_mesh_pt->spatial_error_estimator_pt()=
new Z2ErrorEstimator;
135 Bulk_mesh_pt->max_permitted_error()=1.0e-4;
136 Bulk_mesh_pt->min_permitted_error()=1.0e-6;
139 add_sub_mesh(Bulk_mesh_pt);
150 ELEMENT* prescribed_height_element_pt=
dynamic_cast<ELEMENT*
>(
156 Control_node_pt=
static_cast<Node*
>(
157 prescribed_height_element_pt->node_pt(0));
159 cout <<
"Controlling height at (x,y) : (" << Control_node_pt->x(0)
160 <<
"," << Control_node_pt->x(1) <<
")" << endl;
164 Height_control_element_pt=0;
165 Height_control_mesh_pt=0;
168 Height_control_element_pt=
new HeightControlElement(
174 Height_control_mesh_pt =
new Mesh;
175 Height_control_mesh_pt->add_element_pt(Height_control_element_pt);
178 add_sub_mesh(Height_control_mesh_pt);
201 unsigned n_node = Bulk_mesh_pt->nboundary_node(1);
202 for (
unsigned n=0;n<n_node;n++)
204 Bulk_mesh_pt->boundary_node_pt(1,n)->pin(0);
212 unsigned n_bulk=Bulk_mesh_pt->nelement();
213 for(
unsigned i=0;i<n_bulk;i++)
216 ELEMENT *el_pt =
dynamic_cast<ELEMENT*
>(Bulk_mesh_pt->element_pt(i));
231 cout <<
"\nNumber of equations: " << assign_eqn_numbers() << endl;
232 cout <<
"\n********************************************\n" << endl;
241 template<
class ELEMENT>
248 cout <<
"Solving for Prescribed Height Value = " ;
258 template<
class ELEMENT>
260 ofstream& trace_file)
267 trace_file << Control_node_pt->value(0) ;
278 sprintf(filename,
"%s/soln%i.dat",doc_info.directory().c_str(),
280 some_file.open(filename);
281 Bulk_mesh_pt->output(some_file,npts);
292 int main(
int argc,
char* argv[])
296 CommandLineArgs::setup(argc,argv);
299 if (CommandLineArgs::Argc==1)
302 <<
"Running with limited number of steps for validation" 324 doc_info.set_directory(
"RESLT_adapt_pinned_spherical_cap_in_cylinder");
328 sprintf(filename,
"%s/trace.dat",doc_info.directory().c_str());
329 trace_file.open(filename);
332 <<
"VARIABLES=\"<GREEK>k</GREEK>\",\"<GREEK>k</GREEK>_{exact}\",\"h\"" 334 trace_file <<
"ZONE" << std::endl;
364 unsigned max_adapt=1;
365 problem.newton_solve(max_adapt);
RefineableYoungLaplaceProblem()
Constructor:
double Controlled_height
Height control value.
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...
unsigned Nsteps
Number of steps.
~RefineableYoungLaplaceProblem()
Destructor (empty)
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...
void increment_parameters()
Increase the problem parameters before each solve.
void actions_after_solve()
Update the problem after solve: Empty.
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...
bool Use_spines
Use spines (true) or not (false)
void setup_dependent_parameters_and_sanity_check()
Setup dependent parameters and perform sanity check.
int main(int argc, char *argv[])
void actions_before_solve()
Update the problem specs before solve: Empty.
int Case
What case are we considering: Choose one from the enumeration Cases.
RefineableQuarterCircleSectorMesh< ELEMENT > * Bulk_mesh_pt
Pointer to the "bulk" mesh.
double get_exact_kappa()
Exact kappa.
bool Use_height_control
Use height control (true) or not (false)?
double Kappa_initial
Initial value for kappa.
GeomObject * Boundary_pt
Pointer to GeomObject that specifies the domain bondary.
double Controlled_height_increment
Increment for height control.