31 std::ostream& outfile,
32 const unsigned& n_plot)
35 const unsigned n_node =
nnode();
47 const double inverse_timescale = this->
omega();
50 for (
unsigned i = 0;
i < n_plot;
i++)
53 s[0] = -1.0 + 2.0 *
i / ((double)(n_plot - 1));
59 double interpolated_time = 0.0;
60 for (
unsigned l = 0; l < n_node; l++)
73 outfile, n_plot, interpolated_time / inverse_timescale);
86 const unsigned n_node =
nnode();
89 Shape psi(n_node), test(n_node);
90 DShape dpsidt(n_node, 1), dtestdt(n_node, 1);
96 int local_eqn = 0, local_unknown = 0;
99 const unsigned n_elem_dof = elem_pt->
ndof();
106 el_mass.
resize(n_elem_dof, n_elem_dof);
107 el_jacobian.
resize(n_elem_dof, n_elem_dof);
129 const double inverse_timescale = this->
omega();
132 for (
unsigned ipt = 0; ipt < n_intpt; ipt++)
139 ipt, psi, dpsidt, test, dtestdt);
146 double interpolated_time = 0.0;
147 for (
unsigned l = 0; l < n_node; l++)
154 this->
time_pt()->
time() = interpolated_time / inverse_timescale;
162 el_residuals, el_jacobian, el_mass);
173 for (
unsigned l = 0; l < n_node; l++)
182 unsigned offset = this->
eqn_number(local_eqn) * n_elem_dof;
184 for (
unsigned i = 0;
i < n_elem_dof;
i++)
186 residuals[
i + offset] += el_residuals[
i] * psi(l) *
W;
196 for (
unsigned l2 = 0; l2 < n_node; l2++)
199 if (local_unknown >= 0)
202 unsigned offset2 = this->
eqn_number(local_unknown) * n_elem_dof;
204 for (
unsigned i = 0;
i < n_elem_dof;
i++)
206 for (
unsigned j = 0; j < n_elem_dof; j++)
209 jacobian(
i + offset, j + offset2) +=
210 el_jacobian(
i, j) * psi(l2) * psi(l) *
W;
213 jacobian(
i + offset, j + offset2) -=
214 el_mass(
i, j) * dpsidt(l2, 0) * inverse_timescale *
223 for (
unsigned i = 0;
i < n_elem_dof;
i++)
225 for (
unsigned j = 0; j < n_elem_dof; j++)
227 jacobian(
i + offset,
Ntstorage * n_elem_dof) -=
228 el_mass(
i, j) * (du_dt[j] / inverse_timescale) * psi(l) *
W;
245 all_previous_unknowns);
257 for (
unsigned i = 0;
i < n_elem_dof;
i++)
259 for (
unsigned j = 0; j < n_elem_dof; j++)
261 sum += u[
i] * inner_product(
i, j) * du_dt_old[j];
272 for (
unsigned l2 = 0; l2 < n_node; l2++)
276 if (local_unknown >= 0)
279 unsigned offset2 = this->
eqn_number(local_unknown) * n_elem_dof;
281 for (
unsigned i2 = 0; i2 < n_elem_dof; i2++)
284 for (
unsigned j = 0; j < n_elem_dof; j++)
286 sum2 += inner_product(i2, j) * du_dt_old[j];
288 jacobian(
Ntstorage * n_elem_dof, i2 + offset2) +=
A Class for the derivatives of shape functions The class design is essentially the same as Shape,...
void resize(const unsigned long &n)
Resize to a square nxn matrix; any values already present will be transfered.
int nodal_local_eqn(const unsigned &n, const unsigned &i) const
Return the local equation number corresponding to the i-th value at the n-th local node.
unsigned nnode() const
Return the number of nodes.
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
double dshape_eulerian(const Vector< double > &s, Shape &psi, DShape &dpsidx) const
Compute the geometric shape functions and also first derivatives w.r.t. global coordinates at local c...
double raw_nodal_position(const unsigned &n, const unsigned &i) const
Return the i-th coordinate at local node n. Do not use the hanging node representation....
A Generalised Element class.
unsigned ndof() const
Return the number of equations/dofs in the element.
unsigned long eqn_number(const unsigned &ieqn_local) const
Return the global equation number corresponding to the ieqn_local-th local equation number.
virtual void get_residuals(Vector< double > &residuals)
Calculate the vector of residuals of the equations in the element. By default initialise the vector t...
virtual void get_jacobian_and_mass_matrix(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
Calculate the residuals and jacobian and elemental "mass" matrix, the matrix that multiplies the time...
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.
=============================================================== Base class to avoid template complica...
virtual void set_dofs_for_element(GeneralisedElement *const elem_pt, Vector< double > const &dofs)=0
virtual void get_dofs_for_element(GeneralisedElement *const elem_pt, Vector< double > &dofs)=0
virtual void get_previous_dofs_for_element(GeneralisedElement *const elem_pt, Vector< double > &dofs)=0
virtual void get_non_external_ddofs_dt(Vector< double > &du_dt)
Interface to get the current value of the time derivative of all (internal and shared) unknowns.
virtual void spacetime_output(std::ostream &outilfe, const unsigned &Nplot, const double &time=0.0)
virtual void get_non_external_dofs(Vector< double > &u)
Interface to get the current value of all (internal and shared) unknowns.
virtual void get_inner_product_matrix(DenseMatrix< double > &inner_product)
Get the inner product matrix.
void orbit_output(GeneralisedElement *const &elem_pt, std::ostream &outfile, const unsigned &n_plot)
void set_timestepper_weights(const Shape &psi, const DShape &dpsidt)
Set the timestepper weights.
virtual double dshape_and_dtest_eulerian_at_knot_orbit(const unsigned &ipt, Shape &psi, DShape &dpsidt, Shape &test, DShape &dtestdt) const =0
Shape/test functions and derivs w.r.t. to global coords at integration point ipt; return Jacobian of ...
Time *& time_pt()
Retun the pointer to the global time.
void fill_in_generic_residual_contribution_orbit(PeriodicOrbitAssemblyHandlerBase *const &assembly_handler_pt, GeneralisedElement *const &elem_pt, Vector< double > &residuals, DenseMatrix< double > &jacobian, const unsigned &flag)
The routine that actually does all the work!
double omega()
Return the frequency.
A Class for shape functions. In simple cases, the shape functions have only one index that can be tho...
double & time()
Return the current value of the continuous time.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...