5 #ifndef SCOUPLEDELEMENT_H
6 #define SCOUPLEDELEMENT_H
16 template<
class ELEMENT>
39 this->lagrangian_dimension(),
40 this->nnodal_lagrangian_type(),
41 this->nodal_dimension(),
42 this->nnodal_position_type(),
43 this->required_nvalue(
n));
45 return this->node_pt(
n);
59 this->lagrangian_dimension(),
60 this->nnodal_lagrangian_type(),
61 this->nodal_dimension(),
62 this->nnodal_position_type(),
63 this->required_nvalue(
n));
65 return this->node_pt(
n);
79 this->lagrangian_dimension(),
80 this->nnodal_lagrangian_type(),
81 this->nodal_dimension(),
82 this->nnodal_position_type(),
83 this->required_nvalue(
n));
85 return this->node_pt(
n);
101 this->lagrangian_dimension(),
102 this->nnodal_lagrangian_type(),
103 this->nodal_dimension(),
104 this->nnodal_position_type(),
105 this->required_nvalue(
n));
107 return this->node_pt(
n);
115 ELEMENT::fill_in_generic_contribution_to_residuals_pvd(
127 ELEMENT::fill_in_generic_contribution_to_residuals_pvd(residuals, jacobian, 1);
136 const unsigned DIM = this->dim();
147 unsigned n_intpt = this->integral_pt()->nweight();
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);
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;
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;
284 const unsigned n_node = this->nnode();
285 const unsigned DIM = this->dim();
288 unsigned n_position_type = this->nnodal_position_type();
296 for (
unsigned l = 0; l < n_node; l++)
299 for (
unsigned k = 0;
k < n_position_type;
k++)
302 for (
unsigned i = 0;
i <
DIM;
i++)
305 local_eqn = this->position_local_eqn(l,
k,
i);
315 logger(
VERBOSE,
"Apply nodal_coupling_residual element %",
this);
318 void output(std::ostream& outfile,
const unsigned& n_plot)
320 const unsigned DIM = this->dim();
326 outfile << this->tecplot_zone_string(n_plot);
329 unsigned num_plot_points = this->nplot_points(n_plot);
330 for (
unsigned iplot = 0; iplot < num_plot_points; iplot++)
333 this->get_s_plot(iplot, n_plot,
s);
336 this->interpolated_x(
s,
x);
344 for (
unsigned i = 0;
i <
DIM;
i++)
346 outfile <<
x[
i] <<
" ";
350 for (
unsigned i = 0;
i <
DIM;
i++)
352 outfile << dxdt[
i] <<
" ";
355 outfile << std::endl;
359 this->write_tecplot_zone_footer(outfile, n_plot);
360 outfile << std::endl;
372 template<
class ELEMENT>
int i
Definition: BiCGSTAB_step_by_step.cpp:9
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
JacobiRotation< float > J
Definition: Jacobi_makeJacobi.cpp:3
LL< Log::VERBOSE > VERBOSE
Verbose information.
Definition: Logger.cc:36
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
RowVector3d w
Definition: Matrix_resize_int.cpp:3
Definition: CoupledSolidNodes.h:20
FaceGeometry()
Constructor [this was only required explicitly from gcc 4.5.2 onwards...].
Definition: SCoupledElement.h:380
Definition: elements.h:4998
virtual double interpolated_dxdt(const Vector< double > &s, const unsigned &i, const unsigned &t)
Definition: elements.cc:4596
static DenseMatrix< double > Dummy_matrix
Definition: elements.h:227
Definition: SCoupledElement.h:18
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:123
void fill_in_contribution_to_residuals(Vector< double > &residuals)
Add the element's contribution to its residual vector (wrapper)
Definition: SCoupledElement.h:112
SCoupledElement()
Constructor: Call constructor of underlying element.
Definition: SCoupledElement.h:23
Node * construct_boundary_node(const unsigned &n, TimeStepper *const &time_stepper_pt)
Definition: SCoupledElement.h:93
Node * construct_boundary_node(const unsigned &n)
Definition: SCoupledElement.h:72
void output(std::ostream &outfile, const unsigned &n_plot)
Definition: SCoupledElement.h:318
Node * construct_node(const unsigned &n)
Definition: SCoupledElement.h:32
Node * construct_node(const unsigned &n, TimeStepper *const &time_stepper_pt)
Definition: SCoupledElement.h:52
void get_momentum_and_energy(double &mass, Vector< double > &lin_mo, Vector< double > &ang_mo, double &pot_en, double &kin_en)
Definition: SCoupledElement.h:133
~SCoupledElement()
Destructor (empty)
Definition: SCoupledElement.h:27
void set_nodal_coupling_residual(const bool &isCoupled, Vector< Vector< double >> &residual)
Definition: SCoupledElement.h:260
void add_external_coupling_forces_to_residuals(Vector< double > &residuals)
Add the point source contribution to the residual vector.
Definition: SCoupledElement.h:278
double get_nodal_coupling_residual(const unsigned n, const unsigned d)
Definition: SCoupledElement.h:268
Vector< Vector< double > > nodal_coupling_residual
Nodal coupling forces.
Definition: SCoupledElement.h:364
Definition: elements.h:3561
Definition: timesteppers.h:231
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
char char char int int * k
Definition: level2_impl.h:374
#define DIM
Definition: linearised_navier_stokes_elements.h:44
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
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
Definition: AnisotropicHookean.h:10
list x
Definition: plotDoE.py:28
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2