27 #ifndef OOMPH_FOEPPLVONKARMAN_DISPLACEMENT_ELEMENTS_HEADER
28 #define OOMPH_FOEPPLVONKARMAN_DISPLACEMENT_ELEMENTS_HEADER
32 #include <oomph-lib-config.h>
38 #include "../generic/projection.h"
39 #include "../generic/nodes.h"
40 #include "../generic/oomph_utilities.h"
91 const double&
nu()
const
132 const unsigned n_plot = 5;
138 void output(std::ostream& outfile,
const unsigned& n_plot);
143 const unsigned n_plot = 5;
149 void output(FILE* file_pt,
const unsigned& n_plot);
153 const unsigned& n_plot,
160 std::ostream& outfile,
161 const unsigned& n_plot,
166 "There is no time-dependent output_fct() for Foeppl von Karman"
188 "There is no time-dependent compute_error() for Foeppl von Karman"
224 double& pressure)
const
234 (*Pressure_fct_pt)(
x, pressure);
251 (*Traction_fct_pt)(
x, traction);
260 const unsigned n_node =
nnode();
278 for (
unsigned j = 0;
j < 2;
j++)
284 for (
unsigned l = 0; l < n_node; l++)
287 for (
unsigned j = 0;
j < 2;
j++)
289 gradient[
j] += this->
nodal_value(l, w_nodal_index) * dpsidx(l,
j);
302 const unsigned& index)
const
305 const unsigned n_node =
nnode();
323 for (
unsigned j = 0;
j < 2;
j++)
329 for (
unsigned l = 0; l < n_node; l++)
332 for (
unsigned j = 0;
j < 2;
j++)
334 gradient[
j] += this->
nodal_value(l, w_nodal_index) * dpsidx(l,
j);
347 double e_xx = interpolated_duxdx[0];
348 double e_yy = interpolated_duydx[1];
349 double e_xy = 0.5 * (interpolated_duxdx[1] + interpolated_duydx[0]);
350 e_xx += 0.5 * interpolated_dwdx[0] * interpolated_dwdx[0];
351 e_yy += 0.5 * interpolated_dwdx[1] * interpolated_dwdx[1];
352 e_xy += 0.5 * interpolated_dwdx[0] * interpolated_dwdx[1];
355 const double _nu =
nu();
357 double inv_denom = 1.0 / (1.0 - _nu * _nu);
361 sigma(0, 0) = (e_xx + _nu * e_yy) * inv_denom;
364 sigma(1, 1) = (e_yy + _nu * e_xx) * inv_denom;
367 sigma(0, 1) =
sigma(1, 0) = e_xy / (1.0 + _nu);
376 const unsigned n_node =
nnode();
406 for (
unsigned l = 0; l < n_node; l++)
416 for (
unsigned j = 0;
j < 2;
j++)
429 sigma, interpolated_dwdx, interpolated_duxdx, interpolated_duydx);
434 strain(0, 0) = interpolated_duxdx[0];
435 strain(0, 0) += 0.5 * interpolated_dwdx[0] * interpolated_dwdx[0];
438 strain(1, 1) = interpolated_duydx[1];
439 strain(1, 1) += 0.5 * interpolated_dwdx[1] * interpolated_dwdx[1];
442 strain(0, 1) = 0.5 * (interpolated_duxdx[1] + interpolated_duydx[0]);
443 strain(0, 1) += 0.5 * interpolated_dwdx[0] * interpolated_dwdx[1];
446 strain(1, 0) = strain(0, 1);
462 for (
unsigned i = 0;
i <
ndof;
i++)
464 mass_matrix(
i,
i) += 1.0;
473 const unsigned n_node =
nnode();
477 DShape dpsidx(n_node, 2), dtestdx(n_node, 2);
492 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
499 ipt, psi, dpsidx,
test, dtestdx);
508 double interpolated_laplacian_w = 0;
519 for (
unsigned l = 0; l < n_node; l++)
528 interpolated_laplacian_w +=
nodal_value[1] * psi(l);
531 for (
unsigned j = 0;
j < 2;
j++)
535 interpolated_dlaplacian_wdx[
j] +=
nodal_value[1] * dpsidx(l,
j);
552 sigma, interpolated_dwdx, interpolated_duxdx, interpolated_duydx);
557 double pressure = 0.0;
564 for (
unsigned l = 0; l < n_node; l++)
572 residuals[local_eqn] += pressure *
test(l) *
W;
575 for (
unsigned k = 0;
k < 2;
k++)
577 residuals[local_eqn] +=
578 interpolated_dlaplacian_wdx[
k] * dtestdx(l,
k) *
W;
591 interpolated_dwdx[
alpha] *
592 dtestdx(l,
beta) *
W;
605 residuals[local_eqn] += interpolated_laplacian_w *
test(l) *
W;
607 for (
unsigned k = 0;
k < 2;
k++)
609 residuals[local_eqn] += interpolated_dwdx[
k] * dtestdx(l,
k) *
W;
624 residuals[local_eqn] += traction[0] *
test(l) *
W;
640 residuals[local_eqn] += traction[1] *
test(l) *
W;
659 unsigned index = 0)
const
662 const unsigned n_node =
nnode();
674 double interpolated_w = 0.0;
677 for (
unsigned l = 0; l < n_node; l++)
679 interpolated_w += this->
nodal_value(l, w_nodal_index) * psi[l];
682 return (interpolated_w);
701 unsigned total_fvk_nodal_indices = 4;
704 unsigned n_node =
nnode();
707 for (
unsigned index = first_fvk_nodal_index + 2;
709 index < first_fvk_nodal_index + total_fvk_nodal_indices;
713 for (
unsigned inod = 0; inod < n_node; inod++)
729 DShape& dtestdx)
const = 0;
739 DShape& dtestdx)
const = 0;
770 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;
794 unsigned nnod = this->
nnode();
798 for (
unsigned j = 0;
j < nnod;
j++)
801 data_values[
j] = std::make_pair(this->
node_pt(
j), fld);
821 std::stringstream error_stream;
823 <<
"Foeppl von Karman elements only store four fields so fld must be"
824 <<
"0 to 3 rather than " << fld << std::endl;
849 std::stringstream error_stream;
851 <<
"Foeppl von Karman elements only store four fields so fld must be"
852 <<
"0 to 3 rather than " << fld << std::endl;
857 unsigned n_dim = this->
dim();
858 unsigned n_node = this->
nnode();
860 DShape dpsidx(n_node, n_dim), dtestdx(n_node, n_dim);
862 this->dshape_and_dtest_eulerian_fvk(
s, psi, dpsidx,
test, dtestdx);
876 std::stringstream error_stream;
878 <<
"Foeppl von Karman elements only store four fields so fld must be"
879 <<
"0 to 3 rather than " << fld << std::endl;
885 unsigned w_nodal_index = this->nodal_index_fvk(fld);
888 unsigned n_node = this->
nnode();
895 double interpolated_w = 0.0;
898 for (
unsigned l = 0; l < n_node; l++)
900 interpolated_w += this->
nodal_value(t, l, w_nodal_index) * psi[l];
902 return interpolated_w;
912 std::stringstream error_stream;
914 <<
"Foeppl von Karman elements only store four fields so fld must be"
915 <<
"0 to 3 rather than " << fld << std::endl;
920 return this->
nnode();
930 std::stringstream error_stream;
932 <<
"Foeppl von Karman elements only store four fields so fld must be"
933 <<
"0 to 3 rather than " << fld << std::endl;
938 const unsigned w_nodal_index = this->nodal_index_fvk(fld);
947 template<
class ELEMENT>
961 template<
class ELEMENT>
int i
Definition: BiCGSTAB_step_by_step.cpp:9
JacobiRotation< float > J
Definition: Jacobi_makeJacobi.cpp:3
RowVector3d w
Definition: Matrix_resize_int.cpp:3
void pin(const unsigned &i)
Pin the i-th stored variable.
Definition: nodes.h:385
unsigned ntstorage() const
Definition: nodes.cc:879
unsigned long nrow() const
Return the number of rows of the matrix.
Definition: matrices.h:485
Definition: displacement_based_foeppl_von_karman_elements.h:55
bool Linear_bending_model
Definition: displacement_based_foeppl_von_karman_elements.h:763
void compute_error(std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
Get error against and norm of exact solution.
Definition: displacement_based_foeppl_von_karman_elements.cc:229
void use_linear_bending_model()
Definition: displacement_based_foeppl_von_karman_elements.h:691
DisplacementBasedFoepplvonKarmanEquations(const DisplacementBasedFoepplvonKarmanEquations &dummy)=delete
Broken copy constructor.
unsigned self_test()
Self-test: Return 0 for OK.
Definition: displacement_based_foeppl_von_karman_elements.cc:48
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.
Definition: displacement_based_foeppl_von_karman_elements.cc:176
void get_stress_and_strain_for_output(const Vector< double > &s, DenseMatrix< double > &sigma, DenseMatrix< double > &strain)
Definition: displacement_based_foeppl_von_karman_elements.h:371
const double & nu() const
Poisson's ratio.
Definition: displacement_based_foeppl_von_karman_elements.h:91
FoepplvonKarmanPressureFctPt & pressure_fct_pt()
Access function: Pointer to pressure function.
Definition: displacement_based_foeppl_von_karman_elements.h:195
double * Nu_pt
Pointer to global Poisson's ratio.
Definition: displacement_based_foeppl_von_karman_elements.h:743
FoepplvonKarmanTractionFctPt traction_fct_pt() const
Access function: Pointer to in-plane traction function. Const version.
Definition: displacement_based_foeppl_von_karman_elements.h:213
virtual void output_fct(std::ostream &outfile, const unsigned &n_plot, const double &time, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt)
Definition: displacement_based_foeppl_von_karman_elements.h:159
DisplacementBasedFoepplvonKarmanEquations()
Definition: displacement_based_foeppl_von_karman_elements.h:70
FoepplvonKarmanPressureFctPt Pressure_fct_pt
Pointer to pressure function:
Definition: displacement_based_foeppl_von_karman_elements.h:749
void output(std::ostream &outfile)
Output with default number of plot points.
Definition: displacement_based_foeppl_von_karman_elements.h:130
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,.
Definition: displacement_based_foeppl_von_karman_elements.h:300
FoepplvonKarmanPressureFctPt pressure_fct_pt() const
Access function: Pointer to pressure function. Const version.
Definition: displacement_based_foeppl_von_karman_elements.h:201
virtual unsigned nodal_index_fvk(const unsigned &i=0) const
Definition: displacement_based_foeppl_von_karman_elements.h:124
virtual double dshape_and_dtest_eulerian_fvk(const Vector< double > &s, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const =0
virtual double dshape_and_dtest_eulerian_at_knot_fvk(const unsigned &ipt, Shape &psi, DShape &dpsidx, Shape &test, DShape &dtestdx) const =0
void operator=(const DisplacementBasedFoepplvonKarmanEquations &)=delete
Broken assignment operator.
void get_gradient_of_deflection(const Vector< double > &s, Vector< double > &gradient) const
Get gradient of deflection: gradient[i] = dw/dx_i.
Definition: displacement_based_foeppl_von_karman_elements.h:256
void fill_in_contribution_to_jacobian_and_mass_matrix(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
hierher dummy
Definition: displacement_based_foeppl_von_karman_elements.h:451
void(* FoepplvonKarmanPressureFctPt)(const Vector< double > &x, double &f)
Definition: displacement_based_foeppl_von_karman_elements.h:59
double *& nu_pt()
Pointer to Poisson's ratio.
Definition: displacement_based_foeppl_von_karman_elements.h:97
void compute_error(std::ostream &outfile, FiniteElement::UnsteadyExactSolutionFctPt exact_soln_pt, const double &time, double &error, double &norm)
Dummy, time dependent error checker.
Definition: displacement_based_foeppl_von_karman_elements.h:181
double interpolated_w_fvk(const Vector< double > &s, unsigned index=0) const
Definition: displacement_based_foeppl_von_karman_elements.h:658
void(* FoepplvonKarmanTractionFctPt)(const Vector< double > &x, Vector< double > &f)
Definition: displacement_based_foeppl_von_karman_elements.h:64
double * Eta_pt
Pointer to global eta.
Definition: displacement_based_foeppl_von_karman_elements.h:746
void output(FILE *file_pt)
C_style output with default number of plot points.
Definition: displacement_based_foeppl_von_karman_elements.h:141
void get_sigma(DenseMatrix< double > &sigma, const Vector< double > &interpolated_dwdx, const Vector< double > &interpolated_duxdx, const Vector< double > &interpolated_duydx)
Definition: displacement_based_foeppl_von_karman_elements.h:341
const double & eta() const
Eta.
Definition: displacement_based_foeppl_von_karman_elements.h:103
FoepplvonKarmanTractionFctPt & traction_fct_pt()
Access function: Pointer to in-plane traction function.
Definition: displacement_based_foeppl_von_karman_elements.h:207
virtual void get_pressure_fvk(const unsigned &ipt, const Vector< double > &x, double &pressure) const
Definition: displacement_based_foeppl_von_karman_elements.h:222
static double Default_Nu_Value
Default value for Poisson's ratio.
Definition: displacement_based_foeppl_von_karman_elements.h:756
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Fill in the residuals with this element's contribution.
Definition: displacement_based_foeppl_von_karman_elements.h:470
FoepplvonKarmanTractionFctPt Traction_fct_pt
Pointer to traction function:
Definition: displacement_based_foeppl_von_karman_elements.h:752
double *& eta_pt()
Pointer to eta.
Definition: displacement_based_foeppl_von_karman_elements.h:109
static double Default_Physical_Constant_Value
Default value for physical constants.
Definition: displacement_based_foeppl_von_karman_elements.h:759
virtual void get_traction_fvk(Vector< double > &x, Vector< double > &traction) const
Get in-plane traction term at (Eulerian) position x.
Definition: displacement_based_foeppl_von_karman_elements.h:239
FaceGeometry()
Definition: displacement_based_foeppl_von_karman_elements.h:967
FaceGeometry()
Definition: displacement_based_foeppl_von_karman_elements.h:953
Definition: elements.h:4998
Definition: elements.h:1313
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Definition: elements.h:1735
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
Definition: elements.h:2175
double nodal_value(const unsigned &n, const unsigned &i) const
Definition: elements.h:2593
virtual double interpolated_x(const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s.
Definition: elements.cc:3962
virtual void shape(const Vector< double > &s, Shape &psi) const =0
int nodal_local_eqn(const unsigned &n, const unsigned &i) const
Definition: elements.h:1432
unsigned dim() const
Definition: elements.h:2611
unsigned nnode() const
Return the number of nodes.
Definition: elements.h:2210
void(* SteadyExactSolutionFctPt)(const Vector< double > &, Vector< double > &)
Definition: elements.h:1759
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
Definition: elements.h:1963
double nodal_position(const unsigned &n, const unsigned &i) const
Definition: elements.h:2317
void(* UnsteadyExactSolutionFctPt)(const double &, const Vector< double > &, Vector< double > &)
Definition: elements.h:1765
double dshape_eulerian(const Vector< double > &s, Shape &psi, DShape &dpsidx) const
Definition: elements.cc:3298
unsigned ndof() const
Return the number of equations/dofs in the element.
Definition: elements.h:835
virtual unsigned nweight() const =0
Return the number of integration points of the scheme.
virtual double weight(const unsigned &i) const =0
Return weight of i-th integration point.
TimeStepper *& position_time_stepper_pt()
Return a pointer to the position timestepper.
Definition: nodes.h:1022
Definition: oomph_definitions.h:222
Foeppl von Karman upgraded to become projectable.
Definition: displacement_based_foeppl_von_karman_elements.h:773
double jacobian_and_shape_of_field(const unsigned &fld, const Vector< double > &s, Shape &psi)
Definition: displacement_based_foeppl_von_karman_elements.h:842
int local_equation(const unsigned &fld, const unsigned &j)
Return local equation number of field fld of node j.
Definition: displacement_based_foeppl_von_karman_elements.h:925
unsigned nfields_for_projection()
Number of fields to be projected: Just two.
Definition: displacement_based_foeppl_von_karman_elements.h:809
unsigned nhistory_values_for_coordinate_projection()
Definition: displacement_based_foeppl_von_karman_elements.h:835
unsigned nhistory_values_for_projection(const unsigned &fld)
Definition: displacement_based_foeppl_von_karman_elements.h:816
double get_field(const unsigned &t, const unsigned &fld, const Vector< double > &s)
Definition: displacement_based_foeppl_von_karman_elements.h:869
unsigned nvalue_of_field(const unsigned &fld)
Return number of values in field fld: One per node.
Definition: displacement_based_foeppl_von_karman_elements.h:907
Vector< std::pair< Data *, unsigned > > data_values_of_field(const unsigned &fld)
Definition: displacement_based_foeppl_von_karman_elements.h:779
Definition: projection.h:183
unsigned ntstorage() const
Definition: timesteppers.h:601
static int f(const TensorMap< Tensor< int, 3 > > &tensor)
Definition: cxx11_tensor_map.cpp:237
RealScalar s
Definition: level1_cplx_impl.h:130
RealScalar alpha
Definition: level1_cplx_impl.h:151
Scalar beta
Definition: level2_cplx_impl.h:36
char char char int int * k
Definition: level2_impl.h:374
squared absolute sa ArrayBase::abs2 DOXCOMMA MatrixBase::cwiseAbs2 sa Eigen::abs2 DOXCOMMA Eigen::pow DOXCOMMA ArrayBase::square nearest sa Eigen::floor DOXCOMMA Eigen::ceil DOXCOMMA ArrayBase::round nearest integer not less than the given sa Eigen::floor DOXCOMMA ArrayBase::ceil not a number test
Definition: GlobalFunctions.h:109
int error
Definition: calibrate.py:297
int sigma
Definition: calibrate.py:179
@ W
Definition: quadtree.h:63
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
Definition: AnisotropicHookean.h:10
list x
Definition: plotDoE.py:28
t
Definition: plotPSD.py:36
Definition: indexed_view.cpp:20
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2