9 #ifndef MERCURYDPM_REFINEABLEQDPVDELEMENT_H
10 #define MERCURYDPM_REFINEABLEQDPVDELEMENT_H
21 template<
unsigned DIM,
unsigned NNODE_1D>
31 const unsigned& flag )
39 throw OomphLibError(
"RefineablePVDEquations cannot be used with "
40 "incompressible constitutive laws.",
54 const unsigned n_node = this->
nnode();
66 double time_factor = 0.0;
67 double time_factor1 = 0.0;
75 Shape psi(n_node, n_position_type);
76 DShape dpsidxi(n_node, n_position_type,
DIM);
85 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
88 for (
unsigned i = 0;
i <
DIM; ++
i)
110 for (
unsigned l = 0; l < n_node; l++)
113 for (
unsigned k = 0;
k < n_position_type;
k++)
115 double psi_ = psi(l,
k);
117 for (
unsigned i = 0;
i <
DIM;
i++)
133 for (
unsigned j = 0;
j <
DIM;
j++)
135 interpolated_G(
j,
i) +=
155 for (
unsigned i = 0;
i <
DIM;
i++)
157 for (
unsigned j = 0;
j <
DIM;
j++)
161 g(
i,
j) = diag_entry;
178 for (
unsigned i = 0;
i <
DIM;
i++)
181 for (
unsigned j =
i;
j <
DIM;
j++)
186 for (
unsigned k = 0;
k <
DIM;
k++)
188 G(
i,
j) += interpolated_G(
i,
k) * interpolated_G(
j,
k);
192 for (
unsigned j = 0;
j <
i;
j++)
209 n_node, n_position_type,
DIM,
DIM,
DIM, 0.0);
219 for (
unsigned ll = 0; ll < n_node; ll++)
221 for (
unsigned kk = 0; kk < n_position_type; kk++)
223 for (
unsigned ii = 0; ii <
DIM; ii++)
225 for (
unsigned aa = 0; aa <
DIM; aa++)
227 for (
unsigned bb = aa; bb <
DIM; bb++)
229 d_G_dX(ll, kk, ii, aa, bb) =
230 interpolated_G(aa, ii) * dpsidxi(ll, kk, bb) +
231 interpolated_G(bb, ii) * dpsidxi(ll, kk, aa);
246 for (
unsigned i = 0;
i <
DIM;
i++)
248 for (
unsigned j = 0;
j <
DIM;
j++)
259 unsigned n_master = 1;
260 double hang_weight = 1.0;
263 for (
unsigned l = 0; l < n_node; l++)
269 bool is_hanging = local_node_pt->
is_hanging();
288 for (
unsigned m = 0;
m < n_master;
m++)
302 for (
unsigned k = 0;
k < n_position_type;
k++)
305 for (
unsigned i = 0;
i <
DIM;
i++)
316 for (
unsigned k = 0;
k < n_position_type;
k++)
319 const unsigned offset5 = dpsidxi.
offset(l,
k);
322 for (
unsigned i = 0;
i <
DIM;
i++)
324 local_eqn = position_local_eqn_at_node(
k,
i);
336 for (
unsigned a = 0;
a <
DIM;
a++)
338 unsigned count = offset5;
339 for (
unsigned b = 0;
b <
DIM;
b++)
342 sum +=
sigma(
a,
b) * interpolated_G(
a,
i) *
347 residuals[local_eqn] +=
W * sum * hang_weight;
354 const unsigned offset1 = d_G_dX.
offset(l,
k,
i);
357 unsigned nn_master = 1;
358 double hhang_weight = 1.0;
361 for (
unsigned ll = 0; ll < n_node; ll++)
367 bool iis_hanging = llocal_node_pt->
is_hanging();
387 for (
unsigned mm = 0; mm < nn_master; mm++)
402 for (
unsigned kk = 0; kk < n_position_type; kk++)
405 for (
unsigned ii = 0; ii <
DIM; ii++)
407 position_local_unk_at_node(kk, ii) =
418 for (
unsigned kk = 0; kk < n_position_type; kk++)
421 for (
unsigned ii = 0; ii <
DIM; ii++)
425 position_local_unk_at_node(kk, ii);
429 if (local_unknown >= 0)
432 const unsigned offset2 = d_G_dX.
offset(ll, kk, ii);
433 const unsigned offset4 = dpsidxi.
offset(ll, kk);
439 unsigned count1 = offset1;
440 for (
unsigned a = 0;
a <
DIM;
a++)
445 for (
unsigned b =
a;
b <
DIM;
b++)
449 if (
a ==
b) factor *= 0.5;
452 unsigned offset3 = d_stress_dG.
offset(
a,
b);
453 unsigned count2 = offset2;
454 unsigned count3 = offset3;
456 for (
unsigned aa = 0; aa <
DIM; aa++)
465 for (
unsigned bb = aa; bb <
DIM; bb++)
481 jacobian(local_eqn, local_unknown) +=
482 sum *
W * hang_weight * hhang_weight;
486 if ((
i == ii) && (local_unknown >= local_eqn))
492 sum +=
lambda_sq * time_factor * psi(ll, kk) *
495 * time_factor1 * psi(ll,kk) * psi(l,
k);
498 unsigned count4 = offset4;
499 for (
unsigned a = 0;
a <
DIM;
a++)
502 const double factor =
506 unsigned count5 = offset5;
507 for (
unsigned b = 0;
b <
DIM;
b++)
518 sum *
W * hang_weight * hhang_weight;
520 jacobian(local_eqn, local_unknown) += sym_entry;
522 if (local_eqn != local_unknown)
524 jacobian(local_unknown, local_eqn) += sym_entry;
552 if (cast_father_element_pt)
558 throw OomphLibError(
"Could not cast father_element_pt to RefineableQDPVDElement.",
580 template<
unsigned NNODE_1D>
593 template<
unsigned NNODE_1D>
607 template<
unsigned NNODE_1D>
620 template<
unsigned NNODE_1D>
int i
Definition: BiCGSTAB_step_by_step.cpp:9
JacobiRotation< float > G
Definition: Jacobi_makeGivens.cpp:2
JacobiRotation< float > J
Definition: Jacobi_makeJacobi.cpp:3
RowVector3d w
Definition: Matrix_resize_int.cpp:3
Scalar * b
Definition: benchVecAdd.cpp:17
virtual bool requires_incompressibility_constraint()=0
unsigned offset(const unsigned long &i, const unsigned long &j) const
Definition: shape.h:487
double & raw_direct_access(const unsigned long &i)
Definition: shape.h:469
FaceGeometry()
Definition: RefineableQDPVDElement.h:600
FaceGeometry()
Definition: RefineableQDPVDElement.h:627
FaceGeometry()
Definition: RefineableQDPVDElement.h:587
FaceGeometry()
Definition: RefineableQDPVDElement.h:614
Definition: elements.h:4998
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
Definition: elements.h:2175
unsigned nnodal_position_type() const
Definition: elements.h:2463
double dnodal_position_gen_dt(const unsigned &n, const unsigned &k, const unsigned &i) const
Definition: elements.h:2369
double nodal_position_gen(const unsigned &n, const unsigned &k, const unsigned &i) const
Definition: elements.h:2349
unsigned nnode() const
Return the number of nodes.
Definition: elements.h:2210
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
Definition: elements.h:1963
double const & master_weight(const unsigned &i) const
Return weight for dofs on i-th master node.
Definition: nodes.h:808
Node *const & master_node_pt(const unsigned &i) const
Return a pointer to the i-th master node.
Definition: nodes.h:791
unsigned nmaster() const
Return the number of master nodes.
Definition: nodes.h:785
virtual double knot(const unsigned &i, const unsigned &j) const =0
Return local coordinate s[j] of i-th integration point.
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.
HangInfo *const & hanging_pt() const
Definition: nodes.h:1228
TimeStepper *& position_time_stepper_pt()
Return a pointer to the position timestepper.
Definition: nodes.h:1022
bool is_hanging() const
Test whether the node is geometrically hanging.
Definition: nodes.h:1285
Definition: oomph_definitions.h:222
bool Unsteady
Flag that switches inertia on/off.
Definition: solid_elements.h:421
ConstitutiveLaw * Constitutive_law_pt
Pointer to the constitutive law.
Definition: solid_elements.h:415
double prestress(const unsigned &i, const unsigned &j, const Vector< double > xi)
Definition: solid_elements.h:393
virtual void get_isotropic_growth(const unsigned &ipt, const Vector< double > &s, const Vector< double > &xi, double &gamma) const
Definition: solid_elements.h:267
void body_force(const Vector< double > &xi, Vector< double > &b) const
Definition: solid_elements.h:287
const double & lambda_sq() const
Access function for timescale ratio (nondim density)
Definition: solid_elements.h:108
void get_d_stress_dG_upper(const DenseMatrix< double > &g, const DenseMatrix< double > &G, const DenseMatrix< double > &sigma, RankFourTensor< double > &d_sigma_dG)
Definition: solid_elements.h:569
void get_stress(const Vector< double > &s, DenseMatrix< double > &sigma)
Definition: solid_elements.cc:951
Definition: elements.h:3439
A Rank 5 Tensor class.
Definition: matrices.h:2113
T & raw_direct_access(const unsigned long &i)
Definition: matrices.h:2545
unsigned offset(const unsigned long &i, const unsigned long &j, const unsigned long &k) const
Definition: matrices.h:2564
A Rank 4 Tensor class.
Definition: matrices.h:1701
T & raw_direct_access(const unsigned long &i)
Definition: matrices.h:2078
unsigned offset(const unsigned long &i, const unsigned long &j) const
Definition: matrices.h:2096
virtual RefineableElement * father_element_pt() const
Return a pointer to the father element.
Definition: refineable_elements.h:539
void further_build()
Further build function, pass the pointers down to the sons.
Definition: refineable_solid_elements.h:144
Definition: RefineableQDPVDElement.h:23
void further_build() override
Pass the dissipation down to sons.
Definition: RefineableQDPVDElement.h:544
void setDissipation(double dissipation)
Definition: RefineableQDPVDElement.h:568
RefineableQDPVDElement()
Definition: RefineableQDPVDElement.h:26
double getDissipation()
Definition: RefineableQDPVDElement.h:572
double dissipation_
Definition: RefineableQDPVDElement.h:564
void fill_in_generic_contribution_to_residuals_pvd(Vector< double > &residuals, DenseMatrix< double > &jacobian, const unsigned &flag)
Definition: RefineableQDPVDElement.h:28
Class for refineable QPVDElement elements.
Definition: refineable_solid_elements.h:181
DenseMatrix< int > & local_position_hang_eqn(Node *const &node_pt)
Definition: refineable_elements.h:1005
double lagrangian_position_gen(const unsigned &n, const unsigned &k, const unsigned &i) const
Definition: elements.h:3912
SolidInitialCondition * Solid_ic_pt
Pointer to object that specifies the initial condition.
Definition: elements.h:4131
int position_local_eqn(const unsigned &n, const unsigned &k, const unsigned &j) const
Definition: elements.h:4137
virtual void get_residuals_for_solid_ic(Vector< double > &residuals)
Definition: elements.h:4003
virtual double interpolated_xi(const Vector< double > &s, const unsigned &i) const
Definition: elements.cc:7104
virtual double dshape_lagrangian_at_knot(const unsigned &ipt, Shape &psi, DShape &dpsidxi) const
Definition: elements.cc:6737
Definition: Qelements.h:1742
virtual double weight(const unsigned &i, const unsigned &j) const
Access function for j-th weight for the i-th derivative.
Definition: timesteppers.h:594
RealScalar s
Definition: level1_cplx_impl.h:130
const Scalar * a
Definition: level2_cplx_impl.h:32
int * m
Definition: level2_cplx_impl.h:294
char char char int int * k
Definition: level2_impl.h:374
#define DIM
Definition: linearised_navier_stokes_elements.h:44
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 pow(const bfloat16 &a, const bfloat16 &b)
Definition: BFloat16.h:625
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
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
Definition: AnisotropicHookean.h:10
#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