36 std::ostream &outfile,
37 const unsigned &n_plot)
40 const unsigned n_node =
nnode();
52 const double inverse_timescale = this->
omega();
55 for(
unsigned i=0;
i<n_plot;
i++)
58 s[0] = -1.0 + 2.0*
i/((double)(n_plot-1));
64 double interpolated_time = 0.0;
65 for(
unsigned l=0;l<n_node;l++)
78 interpolated_time/inverse_timescale);
90 const unsigned n_node =
nnode();
93 Shape psi(n_node), test(n_node);
94 DShape dpsidt(n_node,1), dtestdt(n_node,1);
100 int local_eqn=0, local_unknown=0;
103 const unsigned n_elem_dof = elem_pt->
ndof();
110 el_mass.
resize(n_elem_dof,n_elem_dof);
111 el_jacobian.
resize(n_elem_dof,n_elem_dof);
133 const double inverse_timescale = this->
omega();
136 for(
unsigned ipt=0;ipt<n_intpt;ipt++)
150 double interpolated_time = 0.0;
151 for(
unsigned l=0;l<n_node;l++)
158 this->
time_pt()->
time() = interpolated_time/inverse_timescale;
177 for(
unsigned l=0;l<n_node;l++)
186 unsigned offset = this->
eqn_number(local_eqn)*n_elem_dof;
188 for(
unsigned i=0;
i<n_elem_dof;
i++)
190 residuals[
i + offset] += el_residuals[
i]*psi(l)*
W;
200 for(
unsigned l2=0;l2<n_node;l2++)
203 if(local_unknown >= 0)
206 unsigned offset2 = this->
eqn_number(local_unknown)*n_elem_dof;
208 for(
unsigned i=0;
i<n_elem_dof;
i++)
210 for(
unsigned j=0;j<n_elem_dof;j++)
213 jacobian(
i + offset, j+ offset2) +=
214 el_jacobian(
i,j)*psi(l2)*psi(l)*
W;
217 jacobian(
i + offset, j + offset2) -= el_mass(
i,j)*
218 dpsidt(l2,0)*inverse_timescale*psi(l)*
W;
226 for(
unsigned i=0;
i<n_elem_dof;
i++)
228 for(
unsigned j=0;j<n_elem_dof;j++)
231 -= el_mass(
i,j)*(du_dt[j]/inverse_timescale)*psi(l)*
W;
246 all_current_unknowns);
249 all_previous_unknowns);
261 for(
unsigned i=0;
i<n_elem_dof;
i++)
263 for(
unsigned j=0;j<n_elem_dof;j++)
265 sum += u[
i]*inner_product(
i,j)*du_dt_old[j];
276 for(
unsigned l2=0;l2<n_node;l2++)
280 if(local_unknown >= 0)
283 unsigned offset2 = this->
eqn_number(local_unknown)*n_elem_dof;
285 for(
unsigned i2=0;i2<n_elem_dof;i2++)
288 for(
unsigned j=0;j<n_elem_dof;j++)
290 sum2 += inner_product(i2,j)*du_dt_old[j];
292 jacobian(
Ntstorage*n_elem_dof,i2 + offset2) += psi(l2)*sum2*
W;
virtual void get_inner_product_matrix(DenseMatrix< double > &inner_product)
Get the inner product matrix.
A Generalised Element class.
virtual void get_residuals(Vector< double > &residuals)
Calculate the vector of residuals of the equations in the element. By default initialise the vector t...
double omega()
Return the frequency.
virtual void get_non_external_dofs(Vector< double > &u)
Interface to get the current value of all (internal and shared) unknowns.
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 ...
virtual double weight(const unsigned &i) const =0
Return weight of i-th integration point.
Time *& time_pt()
Retun the pointer to the global time.
void orbit_output(GeneralisedElement *const &elem_pt, std::ostream &outfile, const unsigned &n_plot)
virtual void get_non_external_ddofs_dt(Vector< double > &du_dt)
unsigned ndof() const
Return the number of equations/dofs in the element.
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...
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
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_dofs_for_element(GeneralisedElement *const elem_pt, Vector< double > &dofs)=0
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...
double & time()
Return the current value of the continuous time.
virtual void set_dofs_for_element(GeneralisedElement *const elem_pt, Vector< double > const &dofs)=0
virtual void spacetime_output(std::ostream &outilfe, const unsigned &Nplot, const double &time=0.0)
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. NOTE: Moved to cc file because of a possible compiler bug in gcc (yes, really!). The move to the cc file avoids inlining which appears to cause problems (only) when compiled with gcc and -O3; offensive "illegal read" is in optimised-out section of code and data that is allegedly illegal is readily readable (by other means) just before this function is called so I can't really see how we could possibly be responsible for this...
virtual unsigned nweight() const =0
Return the number of integration points of the scheme.
void set_timestepper_weights(const Shape &psi, const DShape &dpsidt)
Set the timestepper weights.
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!
virtual void get_previous_dofs_for_element(GeneralisedElement *const elem_pt, Vector< double > &dofs)=0
unsigned nnode() const
Return the number of nodes.
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...
void resize(const unsigned long &n)