31 #ifndef OOMPH_FOEPPLVONKARMAN_DISPLACEMENT_ELEMENTS_HEADER 32 #define OOMPH_FOEPPLVONKARMAN_DISPLACEMENT_ELEMENTS_HEADER 36 #include <oomph-lib-config.h> 42 #include "../generic/projection.h" 43 #include "../generic/nodes.h" 44 #include "../generic/oomph_utilities.h" 137 const unsigned n_plot=5;
143 void output(std::ostream &outfile,
const unsigned &n_plot);
148 const unsigned n_plot=5;
154 void output(FILE* file_pt,
const unsigned &n_plot);
157 void output_fct(std::ostream &outfile,
const unsigned &n_plot,
163 virtual void output_fct(std::ostream &outfile,
const unsigned &n_plot,
169 "There is no time-dependent output_fct() for Foeppl von Karman" 171 OOMPH_CURRENT_FUNCTION,
172 OOMPH_EXCEPTION_LOCATION);
179 double& error,
double& norm);
185 const double& time,
double& error,
double& norm)
188 "There is no time-dependent compute_error() for Foeppl von Karman" 190 OOMPH_CURRENT_FUNCTION,
191 OOMPH_EXCEPTION_LOCATION);
214 double& pressure)
const 221 (*Pressure_fct_pt)(x,pressure);
238 (*Traction_fct_pt)(x,traction);
247 const unsigned n_node =
nnode();
265 for(
unsigned j=0;j<2;j++)
271 for(
unsigned l=0;l<n_node;l++)
274 for(
unsigned j=0;j<2;j++)
276 gradient[j] += this->
nodal_value(l,w_nodal_index)*dpsidx(l,j);
289 const unsigned &index)
const 292 const unsigned n_node =
nnode();
310 for(
unsigned j=0;j<2;j++)
316 for(
unsigned l=0;l<n_node;l++)
319 for(
unsigned j=0;j<2;j++)
321 gradient[j] += this->
nodal_value(l,w_nodal_index)*dpsidx(l,j);
334 double e_xx = interpolated_duxdx[0];
335 double e_yy = interpolated_duydx[1];
336 double e_xy = 0.5 * (interpolated_duxdx[1] + interpolated_duydx[0]);
337 e_xx+= 0.5 * interpolated_dwdx[0] * interpolated_dwdx[0];
338 e_yy+= 0.5 * interpolated_dwdx[1] * interpolated_dwdx[1];
339 e_xy+= 0.5 * interpolated_dwdx[0] * interpolated_dwdx[1];
342 const double _nu =
nu();
344 double inv_denom=1.0/(1.0-_nu*_nu);
348 sigma(0,0) = (e_xx + _nu*e_yy)*inv_denom;
351 sigma(1,1) = (e_yy + _nu*e_xx)*inv_denom;
354 sigma(0,1) = sigma(1,0) = e_xy/(1.0+_nu);
364 const unsigned n_node =
nnode();
393 for(
unsigned l=0;l<n_node;l++)
396 nodal_value[0] = this->
nodal_value(l,w_nodal_index);
397 nodal_value[2] = this->
nodal_value(l,u_x_nodal_index);
398 nodal_value[3] = this->
nodal_value(l,u_y_nodal_index);
403 for(
unsigned j=0;j<2;j++)
405 interpolated_dwdx[j] += nodal_value[0]*dpsidx(l,j);
406 interpolated_duxdx[j] += nodal_value[2]*dpsidx(l,j);
407 interpolated_duydx[j] += nodal_value[3]*dpsidx(l,j);
416 interpolated_duxdx, interpolated_duydx);
421 strain(0,0) = interpolated_duxdx[0];
422 strain(0,0)+= 0.5 * interpolated_dwdx[0] * interpolated_dwdx[0];
425 strain(1,1) = interpolated_duydx[1];
426 strain(1,1)+= 0.5 * interpolated_dwdx[1] * interpolated_dwdx[1];
429 strain(0,1) = 0.5 * (interpolated_duxdx[1] + interpolated_duydx[0]);
430 strain(0,1)+= 0.5 * interpolated_dwdx[0] * interpolated_dwdx[1];
433 strain(1,0)=strain(0,1);
453 mass_matrix(
i,
i)+=1.0;
465 const unsigned n_node =
nnode();
468 Shape psi(n_node), test(n_node);
469 DShape dpsidx(n_node,2), dtestdx(n_node,2);
484 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
500 double interpolated_laplacian_w = 0;
511 for(
unsigned l=0;l<n_node;l++)
514 nodal_value[0] = this->
nodal_value(l,w_nodal_index);
515 nodal_value[1] = this->
nodal_value(l,laplacian_w_nodal_index);
516 nodal_value[2] = this->
nodal_value(l,u_x_nodal_index);
517 nodal_value[3] = this->
nodal_value(l,u_y_nodal_index);
520 interpolated_laplacian_w += nodal_value[1]*psi(l);
523 for(
unsigned j=0;j<2;j++)
526 interpolated_dwdx[j] += nodal_value[0]*dpsidx(l,j);
527 interpolated_dlaplacian_wdx[j] += nodal_value[1]*dpsidx(l,j);
528 interpolated_duxdx[j] += nodal_value[2]*dpsidx(l,j);
529 interpolated_duydx[j] += nodal_value[3]*dpsidx(l,j);
544 interpolated_duxdx, interpolated_duydx);
549 double pressure = 0.0;
556 for(
unsigned l=0;l<n_node;l++)
564 residuals[local_eqn] += pressure*test(l)*
W;
567 for(
unsigned k=0;k<2;k++)
569 residuals[local_eqn] +=
570 interpolated_dlaplacian_wdx[k]*dtestdx(l,k)*
W;
577 for (
unsigned alpha=0;alpha<2;alpha++)
580 for(
unsigned beta=0;beta<2;beta++)
582 residuals[local_eqn]-=
583 eta()*sigma(alpha,beta)*
584 interpolated_dwdx[alpha]*dtestdx(l,beta)*
W;
597 residuals[local_eqn] += interpolated_laplacian_w*test(l)*
W;
599 for(
unsigned k=0;k<2;k++)
601 residuals[local_eqn] += interpolated_dwdx[k]*dtestdx(l,k)*
W;
616 residuals[local_eqn] += traction[0]*test(l)*
W;
619 for(
unsigned beta=0;beta<2;beta++)
621 residuals[local_eqn] += sigma(0,beta)*dtestdx(l,beta)*
W;
633 residuals[local_eqn] += traction[1]*test(l)*
W;
636 for(
unsigned beta=0;beta<2;beta++)
638 residuals[local_eqn] += sigma(1,beta)*dtestdx(l,beta)*
W;
655 unsigned index=0)
const 658 const unsigned n_node =
nnode();
670 double interpolated_w = 0.0;
673 for(
unsigned l=0;l<n_node;l++)
675 interpolated_w += this->
nodal_value(l,w_nodal_index)*psi[l];
678 return(interpolated_w);
696 unsigned total_fvk_nodal_indices = 4;
699 unsigned n_node =
nnode();
702 for(
unsigned index=first_fvk_nodal_index+2;
704 index<first_fvk_nodal_index+total_fvk_nodal_indices;
708 for(
unsigned inod=0;inod<n_node;inod++)
767 template<
class FVK_ELEMENT>
784 std::stringstream error_stream;
786 <<
"Foeppl von Karman elements only store four fields so fld must be" 787 <<
"0 to 3 rather than " << fld << std::endl;
790 OOMPH_CURRENT_FUNCTION,
791 OOMPH_EXCEPTION_LOCATION);
796 unsigned nnod=this->
nnode();
800 for (
unsigned j=0;j<nnod;j++)
803 data_values[j]=std::make_pair(this->
node_pt(j),fld);
823 std::stringstream error_stream;
825 <<
"Foeppl von Karman elements only store four fields so fld must be" 826 <<
"0 to 3 rather than " << fld << std::endl;
829 OOMPH_CURRENT_FUNCTION,
830 OOMPH_EXCEPTION_LOCATION);
853 std::stringstream error_stream;
855 <<
"Foeppl von Karman elements only store four fields so fld must be" 856 <<
"0 to 3 rather than " << fld << std::endl;
859 OOMPH_CURRENT_FUNCTION,
860 OOMPH_EXCEPTION_LOCATION);
863 unsigned n_dim=this->
dim();
864 unsigned n_node=this->
nnode();
866 DShape dpsidx(n_node,n_dim), dtestdx(n_node,n_dim);
884 std::stringstream error_stream;
886 <<
"Foeppl von Karman elements only store four fields so fld must be" 887 <<
"0 to 3 rather than " << fld << std::endl;
890 OOMPH_CURRENT_FUNCTION,
891 OOMPH_EXCEPTION_LOCATION);
898 unsigned n_node=this->
nnode();
905 double interpolated_w = 0.0;
908 for(
unsigned l=0;l<n_node;l++)
910 interpolated_w += this->
nodal_value(t,l,w_nodal_index)*psi[l];
912 return interpolated_w;
924 std::stringstream error_stream;
926 <<
"Foeppl von Karman elements only store four fields so fld must be" 927 <<
"0 to 3 rather than " << fld << std::endl;
930 OOMPH_CURRENT_FUNCTION,
931 OOMPH_EXCEPTION_LOCATION);
934 return this->
nnode();
945 std::stringstream error_stream;
947 <<
"Foeppl von Karman elements only store four fields so fld must be" 948 <<
"0 to 3 rather than " << fld << std::endl;
951 OOMPH_CURRENT_FUNCTION,
952 OOMPH_EXCEPTION_LOCATION);
965 template<
class ELEMENT>
978 template<
class ELEMENT>
unsigned nvalue_of_field(const unsigned &fld)
Return number of values in field fld: One per node.
unsigned nhistory_values_for_projection(const unsigned &fld)
Number of history values to be stored for fld-th field. (Note: count includes current value!) ...
void(* FoepplvonKarmanPressureFctPt)(const Vector< double > &x, double &f)
Function pointer to pressure function fct(x,f(x)) – x is a Vector!
void broken_copy(const std::string &class_name)
Issue error message and terminate execution.
FoepplvonKarmanTractionFctPt & traction_fct_pt()
Access function: Pointer to in-plane traction function.
void output(std::ostream &outfile)
Output with default number of plot points.
unsigned long nrow() const
Return the number of rows of the matrix.
static double Default_Nu_Value
Default value for Poisson's ratio.
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...
virtual void get_traction_fvk(Vector< double > &x, Vector< double > &traction) const
Get in-plane traction term at (Eulerian) position x.
DisplacementBasedFoepplvonKarmanEquations()
Constructor (must initialise the Pressure_fct_pt and the Traction_fct_pt. Also set physical parameter...
double nodal_position(const unsigned &n, const unsigned &i) const
Return the i-th coordinate at local node n. If the node is hanging, the appropriate interpolation is ...
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 ...
void get_gradient_of_deflection(const Vector< double > &s, Vector< double > &gradient) const
Get gradient of deflection: gradient[i] = dw/dx_i.
unsigned nfields_for_projection()
Number of fields to be projected: Just two.
double *& eta_pt()
Pointer to eta.
void output(FILE *file_pt)
C_style output with default number of plot points.
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.
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 ...
FoepplvonKarmanTractionFctPt Traction_fct_pt
Pointer to traction function:
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.
double *& nu_pt()
Pointer to Poisson's ratio.
double * Eta_pt
Pointer to global eta.
void(* FoepplvonKarmanTractionFctPt)(const Vector< double > &x, Vector< double > &f)
Function pointer to traction function fct(x,f(x)) – x is a Vector!
unsigned nhistory_values_for_coordinate_projection()
Number of positional history values (Note: count includes current value!)
unsigned ndof() const
Return the number of equations/dofs in the element.
void use_linear_bending_model()
Sets a flag to signify that we are solving the linear, pure bending equations, and pin all the nodal ...
void(* SteadyExactSolutionFctPt)(const Vector< double > &, Vector< double > &)
Function pointer for function that computes vector-valued steady "exact solution" as ...
virtual double interpolated_x(const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s.
static double Default_Physical_Constant_Value
Default value for physical constants.
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...
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
const double & nu() const
Poisson's ratio.
void get_sigma(DenseMatrix< double > &sigma, const Vector< double > &interpolated_dwdx, const Vector< double > &interpolated_duxdx, const Vector< double > &interpolated_duydx)
FoepplvonKarmanTractionFctPt traction_fct_pt() const
Access function: Pointer to in-plane traction function. Const version.
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
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...
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 ...
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.
FoepplvonKarmanPressureFctPt & pressure_fct_pt()
Access function: Pointer to pressure function.
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...
unsigned ntstorage() const
Return the number of doubles required to represent history (one for steady)
void fill_in_contribution_to_jacobian_and_mass_matrix(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
hierher dummy
double * Nu_pt
Pointer to global Poisson's ratio.
unsigned ntstorage() const
Return total number of doubles stored per value to record time history of each value (one for steady ...
unsigned self_test()
Self-test: Return 0 for OK.
int local_equation(const unsigned &fld, const unsigned &j)
Return local equation number of field fld of node j.
FoepplvonKarmanPressureFctPt pressure_fct_pt() const
Access function: Pointer to pressure function. Const version.
unsigned dim() const
Return the spatial dimension of the element, i.e. the number of local coordinates required to paramet...
DisplacementBasedFoepplvonKarmanEquations(const DisplacementBasedFoepplvonKarmanEquations &dummy)
Broken copy constructor.
bool Linear_bending_model
Flag which stores whether we are using a linear, pure bending model instead of the full non-linear Fo...
void broken_assign(const std::string &class_name)
Issue error message and terminate execution.
FoepplvonKarmanPressureFctPt Pressure_fct_pt
Pointer to pressure function:
virtual unsigned nweight() const =0
Return the number of integration points of the scheme.
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 get_gradient_of_field(const Vector< double > &s, Vector< double > &gradient, const unsigned &index) const
Get gradient of field: gradient[i] = d[.]/dx_i,.
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 ...
const double & eta() const
Eta.
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 nnode() const
Return the number of nodes.
void get_stress_and_strain_for_output(const Vector< double > &s, DenseMatrix< double > &sigma, DenseMatrix< double > &strain)
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...
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Add the elemental contribution to the jacobian matrix. and the residuals vector. Note that this funct...
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 operator=(const DisplacementBasedFoepplvonKarmanEquations &)
Broken assignment operator.
Foeppl von Karman upgraded to become projectable.
void compute_error(std::ostream &outfile, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, double &error, double &norm)
Dummy, time dependent error checker.
void compute_error(std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
Get error against and norm of exact solution.
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...
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Fill in the residuals with this element's contribution.