31 #ifndef OOMPH_FOEPPLVONKARMAN_ELEMENTS_HEADER 32 #define OOMPH_FOEPPLVONKARMAN_ELEMENTS_HEADER 37 #include <oomph-lib-config.h> 43 #include "../generic/projection.h" 44 #include "../generic/nodes.h" 45 #include "../generic/Qelements.h" 46 #include "../generic/oomph_utilities.h" 122 "Data object that contains volume control pressure should only contain a single value. ",
123 OOMPH_CURRENT_FUNCTION,
124 OOMPH_EXCEPTION_LOCATION);
149 const unsigned n_plot=5;
155 void output(std::ostream &outfile,
const unsigned &n_plot);
160 const unsigned n_plot=5;
166 void output(FILE* file_pt,
const unsigned &n_plot);
169 void output_fct(std::ostream &outfile,
const unsigned &n_plot,
175 virtual void output_fct(std::ostream &outfile,
const unsigned &n_plot,
181 "There is no time-dependent output_fct() for Foeppl von Karman" 183 OOMPH_CURRENT_FUNCTION,
184 OOMPH_EXCEPTION_LOCATION);
191 double& error,
double& norm);
197 const double& time,
double& error,
double& norm)
200 "There is no time-dependent compute_error() for Foeppl von Karman" 202 OOMPH_CURRENT_FUNCTION,
203 OOMPH_EXCEPTION_LOCATION);
227 double& pressure)
const 234 (*Pressure_fct_pt)(x,pressure);
244 double& airy_forcing)
const 251 (*Airy_forcing_fct_pt)(x,airy_forcing);
260 const unsigned n_node =
nnode();
273 for(
unsigned j=0;j<2;j++)
279 for(
unsigned l=0;l<n_node;l++)
282 for(
unsigned j=0;j<2;j++)
284 gradient[j] += this->
nodal_value(l,w_nodal_index)*dpsidx(l,j);
299 unsigned index=0)
const 302 const unsigned n_node =
nnode();
314 double interpolated_w = 0.0;
317 for(
unsigned l=0;l<n_node;l++)
319 interpolated_w += this->
nodal_value(l,w_nodal_index)*psi[l];
322 return(interpolated_w);
339 const unsigned n_node =
nnode();
350 double integral_w = 0;
353 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
365 double interpolated_w = 0;
366 double w_nodal_value;
369 for(
unsigned l=0;l<n_node;l++)
374 interpolated_w += w_nodal_value*psi(l);
378 integral_w += interpolated_w*
W;
400 unsigned total_fvk_nodal_indicies = 8;
403 unsigned n_node =
nnode();
406 for(
unsigned index=first_fvk_nodal_index+2;
407 index<first_fvk_nodal_index+total_fvk_nodal_indicies;
411 for(
unsigned inod=0;inod<n_node;inod++)
485 template <
unsigned NNODE_1D>
520 {
return Initial_Nvalue;}
530 void output(std::ostream &outfile,
const unsigned &n_plot)
542 void output(FILE* file_pt,
const unsigned &n_plot)
548 void output_fct(std::ostream &outfile,
const unsigned &n_plot,
557 void output_fct(std::ostream &outfile,
const unsigned &n_plot,
594 template<
unsigned NNODE_1D>
622 template<
unsigned NNODE_1D>
654 template<
unsigned NNODE_1D>
675 template<
class FVK_ELEMENT>
691 std::stringstream error_stream;
693 <<
"Foeppl von Karman elements only store eight fields so fld must be" 694 <<
"0 to 7 rather than " << fld << std::endl;
697 OOMPH_CURRENT_FUNCTION,
698 OOMPH_EXCEPTION_LOCATION);
703 unsigned nnod=this->
nnode();
707 for (
unsigned j=0;j<nnod;j++)
710 data_values[j]=std::make_pair(this->
node_pt(j),fld);
730 std::stringstream error_stream;
732 <<
"Foeppl von Karman elements only store eight fields so fld must be" 733 <<
"0 to 7 rather than " << fld << std::endl;
736 OOMPH_CURRENT_FUNCTION,
737 OOMPH_EXCEPTION_LOCATION);
760 std::stringstream error_stream;
762 <<
"Foeppl von Karman elements only store eight fields so fld must be" 763 <<
"0 to 7 rather than " << fld << std::endl;
766 OOMPH_CURRENT_FUNCTION,
767 OOMPH_EXCEPTION_LOCATION);
770 unsigned n_dim=this->
dim();
771 unsigned n_node=this->
nnode();
773 DShape dpsidx(n_node,n_dim), dtestdx(n_node,n_dim);
791 std::stringstream error_stream;
793 <<
"Foeppl von Karman elements only store eight fields so fld must be" 794 <<
"0 to 7 rather than " << fld << std::endl;
797 OOMPH_CURRENT_FUNCTION,
798 OOMPH_EXCEPTION_LOCATION);
805 unsigned n_node=this->
nnode();
812 double interpolated_w = 0.0;
815 for(
unsigned l=0;l<n_node;l++)
817 interpolated_w += this->
nodal_value(t,l,w_nodal_index)*psi[l];
819 return interpolated_w;
831 std::stringstream error_stream;
833 <<
"Foeppl von Karman elements only store eight fields so fld must be" 834 <<
"0 to 7 rather than " << fld << std::endl;
837 OOMPH_CURRENT_FUNCTION,
838 OOMPH_EXCEPTION_LOCATION);
841 return this->
nnode();
852 std::stringstream error_stream;
854 <<
"Foeppl von Karman elements only store eight fields so fld must be" 855 <<
"0 to 7 rather than " << fld << std::endl;
858 OOMPH_CURRENT_FUNCTION,
859 OOMPH_EXCEPTION_LOCATION);
872 template<
class ELEMENT>
885 template<
class ELEMENT>
FoepplvonKarmanPressureFctPt & pressure_fct_pt()
Access function: Pointer to pressure function.
void compute_error(std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
Get error against and norm of exact solution.
virtual void get_airy_forcing_fvk(const unsigned &ipt, const Vector< double > &x, double &airy_forcing) const
Get Airy forcing term at (Eulerian) position x. This function is virtual to allow overloading in mult...
double raw_nodal_value(const unsigned &n, const unsigned &i) const
Return the i-th value stored at local node n but do NOT take hanging nodes into account.
void broken_copy(const std::string &class_name)
Issue error message and terminate execution.
void output_fct(std::ostream &outfile, const unsigned &n_plot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
Output exact soln: x,y,w_exact at n_plot^DIM plot points.
Vector< std::pair< Data *, unsigned > > data_values_of_field(const unsigned &fld)
Specify the values associated with field fld. The information is returned in a vector of pairs which ...
static double Default_Physical_Constant_Value
Default value for physical constants.
unsigned nhistory_values_for_projection(const unsigned &fld)
Number of history values to be stored for fld-th field. (Note: count includes current value!) ...
virtual double dshape_eulerian_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsidx) const
Return the geometric shape functions and also first derivatives w.r.t. global coordinates at the ipt-...
bool Linear_bending_model
Flag which stores whether we are using a linear, pure bending model instead of the full non-linear Fo...
double *& eta_pt()
Pointer to eta.
void operator=(const FoepplvonKarmanEquations &)
Broken assignment operator.
void output(std::ostream &outfile)
Output function: x,y,w.
double dshape_and_dtest_eulerian_fvk(const Vector< double > &s, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const
Shape, test functions & derivs. w.r.t. to global coords. Return Jacobian.
virtual double get_bounded_volume() const
Return the integral of the displacement over the current element, effectively calculating its contrib...
FoepplvonKarmanEquations()
Constructor (must initialise the Pressure_fct_pt and Airy_forcing_fct_pt to null). Also set physical parameters to their default values. No volume constraint applied by default.
A general Finite Element class.
void(* UnsteadyExactSolutionFctPt)(const double &, const Vector< double > &, Vector< double > &)
Function pointer for function that computes Vector-valued time-dependent function as ...
TimeStepper *& position_time_stepper_pt()
Return a pointer to the position timestepper.
double jacobian_and_shape_of_field(const unsigned &fld, const Vector< double > &s, Shape &psi)
Return Jacobian of mapping and shape functions of field fld at local coordinate s.
unsigned nfields_for_projection()
Number of fields to be projected: Just two.
FoepplvonKarmanPressureFctPt & airy_forcing_fct_pt()
Access function: Pointer to Airy forcing function.
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
static const unsigned Initial_Nvalue
Static int that holds the number of variables at nodes: always the same.
virtual double weight(const unsigned &i) const =0
Return weight of i-th integration point.
void pin(const unsigned &i)
Pin the i-th stored variable.
unsigned add_external_data(Data *const &data_pt, const bool &fd=true)
int Volume_constraint_pressure_external_data_index
Index of the external Data object that represents the volume constraint pressure (initialised to -1 i...
unsigned nvalue_of_field(const unsigned &fld)
Return number of values in field fld: One per node.
FoepplvonKarmanPressureFctPt Pressure_fct_pt
Pointer to pressure function:
QFoepplvonKarmanElement(const QFoepplvonKarmanElement< NNODE_1D > &dummy)
Broken copy constructor.
void interpolated_stress(const Vector< double > &s, double &sigma_xx, double &sigma_yy, double &sigma_xy)
Compute in-plane stresses.
double * Eta_pt
Pointer to global eta.
unsigned nhistory_values_for_coordinate_projection()
Number of positional history values (Note: count includes current value!)
void(* SteadyExactSolutionFctPt)(const Vector< double > &, Vector< double > &)
Function pointer for function that computes vector-valued steady "exact solution" as ...
void output(FILE *file_pt)
C_style output with default number of plot points.
void compute_error(std::ostream &outfile, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, double &error, double &norm)
Dummy, time dependent error checker.
void get_gradient_of_deflection(const Vector< double > &s, Vector< double > &gradient) const
Get gradient of deflection: gradient[i] = dw/dx_i.
double dshape_eulerian(const Vector< double > &s, Shape &psi, DShape &dpsidx) const
Compute the geometric shape functions and also first derivatives w.r.t. global coordinates at local c...
FoepplvonKarmanPressureFctPt airy_forcing_fct_pt() const
Access function: Pointer to Airy forcing function. Const version.
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
void use_linear_bending_model()
Sets a flag to signify that we are solving the linear, pure bending equations, and pin all the nodal ...
FoepplvonKarmanEquations(const FoepplvonKarmanEquations &dummy)
Broken copy constructor.
unsigned self_test()
Self-test: Return 0 for OK.
virtual unsigned nodal_index_fvk(const unsigned &i=0) const
Return the index at which the i-th unknown value is stored. The default value, i, is appropriate for ...
void(* FoepplvonKarmanPressureFctPt)(const Vector< double > &x, double &f)
Function pointer to pressure function fct(x,f(x)) – x is a Vector!
A class that represents a collection of data; each Data object may contain many different individual ...
const double & eta() const
Eta.
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Fill in the residuals with this element's contribution.
virtual double dshape_and_dtest_eulerian_at_knot_fvk(const unsigned &ipt, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const =0
Shape/test functions and derivs w.r.t. to global coords at integration point ipt; return Jacobian of ...
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
void operator=(const QFoepplvonKarmanElement< NNODE_1D > &)
Broken assignment operator.
FoepplvonKarmanPressureFctPt Airy_forcing_fct_pt
double nodal_value(const unsigned &n, const unsigned &i) const
Return the i-th value stored at local node n. Produces suitably interpolated values for hanging nodes...
void output(std::ostream &outfile)
Output with default number of plot points.
QFoepplvonKarmanElement()
Constructor: Call constructors for QElement and FoepplvonKarmanEquations.
unsigned ntstorage() const
Return the number of doubles required to represent history (one for steady)
void output(std::ostream &outfile, const unsigned &n_plot)
Output function: x,y,w at n_plot^DIM plot points.
int local_equation(const unsigned &fld, const unsigned &j)
Return local equation number of field fld of node j.
unsigned ntstorage() const
Return total number of doubles stored per value to record time history of each value (one for steady ...
double dshape_and_dtest_eulerian_at_knot_fvk(const unsigned &ipt, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const
Shape, test functions & derivs. w.r.t. to global coords. at integration point ipt. Return Jacobian.
FaceGeometry()
Constructor: Call the constructor for the appropriate lower-dimensional QElement. ...
unsigned required_nvalue(const unsigned &n) const
Required # of `values' (pinned or dofs) at node n.
unsigned dim() const
Return the spatial dimension of the element, i.e. the number of local coordinates required to paramet...
void broken_assign(const std::string &class_name)
Issue error message and terminate execution.
virtual unsigned nweight() const =0
Return the number of integration points of the scheme.
double get_field(const unsigned &t, const unsigned &fld, const Vector< double > &s)
Return interpolated field fld at local coordinate s, at time level t (t=0: present; t>0: history valu...
Foeppl von Karman upgraded to become projectable.
void output_fct(std::ostream &outfile, const unsigned &n_plot, const double &time, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt)
Output function for a time-dependent exact solution. x,y,w_exact at n_plot^DIM plot points (Calls the...
FoepplvonKarmanPressureFctPt pressure_fct_pt() const
Access function: Pointer to pressure function. Const version.
virtual void get_pressure_fvk(const unsigned &ipt, const Vector< double > &x, double &pressure) const
Get pressure term at (Eulerian) position x. This function is virtual to allow overloading in multi-ph...
void set_volume_constraint_pressure_data_as_external_data(Data *data_pt)
Set Data value containing a single value which represents the volume control pressure as external dat...
unsigned nnode() const
Return the number of nodes.
virtual void output_fct(std::ostream &outfile, const unsigned &n_plot, const double &time, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt)
Output exact soln: x,y,w_exact at n_plot^DIM plot points (dummy time-dependent version to keep intel ...
virtual double dshape_and_dtest_eulerian_fvk(const Vector< double > &s, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const =0
Shape/test functions and derivs w.r.t. to global coords at local coord. s; return Jacobian of mapping...
virtual void shape(const Vector< double > &s, Shape &psi) const =0
Calculate the geometric shape functions at local coordinate s. This function must be overloaded for e...
void output(FILE *file_pt, const unsigned &n_plot)
C-style output function: x,y,w at n_plot^DIM plot points.
void output(FILE *file_pt)
C-style output function: x,y,w.
void output_fct(std::ostream &outfile, const unsigned &n_plot, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt)
Output function for an exact solution: x,y,w_exact at n_plot^DIM plot points.
int nodal_local_eqn(const unsigned &n, const unsigned &i) const
Return the local equation number corresponding to the i-th value at the n-th local node...
double interpolated_w_fvk(const Vector< double > &s, unsigned index=0) const
Return FE representation of function value w_fvk(s) at local coordinate s (by default - if index > 0...