ABCElement Class Reference
+ Inheritance diagram for ABCElement:

Public Member Functions

 ABCElement ()
 
void construct_internal_data (TimeStepper *const &time_stepper_pt)
 
const doublep (const unsigned &i) const
 
Vector< double > *& p_pt ()
 
void get_non_external_dofs (Vector< double > &u)
 Switch. More...
 
void get_non_external_ddofs_dt (Vector< double > &du_dt)
 
void get_inner_product_matrix (DenseMatrix< double > &inner_product)
 Get the inner product matrix. More...
 
void fill_in_contribution_to_residuals (Vector< double > &residuals)
 Add the element's contribution to its residual vector (wrapper) More...
 
void fill_in_contribution_to_jacobian (Vector< double > &residuals, DenseMatrix< double > &jacobian)
 
void fill_in_contribution_to_jacobian_and_mass_matrix (Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
 
void fill_in_generic_residual_contribution (Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix, unsigned flag)
 
void output (ostream &output)
 
void spacetime_output (std::ostream &outfile, const unsigned &Nplot, const double &time=0.0)
 
- Public Member Functions inherited from oomph::GeneralisedElement
 GeneralisedElement ()
 Constructor: Initialise all pointers and all values to zero. More...
 
virtual ~GeneralisedElement ()
 Virtual destructor to clean up any memory allocated by the object. More...
 
 GeneralisedElement (const GeneralisedElement &)=delete
 Broken copy constructor. More...
 
void operator= (const GeneralisedElement &)=delete
 Broken assignment operator. More...
 
Data *& internal_data_pt (const unsigned &i)
 Return a pointer to i-th internal data object. More...
 
Data *const & internal_data_pt (const unsigned &i) const
 Return a pointer to i-th internal data object (const version) More...
 
Data *& external_data_pt (const unsigned &i)
 Return a pointer to i-th external data object. More...
 
Data *const & external_data_pt (const unsigned &i) const
 Return a pointer to i-th external data object (const version) More...
 
unsigned long eqn_number (const unsigned &ieqn_local) const
 
int local_eqn_number (const unsigned long &ieqn_global) const
 
unsigned add_external_data (Data *const &data_pt, const bool &fd=true)
 
bool external_data_fd (const unsigned &i) const
 
void exclude_external_data_fd (const unsigned &i)
 
void include_external_data_fd (const unsigned &i)
 
void flush_external_data ()
 Flush all external data. More...
 
void flush_external_data (Data *const &data_pt)
 Flush the object addressed by data_pt from the external data array. More...
 
unsigned ninternal_data () const
 Return the number of internal data objects. More...
 
unsigned nexternal_data () const
 Return the number of external data objects. More...
 
unsigned ndof () const
 Return the number of equations/dofs in the element. More...
 
void dof_vector (const unsigned &t, Vector< double > &dof)
 Return the vector of dof values at time level t. More...
 
void dof_pt_vector (Vector< double * > &dof_pt)
 Return the vector of pointers to dof values. More...
 
void set_internal_data_time_stepper (const unsigned &i, TimeStepper *const &time_stepper_pt, const bool &preserve_existing_data)
 
void assign_internal_eqn_numbers (unsigned long &global_number, Vector< double * > &Dof_pt)
 
void describe_dofs (std::ostream &out, const std::string &current_string) const
 
virtual void describe_local_dofs (std::ostream &out, const std::string &current_string) const
 
void add_internal_value_pt_to_map (std::map< unsigned, double * > &map_of_value_pt)
 
virtual void assign_local_eqn_numbers (const bool &store_local_dof_pt)
 
virtual void complete_setup_of_dependencies ()
 
virtual void get_residuals (Vector< double > &residuals)
 
virtual void get_jacobian (Vector< double > &residuals, DenseMatrix< double > &jacobian)
 
virtual void get_mass_matrix (Vector< double > &residuals, DenseMatrix< double > &mass_matrix)
 
virtual void get_jacobian_and_mass_matrix (Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix)
 
virtual void get_dresiduals_dparameter (double *const &parameter_pt, Vector< double > &dres_dparam)
 
virtual void get_djacobian_dparameter (double *const &parameter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam)
 
virtual void get_djacobian_and_dmass_matrix_dparameter (double *const &parameter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam, DenseMatrix< double > &dmass_matrix_dparam)
 
virtual void get_hessian_vector_products (Vector< double > const &Y, DenseMatrix< double > const &C, DenseMatrix< double > &product)
 
virtual void get_inner_products (Vector< std::pair< unsigned, unsigned >> const &history_index, Vector< double > &inner_product)
 
virtual void get_inner_product_vectors (Vector< unsigned > const &history_index, Vector< Vector< double >> &inner_product_vector)
 
virtual unsigned self_test ()
 
virtual void compute_norm (Vector< double > &norm)
 
virtual void compute_norm (double &norm)
 
virtual unsigned ndof_types () const
 
virtual void get_dof_numbers_for_unknowns (std::list< std::pair< unsigned long, unsigned >> &dof_lookup_list) const
 
- Public Member Functions inherited from oomph::PeriodicOrbitBaseElement
 PeriodicOrbitBaseElement ()
 

Private Attributes

Vector< double > * P_pt
 
unsigned Internal_index
 

Additional Inherited Members

- Static Public Attributes inherited from oomph::GeneralisedElement
static bool Suppress_warning_about_repeated_internal_data
 
static bool Suppress_warning_about_repeated_external_data = true
 
static double Default_fd_jacobian_step = 1.0e-8
 
- Protected Member Functions inherited from oomph::GeneralisedElement
unsigned add_internal_data (Data *const &data_pt, const bool &fd=true)
 
bool internal_data_fd (const unsigned &i) const
 
void exclude_internal_data_fd (const unsigned &i)
 
void include_internal_data_fd (const unsigned &i)
 
void clear_global_eqn_numbers ()
 
void add_global_eqn_numbers (std::deque< unsigned long > const &global_eqn_numbers, std::deque< double * > const &global_dof_pt)
 
virtual void assign_internal_and_external_local_eqn_numbers (const bool &store_local_dof_pt)
 
virtual void assign_all_generic_local_eqn_numbers (const bool &store_local_dof_pt)
 
virtual void assign_additional_local_eqn_numbers ()
 
int internal_local_eqn (const unsigned &i, const unsigned &j) const
 
int external_local_eqn (const unsigned &i, const unsigned &j)
 
void fill_in_jacobian_from_internal_by_fd (Vector< double > &residuals, DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
 
void fill_in_jacobian_from_internal_by_fd (DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
 
void fill_in_jacobian_from_external_by_fd (Vector< double > &residuals, DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
 
void fill_in_jacobian_from_external_by_fd (DenseMatrix< double > &jacobian, const bool &fd_all_data=false)
 
virtual void update_before_internal_fd ()
 
virtual void reset_after_internal_fd ()
 
virtual void update_in_internal_fd (const unsigned &i)
 
virtual void reset_in_internal_fd (const unsigned &i)
 
virtual void update_before_external_fd ()
 
virtual void reset_after_external_fd ()
 
virtual void update_in_external_fd (const unsigned &i)
 
virtual void reset_in_external_fd (const unsigned &i)
 
virtual void fill_in_contribution_to_mass_matrix (Vector< double > &residuals, DenseMatrix< double > &mass_matrix)
 
virtual void fill_in_contribution_to_dresiduals_dparameter (double *const &parameter_pt, Vector< double > &dres_dparam)
 
virtual void fill_in_contribution_to_djacobian_dparameter (double *const &parameter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam)
 
virtual void fill_in_contribution_to_djacobian_and_dmass_matrix_dparameter (double *const &parameter_pt, Vector< double > &dres_dparam, DenseMatrix< double > &djac_dparam, DenseMatrix< double > &dmass_matrix_dparam)
 
virtual void fill_in_contribution_to_hessian_vector_products (Vector< double > const &Y, DenseMatrix< double > const &C, DenseMatrix< double > &product)
 
virtual void fill_in_contribution_to_inner_products (Vector< std::pair< unsigned, unsigned >> const &history_index, Vector< double > &inner_product)
 
virtual void fill_in_contribution_to_inner_product_vectors (Vector< unsigned > const &history_index, Vector< Vector< double >> &inner_product_vector)
 
- Static Protected Attributes inherited from oomph::GeneralisedElement
static DenseMatrix< doubleDummy_matrix
 
static std::deque< double * > Dof_pt_deque
 

Constructor & Destructor Documentation

◆ ABCElement()

ABCElement::ABCElement ( )
inline
66  {
67  //Internal_index = this->add_internal_data(new Data(3));
68  }

Member Function Documentation

◆ construct_internal_data()

void ABCElement::construct_internal_data ( TimeStepper *const &  time_stepper_pt)
inline
75  {
76  Internal_index = this->add_internal_data(new Data(time_stepper_pt,3));
77  }
unsigned Internal_index
Definition: periodic_orbit.cc:61
Definition: nodes.h:86
unsigned add_internal_data(Data *const &data_pt, const bool &fd=true)
Definition: elements.cc:62

◆ fill_in_contribution_to_jacobian()

void ABCElement::fill_in_contribution_to_jacobian ( Vector< double > &  residuals,
DenseMatrix< double > &  jacobian 
)
inlinevirtual

Add the element's contribution to its residual vector and element Jacobian matrix (wrapper)

Reimplemented from oomph::GeneralisedElement.

140  {
141  //Call the generic routine with the flag set to 1
143  jacobian,
144  GeneralisedElement::Dummy_matrix,1);
145  }
void fill_in_generic_residual_contribution(Vector< double > &residuals, DenseMatrix< double > &jacobian, DenseMatrix< double > &mass_matrix, unsigned flag)
Definition: periodic_orbit.cc:160

◆ fill_in_contribution_to_jacobian_and_mass_matrix()

void ABCElement::fill_in_contribution_to_jacobian_and_mass_matrix ( Vector< double > &  residuals,
DenseMatrix< double > &  jacobian,
DenseMatrix< double > &  mass_matrix 
)
inlinevirtual

Add the element's contribution to its residuals vector, jacobian matrix and mass matrix

Reimplemented from oomph::GeneralisedElement.

153  {
154  //Call the generic routine with the flag set to 2
155  fill_in_generic_residual_contribution(residuals,jacobian,mass_matrix,2);
156  }

◆ fill_in_contribution_to_residuals()

void ABCElement::fill_in_contribution_to_residuals ( Vector< double > &  residuals)
inlinevirtual

Add the element's contribution to its residual vector (wrapper)

Reimplemented from oomph::GeneralisedElement.

128  {
129  //Call the generic residuals function with flag set to 0
130  //using a dummy matrix arguments
132  residuals,GeneralisedElement::Dummy_matrix,
133  GeneralisedElement::Dummy_matrix,0);
134  }

◆ fill_in_generic_residual_contribution()

void ABCElement::fill_in_generic_residual_contribution ( Vector< double > &  residuals,
DenseMatrix< double > &  jacobian,
DenseMatrix< double > &  mass_matrix,
unsigned  flag 
)
inline

Calculate the elemental contributions to the global residual vector for the weak form of the Poisson equation

164  {
165  //Set the mass matrix
166  if(flag==2)
167  {
168  for(unsigned i=0;i<3;i++) {mass_matrix(i,i) = 1.0;}
169  }
170 
171  //Get the value of the parameters
172  double p0 = p(0);
173  double p1 = p(1);
174  double p2 = p(2);
175  double p3 = p(3);
176  double p4 = p(4);
177 
178  //Get the values of the unknowns at the current time
179  Vector<double> u(3);
183 
184  //Get the values of the derivatives of the unknowns at the current time
185  Vector<double> du_dt(3);
189  du_dt);
190 
191 
192  // for(unsigned i=0;i<3;i++)
193  // {u[i] = internal_data_pt(Internal_index)->value(i);}
194  double exp_u2 = exp(u[2]);
195 
196  unsigned local_eqn = internal_local_eqn(Internal_index,0);
197  residuals[local_eqn] = -du_dt[0] -u[0] + p0*(1.0 - u[0])*exp_u2;
198 
199  if(flag)
200  {
201  unsigned local_unknown = internal_local_eqn(Internal_index,0);
202 
203  //Don't return time derivative terms if also asked for the mass matrix
204  if(flag==2)
205  {
206  jacobian(local_eqn,local_unknown) =
207  -1.0 - p0*exp_u2;
208  }
209  else
210  {
211  jacobian(local_eqn,local_unknown) =
213  -1.0 - p0*exp_u2;
214  }
215 
216  local_unknown = internal_local_eqn(Internal_index,2);
217  jacobian(local_eqn,local_unknown) = p0*(1.0 - u[0])*exp_u2;
218  }
219 
220 
221  local_eqn = internal_local_eqn(Internal_index,1);
222  residuals[local_eqn] = -du_dt[1] - u[1] +
223  p0*(1.0 - u[0] - p4*u[1])*exp_u2;
224 
225  if(flag)
226  {
227  unsigned local_unknown = internal_local_eqn(Internal_index,0);
228  jacobian(local_eqn,local_unknown) = - p0*exp_u2;
229 
230  local_unknown = internal_local_eqn(Internal_index,1);
231  //Don't return time derivative terms if also asked for the mass matrix
232  if(flag==2)
233  {
234  jacobian(local_eqn,local_unknown) =
235  -1.0 - p0*p4*exp_u2;
236  }
237  else
238  {
239  jacobian(local_eqn,local_unknown) =
241  -1.0 - p0*p4*exp_u2;
242  }
243 
244  local_unknown = internal_local_eqn(Internal_index,2);
245  jacobian(local_eqn,local_unknown) =
246  p0*(1.0 - u[0] - p4*u[1])*exp_u2;
247  }
248 
249  local_eqn = internal_local_eqn(Internal_index,2);
250  residuals[local_eqn] = -du_dt[2]
251  -u[2] - p2*u[2] + p0*p3*(1.0 - u[0] + p1*p4*u[1])*exp_u2;
252 
253  if(flag)
254  {
255  unsigned local_unknown = internal_local_eqn(Internal_index,0);
256  jacobian(local_eqn,local_unknown) = -p0*p3*exp_u2;
257 
258  local_unknown = internal_local_eqn(Internal_index,1);
259  jacobian(local_eqn,local_unknown) = p0*p1*p3*p4*exp_u2;
260 
261  local_unknown = internal_local_eqn(Internal_index,2);
262  //Don't add the time derivative terms if also asked for the mass
263  //matrix
264  if(flag==2)
265  {
266  jacobian(local_eqn,local_unknown) =
267  -1.0 - p2
268  + p0*p3*(1.0 - u[0] + p1*p4*u[1])*exp_u2;
269  }
270  else
271  {
272  jacobian(local_eqn,local_unknown) =
274  -1.0 - p2
275  + p0*p3*(1.0 - u[0] + p1*p4*u[1])*exp_u2;
276  }
277  }
278 
279  } //End of function
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Vector3f p0
Definition: MatrixBase_all.cpp:2
Vector3f p1
Definition: MatrixBase_all.cpp:2
const double & p(const unsigned &i) const
Definition: periodic_orbit.cc:80
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
Definition: nodes.h:238
Data *& internal_data_pt(const unsigned &i)
Return a pointer to i-th internal data object.
Definition: elements.h:622
int internal_local_eqn(const unsigned &i, const unsigned &j) const
Definition: elements.h:267
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
void time_derivative(const unsigned &i, Data *const &data_pt, Vector< double > &deriv)
Definition: timesteppers.h:502
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 exp(const bfloat16 &a)
Definition: BFloat16.h:615

References Eigen::bfloat16_impl::exp(), i, p, p0, and p1.

◆ get_inner_product_matrix()

void ABCElement::get_inner_product_matrix ( DenseMatrix< double > &  inner_product)
inlinevirtual

Get the inner product matrix.

Reimplemented from oomph::PeriodicOrbitBaseElement.

120  {
121  inner_product.initialise(0.0);
122  for(unsigned i=0;i<3;i++) {inner_product(i,i) = 1.0;}
123  }
void initialise(const T &val)
Initialize all values in the matrix to val.
Definition: matrices.h:514

References i, and oomph::DenseMatrix< T >::initialise().

◆ get_non_external_ddofs_dt()

void ABCElement::get_non_external_ddofs_dt ( Vector< double > &  du_dt)
inlinevirtual

Interface to get the current value of the time derivative of all (internal and shared) unknowns

Reimplemented from oomph::PeriodicOrbitBaseElement.

106  {
107  Vector<double> dval_dt(3);
109  time_derivative(1,internal_data_pt(Internal_index),dval_dt);
110 
111  for(unsigned i=0;i<3;i++)
112  {
113  unsigned local_eqn = internal_local_eqn(Internal_index,i);
114  du_dt[local_eqn] = dval_dt[i];
115  }
116  }

References i.

◆ get_non_external_dofs()

void ABCElement::get_non_external_dofs ( Vector< double > &  u)
inlinevirtual

Switch.

Interface to get the current value of all (internal and shared) unknowns

Reimplemented from oomph::PeriodicOrbitBaseElement.

90  {
93  time_derivative(0,internal_data_pt(Internal_index),val);
94 
95  for(unsigned i=0;i<3;i++)
96  {
97  unsigned local_eqn = internal_local_eqn(Internal_index,i);
98  u[local_eqn] = val[i];
99  }
100  }
val
Definition: calibrate.py:119

References i, and calibrate::val.

◆ output()

void ABCElement::output ( ostream &  output)
inline
283  {
284  for(unsigned n=0;n<3;n++)
285  {
286  output << this->internal_data_pt(Internal_index)->value(n) << " ";
287  }
288  output << std::endl;
289  } //End of function
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
void output(ostream &output)
Definition: periodic_orbit.cc:282
double value(const unsigned &i) const
Definition: nodes.h:293

References n, and output().

◆ p()

const double& ABCElement::p ( const unsigned i) const
inline
80 {return (*P_pt)[i];}
Vector< double > * P_pt
Definition: periodic_orbit.cc:59

References i.

◆ p_pt()

Vector<double>* & ABCElement::p_pt ( )
inline
83 {return P_pt;}

◆ spacetime_output()

void ABCElement::spacetime_output ( std::ostream &  outfile,
const unsigned Nplot,
const double time = 0.0 
)
inlinevirtual

Reimplemented from oomph::PeriodicOrbitBaseElement.

294  {
295  outfile << time << " ";
296 
297  Vector<double> u(3), du_dt(3);
302 
303  for(unsigned i=0;i<3;i++) {outfile << u[i] << " ";}
304  for(unsigned i=0;i<3;i++) {outfile << du_dt[i] << " ";}
305 
306 
307  outfile << std::endl;
308  }

References i.

Member Data Documentation

◆ Internal_index

unsigned ABCElement::Internal_index
private

◆ P_pt

Vector<double>* ABCElement::P_pt
private

The documentation for this class was generated from the following file: