136 const unsigned DIM = this->dim();
147 unsigned n_intpt = this->integral_pt()->nweight();
150 Vector<double>
s(
DIM);
153 const unsigned n_node = this->nnode();
156 const unsigned n_position_type = this->nnodal_position_type();
159 Shape psi(n_node, n_position_type);
160 DShape dpsidxi(n_node, n_position_type,
DIM);
163 double lambda_sq = this->lambda_sq();
166 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
169 for (
unsigned i = 0;
i <
DIM;
i++)
170 {
s[
i] = this->integral_pt()->knot(ipt,
i); }
173 double w = this->integral_pt()->weight(ipt);
176 double J = this->dshape_lagrangian_at_knot(ipt, psi, dpsidxi);
179 Vector<double> interpolated_xi(
DIM, 0.0);
180 Vector<double> veloc(
DIM, 0.0);
183 for (
unsigned l = 0; l < n_node; l++)
186 for (
unsigned k = 0;
k < n_position_type;
k++)
189 for (
unsigned i = 0;
i <
DIM;
i++)
192 interpolated_xi[
i] += this->lagrangian_position_gen(l,
k,
i) * psi(l,
k);
197 veloc[
i] += this->dnodal_position_gen_dt(l,
k,
i) * psi(l,
k);
205 this->get_isotropic_growth(ipt,
s, interpolated_xi,
gamma);
215 this->get_stress(
s,
sigma);
218 for (
unsigned i = 0;
i <
DIM;
i++)
220 for (
unsigned j = 0;
j <
DIM;
j++)
222 sigma(
i,
j) += this->prestress(
i,
j, interpolated_xi);
227 this->get_strain(
s, strain);
230 double local_pot_en = 0;
234 for (
unsigned i = 0;
i <
DIM;
i++)
236 for (
unsigned j = 0;
j <
DIM;
j++)
238 local_pot_en +=
sigma(
i,
j) * strain(
i,
j);
240 veloc_sq += veloc[
i] * veloc[
i];
244 mass += lambda_sq *
W;
246 Vector<double> cross_product(
DIM, 0);
248 for (
unsigned i = 0;
i <
DIM;
i++)
250 lin_mo[
i] += lambda_sq * veloc[
i] *
W;
251 ang_mo[
i] += lambda_sq * cross_product[
i] *
W;
254 pot_en += 0.5 * local_pot_en *
W;
256 kin_en += lambda_sq * 0.5 * veloc_sq *
W;
JacobiRotation< float > J
Definition: Jacobi_makeJacobi.cpp:3
RowVector3d w
Definition: Matrix_resize_int.cpp:3
void initialise(const _Tp &__value)
Iterate over all values and set to the desired value.
Definition: oomph-lib/src/generic/Vector.h:167
RealScalar s
Definition: level1_cplx_impl.h:130
int sigma
Definition: calibrate.py:179
Mdouble gamma(Mdouble gamma_in)
This is the gamma function returns the true value for the half integer value.
Definition: ExtendedMath.cc:116
@ W
Definition: quadtree.h:63
void cross(const Vector< double > &A, const Vector< double > &B, Vector< double > &C)
Definition: oomph-lib/src/generic/Vector.h:319
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2