26 #ifndef SCOUPLEDELEMENT_H
27 #define SCOUPLEDELEMENT_H
37 template<
class ELEMENT>
60 this->lagrangian_dimension(),
61 this->nnodal_lagrangian_type(),
62 this->nodal_dimension(),
63 this->nnodal_position_type(),
64 this->required_nvalue(
n));
66 return this->node_pt(
n);
80 this->lagrangian_dimension(),
81 this->nnodal_lagrangian_type(),
82 this->nodal_dimension(),
83 this->nnodal_position_type(),
84 this->required_nvalue(
n));
86 return this->node_pt(
n);
99 this->node_pt(
n) =
new BoundaryNode<CoupledSolidNode>(
100 this->lagrangian_dimension(),
101 this->nnodal_lagrangian_type(),
102 this->nodal_dimension(),
103 this->nnodal_position_type(),
104 this->required_nvalue(
n));
106 return this->node_pt(
n);
115 TimeStepper*
const& time_stepper_pt)
120 this->node_pt(
n) =
new BoundaryNode<CoupledSolidNode>(
122 this->lagrangian_dimension(),
123 this->nnodal_lagrangian_type(),
124 this->nodal_dimension(),
125 this->nnodal_position_type(),
126 this->required_nvalue(
n));
128 return this->node_pt(
n);
136 ELEMENT::fill_in_generic_contribution_to_residuals_pvd(
137 residuals, GeneralisedElement::Dummy_matrix, 0);
145 DenseMatrix<double>& jacobian)
148 ELEMENT::fill_in_generic_contribution_to_residuals_pvd(residuals, jacobian, 1);
157 const unsigned DIM = this->dim();
161 lin_mo.initialise(0);
162 ang_mo.initialise(0);
168 unsigned n_intpt = this->integral_pt()->nweight();
171 Vector<double> s(DIM);
174 const unsigned n_node = this->nnode();
177 const unsigned n_position_type = this->nnodal_position_type();
180 Shape psi(n_node, n_position_type);
181 DShape dpsidxi(n_node, n_position_type, DIM);
184 double lambda_sq = this->lambda_sq();
187 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
190 for (
unsigned i = 0;
i < DIM;
i++)
191 { s[
i] = this->integral_pt()->knot(ipt,
i); }
194 double w = this->integral_pt()->weight(ipt);
197 double J = this->dshape_lagrangian_at_knot(ipt, psi, dpsidxi);
200 Vector<double> interpolated_xi(DIM, 0.0);
201 Vector<double> veloc(DIM, 0.0);
204 for (
unsigned l = 0; l < n_node; l++)
207 for (
unsigned k = 0; k < n_position_type; k++)
210 for (
unsigned i = 0;
i < DIM;
i++)
213 interpolated_xi[
i] += this->lagrangian_position_gen(l, k,
i) * psi(l, k);
218 veloc[
i] += this->dnodal_position_gen_dt(l, k,
i) * psi(l, k);
226 this->get_isotropic_growth(ipt, s, interpolated_xi,
gamma);
230 double W =
gamma * w * J;
232 DenseMatrix<double> sigma(DIM, DIM);
233 DenseMatrix<double> strain(DIM, DIM);
236 this->get_stress(s, sigma);
239 for (
unsigned i = 0;
i < DIM;
i++)
241 for (
unsigned j = 0; j < DIM; j++)
243 sigma(
i, j) += this->prestress(
i, j, interpolated_xi);
248 this->get_strain(s, strain);
251 double local_pot_en = 0;
255 for (
unsigned i = 0;
i < DIM;
i++)
257 for (
unsigned j = 0; j < DIM; j++)
259 local_pot_en += sigma(
i, j) * strain(
i, j);
261 veloc_sq += veloc[
i] * veloc[
i];
265 mass += lambda_sq * W;
267 Vector<double> cross_product(DIM, 0);
268 VectorHelpers::cross(interpolated_xi, veloc, cross_product);
269 for (
unsigned i = 0;
i < DIM;
i++)
271 lin_mo[
i] += lambda_sq * veloc[
i] * W;
272 ang_mo[
i] += lambda_sq * cross_product[
i] * W;
275 pot_en += 0.5 * local_pot_en * W;
277 kin_en += lambda_sq * 0.5 * veloc_sq * W;
305 const unsigned n_node = this->nnode();
306 const unsigned DIM = this->dim();
309 unsigned n_position_type = this->nnodal_position_type();
317 for (
unsigned l = 0; l < n_node; l++)
320 for (
unsigned k = 0; k < n_position_type; k++)
323 for (
unsigned i = 0;
i < DIM;
i++)
326 local_eqn = this->position_local_eqn(l, k,
i);
338 void output(std::ostream& outfile,
const unsigned& n_plot)
340 const unsigned DIM = this->dim();
341 Vector<double> x(DIM);
342 Vector<double> dxdt(DIM);
343 Vector<double> s(DIM);
346 outfile << this->tecplot_zone_string(n_plot);
349 unsigned num_plot_points = this->nplot_points(n_plot);
350 for (
unsigned iplot = 0; iplot < num_plot_points; iplot++)
353 this->get_s_plot(iplot, n_plot, s);
356 this->interpolated_x(s, x);
357 SolidFiniteElement* el_pt =
dynamic_cast<SolidFiniteElement*
>(
this);
358 el_pt->interpolated_dxdt(s, 1, dxdt);
364 for (
unsigned i = 0;
i < DIM;
i++)
366 outfile << x[
i] <<
" ";
370 for (
unsigned i = 0;
i < DIM;
i++)
372 outfile << dxdt[
i] <<
" ";
375 outfile << std::endl;
379 this->write_tecplot_zone_footer(outfile, n_plot);
380 outfile << std::endl;
392 template<
class ELEMENT>
const unsigned n
Definition: CG3DPackingUnitTest.cpp:32
Definition: CoupledSolidNodes.h:16
FaceGeometry()
Constructor [this was only required explicitly from gcc 4.5.2 onwards...].
Definition: SCoupledElement.h:400
Definition: SCoupledElement.h:39
void fill_in_contribution_to_jacobian(Vector< double > &residuals, DenseMatrix< double > &jacobian)
Add the element's contribution to its residual vector and Jacobian matrix (wrapper)
Definition: SCoupledElement.h:144
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Add the element's contribution to its residual vector (wrapper)
Definition: SCoupledElement.h:133
SCoupledElement()
Constructor: Call constructor of underlying element.
Definition: SCoupledElement.h:44
Node * construct_boundary_node(const unsigned &n, TimeStepper *const &time_stepper_pt)
Definition: SCoupledElement.h:114
Node * construct_boundary_node(const unsigned &n)
Definition: SCoupledElement.h:93
void output(std::ostream &outfile, const unsigned &n_plot)
Definition: SCoupledElement.h:338
Node * construct_node(const unsigned &n)
Definition: SCoupledElement.h:53
Node * construct_node(const unsigned &n, TimeStepper *const &time_stepper_pt)
Definition: SCoupledElement.h:73
void get_momentum_and_energy(double &mass, Vector< double > &lin_mo, Vector< double > &ang_mo, double &pot_en, double &kin_en)
Definition: SCoupledElement.h:154
~SCoupledElement()
Destructor (empty)
Definition: SCoupledElement.h:48
void set_nodal_coupling_residual(const bool &isCoupled, Vector< Vector< double >> &residual)
Definition: SCoupledElement.h:281
void add_external_coupling_forces_to_residuals(Vector< double > &residuals)
Add the point source contribution to the residual vector.
Definition: SCoupledElement.h:299
double get_nodal_coupling_residual(const unsigned n, const unsigned d)
Definition: SCoupledElement.h:289
Vector< Vector< double > > nodal_coupling_residual
Nodal coupling forces.
Definition: SCoupledElement.h:384
const std::complex< Mdouble > i
Definition: ExtendedMath.h:51
Mdouble gamma(Mdouble gamma_in)
This is the gamma function returns the true value for the half integer value.
Definition: ExtendedMath.cc:137
Definition: AnisotropicHookean.h:31