32 #include "young_laplace.h"
36 #include "meshes/quarter_circle_sector_mesh.h"
40 using namespace oomph;
52 template<
class ELEMENT>
86 Mesh* Height_control_mesh_pt;
89 HeightControlElement* Height_control_element_pt;
92 Node* Control_node_pt;
100 template<
class ELEMENT>
114 Boundary_pt=
new Circle(0.0,0.0,1.0);
118 double xi_hi=MathematicalConstants::Pi/2.0;
123 double fract_mid=0.5;
124 Bulk_mesh_pt =
new RefineableQuarterCircleSectorMesh<ELEMENT>(
125 Boundary_pt,xi_lo,fract_mid,xi_hi);
128 Bulk_mesh_pt->spatial_error_estimator_pt()=
new Z2ErrorEstimator;
131 Bulk_mesh_pt->max_permitted_error()=1.0e-4;
132 Bulk_mesh_pt->min_permitted_error()=1.0e-6;
135 add_sub_mesh(Bulk_mesh_pt);
146 ELEMENT* prescribed_height_element_pt=
dynamic_cast<ELEMENT*
>(
152 Control_node_pt=
static_cast<Node*
>(
153 prescribed_height_element_pt->node_pt(0));
155 cout <<
"Controlling height at (x,y) : (" << Control_node_pt->x(0)
156 <<
"," << Control_node_pt->x(1) <<
")" << endl;
160 Height_control_element_pt=0;
161 Height_control_mesh_pt=0;
164 Height_control_element_pt=
new HeightControlElement(
170 Height_control_mesh_pt =
new Mesh;
171 Height_control_mesh_pt->add_element_pt(Height_control_element_pt);
174 add_sub_mesh(Height_control_mesh_pt);
197 unsigned n_node = Bulk_mesh_pt->nboundary_node(1);
198 for (
unsigned n=0;n<n_node;n++)
200 Bulk_mesh_pt->boundary_node_pt(1,n)->pin(0);
208 unsigned n_bulk=Bulk_mesh_pt->nelement();
209 for(
unsigned i=0;i<n_bulk;i++)
212 ELEMENT *el_pt =
dynamic_cast<ELEMENT*
>(Bulk_mesh_pt->element_pt(i));
227 cout <<
"\nNumber of equations: " << assign_eqn_numbers() << endl;
228 cout <<
"\n********************************************\n" << endl;
237 template<
class ELEMENT>
244 cout <<
"Solving for Prescribed Height Value = " ;
254 template<
class ELEMENT>
256 ofstream& trace_file)
263 trace_file << Control_node_pt->value(0) ;
274 sprintf(filename,
"%s/soln%i.dat",doc_info.directory().c_str(),
276 some_file.open(filename);
277 Bulk_mesh_pt->output(some_file,npts);
288 int main(
int argc,
char* argv[])
292 CommandLineArgs::setup(argc,argv);
295 if (CommandLineArgs::Argc==1)
298 <<
"Running with limited number of steps for validation"
320 doc_info.set_directory(
"RESLT_adapt_pinned_spherical_cap_in_cylinder");
324 sprintf(filename,
"%s/trace.dat",doc_info.directory().c_str());
325 trace_file.open(filename);
328 <<
"VARIABLES=\"<GREEK>k</GREEK>\",\"<GREEK>k</GREEK>_{exact}\",\"h\""
330 trace_file <<
"ZONE" << std::endl;
360 unsigned max_adapt=1;
361 problem.newton_solve(max_adapt);
2D RefineableYoungLaplace problem on rectangular domain, discretised with 2D QRefineableYoungLaplace ...
~RefineableYoungLaplaceProblem()
Destructor (empty)
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...
void actions_after_solve()
Update the problem after solve: Empty.
GeomObject * Boundary_pt
Pointer to GeomObject that specifies the domain bondary.
RefineableYoungLaplaceProblem()
Constructor:
RefineableQuarterCircleSectorMesh< ELEMENT > * Bulk_mesh_pt
Pointer to the "bulk" mesh.
void increment_parameters()
Increment problem parameters.
void actions_before_solve()
Update the problem specs before solve: Empty.
double Controlled_height
Height control value.
unsigned Control_element
Number of element in bulk mesh at which height control is applied. Initialise to 0 – will be overwrit...
double get_exact_kappa()
Exact kappa.
bool Use_height_control
Use height control (true) or not (false)?
double Controlled_height_increment
Increment for height control.
bool Use_spines
Use spines (true) or not (false)
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...
unsigned Nsteps
Number of steps.
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...
@ Spherical_cap_in_cylinder_pinned
double Kappa_initial
Initial value for kappa.
int Case
What case are we considering: Choose one from the enumeration Cases.
void setup_dependent_parameters_and_sanity_check()
Setup dependent parameters and perform sanity check.
int main(int argc, char *argv[])
Driver code for 2D RefineableYoungLaplace problem. Input arguments: none (for validation) or number o...