77 unsigned ibound;
int index;
78 if(outlet) {ibound=1;index=1;}
79 else {ibound=3;index=-1;}
84 for(
unsigned ielt=0;ielt<num_elt;ielt++)
90 this->
Element_pt.push_back(surface_element_pt);
92 if(outlet) { this->Outlet_traction_elt_pt.push_back(surface_element_pt); }
93 else { this->Inlet_traction_elt_pt.push_back(surface_element_pt); }
101 std::cout << std::endl <<
"Streamfunction traction elements attached to streamfunction_mesh" << std::endl << std::endl;
114 for(
unsigned e=0;
e<Ntraction;
e++)
121 Inlet_traction_elt_pt.clear();
124 std::cout << std::endl <<
"Streamfunction traction elements removed from streamfunction_mesh" << std::endl << std::endl;
138 std::cout <<
"Warning, attempting to assemble streamfunction element vector ";
139 std::cout <<
"whilst streamfunction traction elements are attached to the mesh" << std::endl;
144 for(
unsigned e=0;
e<n_elt;
e++)
236 void header( ofstream &some_file );
272 for(
unsigned i=0;
i<n_fluid;
i++)
298 for(
unsigned i=0;
i<n_bound;
i+=2)
304 for (
unsigned n=0;
n<n_node;
n++)
314 double stream = 0.5*
x[1];
332 for(
unsigned i=0;
i<n_bound;
i+=2)
335 for (
unsigned n=0;
n<n_node;
n++)
351 for(
unsigned i=0;
i<num_nod;
i++)
366 for(
unsigned i=0;
i<num_nod;
i++)
378 double u=0.0;
double v=0.0;
405 unsigned long n_element =
mesh_pt() -> nelement();
406 for (
unsigned long e = 0;
e < n_element;
e++ )
413 s[0] = -1.0;
s[1] = -1.0;
414 elt_pt -> get_x(
s, x_lower_left );
416 s[0] = 1.0;
s[1] = 1.0;
417 elt_pt -> get_x(
s, x_upper_right );
420 if ( ( x_lower_left[0] <= x_to_get[0] )
421 && ( x_lower_left[1] <= x_to_get[1] ) )
424 if ( ( x_upper_right[0] > x_to_get[0] )
425 && ( x_upper_right[1] > x_to_get[1] ) )
429 s[0] = 0.0;
s[1] = 0.0;
430 elt_pt -> get_x(
s, x_centre );
435 if(
abs(
a+
c-2.*
b)<1.e-8)
s[0] = -1.0 + 2.*( x_to_get[0] - x_lower_left[0] )
436 / ( x_upper_right[0] - x_lower_left[0] );
444 s[1] = -1.0 + 2.*( x_to_get[1] - x_lower_left[1] )
445 / ( x_upper_right[1] - x_lower_left[1] );
448 elt_pt -> get_x(
s,
x );
450 if(
abs(
x[0]-x_to_get[0])>1.e-12)
452 if(
abs(
a+
c-2.*
b)<1.e-8) std::cout <<
"Element almost linear: " <<
abs(
a+
c-2.*
b) << std::endl;
453 std::cout <<
"error in interpolation: " << (
x[0]-x_to_get[0]) << std::endl;
454 std::cout <<
"r:" <<
x[0] <<
"r to get: " << x_to_get[0] << std::endl;
458 elt_pt -> get_x(
s,
x );
459 stream = elt_pt -> interpolated_streamfunction(
s );
481 double left=-1.+1.e-13;
482 double right=1.-1.e-13;
485 double R =
pow((outer/inner),(1.0/(radial - 1.0)));
491 out <<
"# Streamfunction output at " << radial <<
" radial and " << azimuthal <<
" azimuthal points" << std::endl;
503 std::cout <<
"Outputting streamfunction to file " <<
file_name <<
" at " << radial
504 <<
" radial plot points and " << azimuthal <<
" azimuthal points." << std::endl;
505 std::cout << std::endl;
514 for(
int i=0;
i<radial;
i++)
517 position[0]=inner*
pow(
R,
i);
519 for(
int j=0;
j<azimuthal;
j++)
522 position[1]=left + ((right-left)*
j)/(azimuthal-1.0);
528 out << position[0] <<
" " << position[1] <<
" " << stream << std::endl;
539 for(
int i=0;
i<radial;
i++)
542 position[0]=inner + ((outer-inner)*
i)/(radial-1.0);
544 for(
int j=0;
j<azimuthal;
j++)
547 position[1]=left + ((right-left)*
j)/(azimuthal-1.0);
553 out << position[0] <<
" " << position[1] <<
" " << stream << std::endl;
591 some_file <<
"# Refineable streamfunction mesh" <<
"\n";
AnnoyingScalar abs(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:135
AnnoyingScalar sqrt(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:134
Array< int, Dynamic, 1 > v
Definition: Array_initializer_list_vector_cxx11.cpp:1
int i
Definition: BiCGSTAB_step_by_step.cpp:9
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
Array< double, 1, 3 > e(1./3., 0.5, 2.)
@ R
Definition: StatisticsVector.h:21
Scalar * b
Definition: benchVecAdd.cpp:17
void pin(const unsigned &i)
Pin the i-th stored variable.
Definition: nodes.h:385
void set_value(const unsigned &i, const double &value_)
Definition: nodes.h:271
Definition: oomph_utilities.h:499
std::string directory() const
Output directory.
Definition: oomph_utilities.h:524
unsigned & number()
Number used (e.g.) for labeling output files.
Definition: oomph_utilities.h:554
unsigned long nboundary_node(const unsigned &ibound) const
Return number of nodes on a particular boundary.
Definition: mesh.h:833
unsigned nboundary_element(const unsigned &b) const
Return number of finite elements that are adjacent to boundary b.
Definition: mesh.h:878
unsigned nboundary() const
Return number of boundaries.
Definition: mesh.h:827
FiniteElement * boundary_element_pt(const unsigned &b, const unsigned &e) const
Return pointer to e-th finite element on boundary b.
Definition: mesh.h:840
GeneralisedElement *& element_pt(const unsigned long &e)
Return pointer to element e.
Definition: mesh.h:448
unsigned long nnode() const
Return number of nodes in the mesh.
Definition: mesh.h:596
void output(std::ostream &outfile)
Output for all elements.
Definition: mesh.cc:2027
Node *& node_pt(const unsigned long &n)
Return pointer to global node n.
Definition: mesh.h:436
Node *& boundary_node_pt(const unsigned &b, const unsigned &n)
Return pointer to node n on boundary b.
Definition: mesh.h:493
Vector< GeneralisedElement * > Element_pt
Vector of pointers to generalised elements.
Definition: mesh.h:186
double & x(const unsigned &i)
Return the i-th nodal coordinate.
Definition: nodes.h:1060
double *& alpha_pt()
Pointer to Alpha.
Definition: streamfunction_elements.h:49
Definition: polar_streamfunction_traction_elements.h:45
void set_boundary(int bound)
Function to set boundary.
Definition: polar_streamfunction_traction_elements.h:106
double *& alpha_pt()
Pointer to Alpha.
Definition: polar_streamfunction_traction_elements.h:100
Definition: problem.h:151
Mesh *& mesh_pt()
Return a pointer to the global mesh.
Definition: problem.h:1280
unsigned long assign_eqn_numbers(const bool &assign_local_eqn_numbers=true)
Definition: problem.cc:1989
const unsigned & ny() const
Return number of elements in y direction.
Definition: rectangular_quadmesh.template.h:231
const unsigned & nx() const
Return number of elements in x direction.
Definition: rectangular_quadmesh.template.h:224
ErrorEstimator *& spatial_error_estimator_pt()
Access to spatial error estimator.
Definition: refineable_mesh.h:143
Definition: refineable_streamfunction_elements.h:176
My log r spaced mesh.
Definition: refineable_r_mesh.h:37
Vector< GeneralisedElement * > Fluid_elt_pt
Definition: refineable_r_mesh.h:41
unsigned fluid_elt_length()
Return length of fluid element vector.
Definition: refineable_r_mesh.h:49
Polar Streamfunction problem class.
Definition: streamfunction_include.h:161
void my_output(const int radial, const int azimuthal, bool log_output, string file_name)
Output the streamfunction on a regular grid.
Definition: streamfunction_include.h:472
void actions_after_solve()
Update the problem after solve (empty)
Definition: streamfunction_include.h:180
void header(ofstream &some_file)
Definition: streamfunction_include.h:589
void get_vels(const Vector< double > &x_to_get, double &stream)
Return the value of the streamfunction at given global coordinates.
Definition: streamfunction_include.h:391
~StreamfunctionProblem()
Destructor (empty – all the cleanup is done in base class)
Definition: streamfunction_include.h:173
void pin_velocities()
Pin velocities.
Definition: streamfunction_include.h:347
streamfunction_mesh * mesh_pt()
Definition: streamfunction_include.h:207
void pin_boundaries()
Pin boundaries.
Definition: streamfunction_include.h:328
void actions_before_solve()
Definition: streamfunction_include.h:292
bool eigenfunction
Storage for whether we're solving for an eigenfunction or not.
Definition: streamfunction_include.h:165
void assign_velocities()
Assign velocities to nodes.
Definition: streamfunction_include.h:362
StreamfunctionProblem(const bool &eigen)
Constructor: Pass pointer to source function.
Definition: streamfunction_include.h:243
void actions_after_adapt()
After adaptation: Unpin all pressures and then pin redudant pressure dofs.
Definition: streamfunction_include.h:190
void doc_solution(DocInfo &doc_info)
Doc the solution: doc_info contains labels/output directory etc.
Definition: streamfunction_include.h:570
void actions_before_adapt()
Before adaptation:
Definition: streamfunction_include.h:183
Definition: oomph-lib/src/generic/Vector.h:58
Definition: error_estimator.h:266
My streamfunction mesh class.
Definition: streamfunction_include.h:38
Vector< PolarStreamfunctionTractionElement< RefineablePolarStreamfunctionElement > * > Inlet_traction_elt_pt
Definition: streamfunction_include.h:42
void remove_traction_elements()
Definition: streamfunction_include.h:106
PolarStreamfunctionTractionElement< RefineablePolarStreamfunctionElement > * inlet_traction_elt_pt(unsigned e)
Return pointer to inlet traction element e.
Definition: streamfunction_include.h:48
unsigned inlet_traction_elt_length()
Return length of inlet traction element vector.
Definition: streamfunction_include.h:51
Vector< PolarStreamfunctionTractionElement< RefineablePolarStreamfunctionElement > * > Outlet_traction_elt_pt
Definition: streamfunction_include.h:43
PolarStreamfunctionTractionElement< RefineablePolarStreamfunctionElement > * outlet_traction_elt_pt(unsigned e)
Return pointer to outlet traction element e.
Definition: streamfunction_include.h:53
void make_traction_elements(const bool &outlet)
Definition: streamfunction_include.h:74
streamfunction_mesh(const unsigned int &nx, const unsigned int &ny)
Definition: streamfunction_include.h:60
void assign_fluid_element_vector()
Definition: streamfunction_include.h:129
unsigned outlet_traction_elt_length()
Return length of outlet traction element vector.
Definition: streamfunction_include.h:56
void check(bool b, bool ref)
Definition: fastmath.cpp:12
RealScalar s
Definition: level1_cplx_impl.h:130
const Scalar * a
Definition: level2_cplx_impl.h:32
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 pow(const bfloat16 &a, const bfloat16 &b)
Definition: BFloat16.h:625
int ymesh
Definition: jeffery_hamel.cc:62
int adaptive
Definition: jeffery_hamel.cc:106
bool pinv
Definition: jeffery_hamel.cc:86
bool new_outlet_region
Definition: jeffery_hamel.cc:93
bool outlet_traction
Definition: jeffery_hamel.cc:82
bool log_mesh
Definition: jeffery_hamel.cc:92
int uniform
Definition: jeffery_hamel.cc:106
int xmesh
Definition: jeffery_hamel.cc:61
double R_l
Definition: jeffery_hamel.cc:57
double eta_inlet
Definition: jeffery_hamel.cc:80
double Alpha
Scaling factor for wall thickness (to be used in an exercise)
Definition: unsteady_ring.cc:73
bool inlet_traction
Definition: jeffery_hamel.cc:79
double R_r
Definition: jeffery_hamel.cc:58
double eta_outlet
Definition: jeffery_hamel.cc:83
string filename
Definition: MergeRestartFiles.py:39
Z2ErrorEstimator * error_estimator_pt
Definition: MortaringCantileverCompareToNonMortaring.cpp:190
string file_name
Definition: Particles2023AnalysisHung.py:321
int c
Definition: calibrate.py:100
double Re
Hydrodynamic Parameters.
Definition: refineable_two_layer_soluble_surfactant.cc:106
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
Definition: AnisotropicHookean.h:10
list x
Definition: plotDoE.py:28
EIGEN_DONT_INLINE T sub(T a, T b)
Definition: svd_common.h:238
std::ofstream out("Result.txt")
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2