elastic_problems.h
Go to the documentation of this file.
1 //LIC// ====================================================================
2 //LIC// This file forms part of oomph-lib, the object-oriented,
3 //LIC// multi-physics finite-element library, available
4 //LIC// at http://www.oomph-lib.org.
5 //LIC//
6 //LIC// Version 1.0; svn revision $LastChangedRevision: 1097 $
7 //LIC//
8 //LIC// $LastChangedDate: 2015-12-17 11:53:17 +0000 (Thu, 17 Dec 2015) $
9 //LIC//
10 //LIC// Copyright (C) 2006-2016 Matthias Heil and Andrew Hazel
11 //LIC//
12 //LIC// This library is free software; you can redistribute it and/or
13 //LIC// modify it under the terms of the GNU Lesser General Public
14 //LIC// License as published by the Free Software Foundation; either
15 //LIC// version 2.1 of the License, or (at your option) any later version.
16 //LIC//
17 //LIC// This library is distributed in the hope that it will be useful,
18 //LIC// but WITHOUT ANY WARRANTY; without even the implied warranty of
19 //LIC// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 //LIC// Lesser General Public License for more details.
21 //LIC//
22 //LIC// You should have received a copy of the GNU Lesser General Public
23 //LIC// License along with this library; if not, write to the Free Software
24 //LIC// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
25 //LIC// 02110-1301 USA.
26 //LIC//
27 //LIC// The authors may be contacted at oomph-lib@maths.man.ac.uk.
28 //LIC//
29 //LIC//====================================================================
30 #ifndef OOMPH_ELASTIC_PROBLEMS_HEADER
31 #define OOMPH_ELASTIC_PROBLEMS_HEADER
32 
33 // Config header generated by autoconfig
34 #ifdef HAVE_CONFIG_H
35  #include <oomph-lib-config.h>
36 #endif
37 
38 
39 //oomph-lib headers
40 #include "geom_objects.h"
41 #include "timesteppers.h"
42 #include "problem.h"
43 #include "frontal_solver.h"
44 #include "mesh.h"
45 
46 namespace oomph
47 {
48 
49 ////////////////////////////////////////////////////////////////////////
50 ////////////////////////////////////////////////////////////////////////
51 ////////////////////////////////////////////////////////////////////////
52 
53 
54 //======================================================================
55 /// \short Dummy mesh that can be created and deleted in
56 /// SolidICProblem
57 //======================================================================
58 class DummyMesh : public Mesh
59 {
60 
61 public:
62 
63  // Empty constructor
64  DummyMesh(){};
65 
66 };
67 
68 ////////////////////////////////////////////////////////////////////////
69 ////////////////////////////////////////////////////////////////////////
70 ////////////////////////////////////////////////////////////////////////
71 
72 
73 //======================================================================
74 /// \short IC problem for an elastic body discretised on a given (sub)-mesh.
75 /// We switch the elements' residuals and Jacobians to the system of
76 /// equations that forces the wall shape to become that of
77 /// a specified "initial condition object".
78 ///
79 ///
80 /// Boundary conditions for all data items associated with the mesh's
81 /// elements' are temporarily overwritten so that all positional dofs (and
82 /// only those!) become free while all other data (nodal data and the element's
83 /// internal and external data) are either pinned (for nodal and internal
84 /// data) or completely removed (for pointers to external data).
85 /// The complete removal of the (pointers to the) external data is necessary
86 /// because in FSI problems, positional data of certain elements
87 /// can feature as external data of others. Hence pinning them
88 /// in their incarnation as external data would also pin them
89 /// in their incarnation as positional data.
90 ///
91 ///
92 /// All data and its pinned-status are restored at the end of the
93 /// call to setup_ic().
94 //======================================================================
95 class SolidICProblem : public Problem
96 {
97 
98 public:
99 
100  /// \short Constructor. Initialise pointer
101  /// to IC object to NULL. Create a dummy mesh that can be deleted
102  /// when static problem finally goes out of scope at end of
103  /// program execution.
105  {
106  /// Create dummy mesh
107  mesh_pt()=new DummyMesh;
108 
109  // Default value for checking of consistent assignment of Newmark IC
111  }
112 
113 
114  /// Broken copy constructor
116  {
117  BrokenCopy::broken_copy("SolidICProblem");
118  }
119 
120  /// Broken assignment operator
121  void operator=(const SolidICProblem&)
122  {
123  BrokenCopy::broken_assign("SolidICProblem");
124  }
125 
126  /// Update after solve (empty)
128 
129  /// \short Update the problem specs before solve. (empty)
131 
132  /// \short Force the elastic structure that is discretised on the specified
133  /// mesh to deform in the shape of the initial condition object
134  /// (evaluated at the time specified)
135  void set_static_initial_condition(Problem* problem_pt,
136  Mesh* mesh_pt,
137  SolidInitialCondition* ic_pt,
138  const double& time);
139 
140  /// \short Force the elastic structure that is discretised on the specified
141  /// mesh to deform in the shape of the initial condition object (wrapper)
144  {
145  double time;
146  set_static_initial_condition(problem_pt,mesh_pt,ic_pt,time);
147  }
148 
149  /// \short Setup initial condition for time-integration
150  /// with Newmark's method. History values are assigned to that
151  /// the velocity and accelerations determined by the Newmark
152  /// scheme are exact at the initial time.
153  template<class TIMESTEPPER>
155  Mesh* mesh_pt,
156  TIMESTEPPER* timestepper_pt,
157  SolidInitialCondition* ic_pt,
158  const double& dt);
159 
160 
161  /// \short Setup initial condition for time-integration
162  /// with Newmark's method. Past displacements and velocities are assigned
163  /// directly (consistent with the idea that a second order ODE
164  /// can take ICs up to 1st order, while the history value for
165  /// the previous acceleration is determined by the condition that
166  /// the weak equation is satisfied at the initial time.)
167  /// The multiplier function needs to specify the factor that
168  /// multiplies the inertia terms -- typically this is a
169  /// constant, given by the ratio \f$ \Lambda^2 \f$ of the
170  /// problem's intrinsic timescale to the time used to non-dimensionalise
171  /// the equations. If the function (pointer) is not specified
172  /// the multiplier is assumed to be equal to 1.0 -- appropriate
173  /// for a non-dimensionalisation based on the problem's intrinsic timescale.
174  template<class TIMESTEPPER>
176  Mesh* mesh_pt,
177  TIMESTEPPER* timestepper_pt,
178  SolidInitialCondition* ic_pt,
179  const double& dt,
180  SolidFiniteElement::MultiplierFctPt multiplier_fct_pt=0);
181 
182 
183  /// \short Max. tolerated residual after application of consistent
184  /// Newmark IC. Used to check if we have specified the correct
185  /// timescale ratio (non-dim density).
187  {
189  }
190 
191 
192 private:
193 
194  /// Backup original state of all data associated with mesh
195  void backup_original_state();
196 
197  /// Reset original state of all data associated with mesh
198  void reset_original_state();
199 
200  /// Change pinned status of all data associated with mesh
201  /// so that the IC problem can be solved.
202  void setup_problem();
203 
204  /// Pointer to initial condition object
206 
207  /// Vector to store pinned status of all data
209 
210  /// Vector of Vectors to store pointers to exernal data in the elements
212 
213  /// \short Max. tolerated residual after application of consistent
214  /// Newmark IC. Used to check if we have specified the correct
215  /// timescale ratio (non-dim density).
217 
218 
219 };
220 
221 
222 
223 //======================================================================
224 /// \short Setup initial condition for time-integration
225 /// with Newmark's method. History values are assigned to that
226 /// the velocity and accelerations determined by the Newmark
227 /// scheme are exact at the initial time.
228 //======================================================================
229 template<class TIMESTEPPER>
231  Problem* problem_pt, Mesh* wall_mesh_pt, TIMESTEPPER* timestepper_pt,
232  SolidInitialCondition* ic_pt, const double& dt)
233 {
234 
235 #ifdef PARANOID
236  if (timestepper_pt->type()!="Newmark")
237  {
238  std::ostringstream error_message;
239  error_message
240  << "SolidICProblem::set_newmark_initial_condition_directly()\n"
241  << "can only be called for Newmark type timestepper whereas\n "
242  << "you've called it for " << timestepper_pt->type() << std::endl;
243 
244  throw
245  OomphLibError(error_message.str(),
246  "SolidICProblem::set_newmark_initial_condition_directly()",
247  OOMPH_EXCEPTION_LOCATION);
248  }
249 #endif
250 
251  // Set value of dt
252  timestepper_pt->time_pt()->dt()=dt;
253 
254  // Set the weights
255  timestepper_pt->set_weights();
256 
257  // Delete dummy mesh
258  delete mesh_pt();
259 
260  // Set pointer to mesh
261  mesh_pt()=wall_mesh_pt;
262 
263  // Set pointer to initial condition object
264  IC_pt=ic_pt;
265 
266  // Backup the pinned status of all dofs and remove external data
267  // of all elements
269 
270  // Now alter the pinned status so that the IC problem for the
271  // positional variables can be solved; setup equation numbering
272  // scheme
273  setup_problem();
274 
275 
276  // Store times at which we need to assign ic:
277  double current_time=timestepper_pt->time_pt()->time();
278  double previous_time=timestepper_pt->time_pt()->time(1);
279 
280  // Stage 1: Set values and time derivs at current time
281  //----------------------------------------------------
282 
283  // [Note: this acts on time everywhere!]
285  current_time;
286 
287  // Loop over time-derivatives
288  for (unsigned t_deriv=0;t_deriv<=2;t_deriv++)
289  {
290 
291  // Set flag to ensure that the t_deriv-th time derivative
292  // of the prescribed solution gets stored in displacements
293  IC_pt->ic_time_deriv()=t_deriv;
294 
295  // Solve the problem for initial shape
296  newton_solve();
297 
298  //Loop over all the nodes
299  unsigned n_node=mesh_pt()->nnode();
300  for(unsigned n=0;n<n_node;n++)
301  {
302  // Assign current time derivative in its temporary storage
303  // position
304  timestepper_pt->assign_initial_data_values_stage1(
305  t_deriv,dynamic_cast<SolidNode*>(
306  mesh_pt()->node_pt(n))->variable_position_pt());
307  }
308  }
309 
310 
311 
312  // Stage 2: Now get position at previous time and adjust previous
313  //---------------------------------------------------------------
314  // values of veloc and accel in Newmark scheme so that current
315  //---------------------------------------------------------------
316  // veloc and accel (specified in step 1) are represented exactly.
317  //---------------------------------------------------------------
318 
319  // [Note: this acts on time everywhere and needs to be reset!]
321  previous_time;
322 
323  // Set flag to ensure that the t_deriv-th time derivative
324  // of the prescribed solution gets stored in displacements
325  IC_pt->ic_time_deriv()=0;
326 
327  // Solve the problem for initial shape
328  newton_solve();
329 
330  //Loop over all the nodes and make the final adjustments
331  unsigned n_node=mesh_pt()->nnode();
332  for(unsigned n=0;n<n_node;n++)
333  {
334  timestepper_pt->assign_initial_data_values_stage2(
335  dynamic_cast<SolidNode*>(mesh_pt()->node_pt(n))
336  ->variable_position_pt());
337  }
338 
339  // Reset time
341  current_time;
342 
343  // Reset the pinned status and re-attach the external data to the elements
345 
346  // Set pointer to dummy mesh so there's something that can be deleted
347  // when static problem finally goes out of scope.
348  mesh_pt()=new DummyMesh;
349 
350  // We have temporarily over-written equation numbers -- need
351  // to reset them now
352  oomph_info << "Number of equations in big problem: "
353  << problem_pt->assign_eqn_numbers() << std::endl;
354 
355 }
356 
357 
358 //======================================================================
359 /// \short Setup initial condition for time-integration
360 /// with Newmark's method. Past displacements and velocities are assigned
361 /// directly (consistent with the idea that a second order ODE
362 /// can take ICs up to 1st order, while the history value for
363 /// the previous acceleration is determined by the condition that
364 /// that the weak equation is satisfied at the initial time.
365 /// The multiplier function needs to specify the factor that
366 /// multiplies the inertia terms -- typically this is a
367 /// constant, given by the ratio \f$ \Lambda^2 \f$ of the
368 /// problem's intrinsic timescale to the time used to non-dimensionalise
369 /// the equations. If the function (pointer) is not specified,
370 /// the multiplier is assumed to be equal to 1.0 -- appropriate
371 /// for a non-dimensionalisation based on the problem's intrinsic timescale.
372 //======================================================================
373 template<class TIMESTEPPER>
375 Problem* problem_pt, Mesh* wall_mesh_pt, TIMESTEPPER* timestepper_pt,
376 SolidInitialCondition* ic_pt, const double& dt,
377 SolidFiniteElement::MultiplierFctPt multiplier_fct_pt)
378 {
379 
380 #ifdef PARANOID
381  if (timestepper_pt->type()!="Newmark")
382  {
383  std::ostringstream error_message;
384  error_message
385  << "SolidICProblem::set_newmark_initial_condition_consistently()\n"
386  << "can only be called for Newmark type timestepper whereas\n "
387  << "you've called it for " << timestepper_pt->type() << std::endl;
388 
389  throw
391  error_message.str(),
392  "SolidICProblem::set_newmark_initial_condition_consistently()",
393  OOMPH_EXCEPTION_LOCATION);
394  }
395 #endif
396 
397  // Set value of dt
398  timestepper_pt->time_pt()->dt()=dt;
399 
400  // Set the weights
401  timestepper_pt->set_weights();
402 
403  // Delete dummy mesh
404  delete mesh_pt();
405 
406  // Set pointer to mesh
407  mesh_pt()=wall_mesh_pt;
408 
409  // Set pointer to initial condition object
410  IC_pt=ic_pt;
411 
412  // Backup the pinned status of all dofs and remove external data
413  // of all elements
415 
416  // Now alter the pinned status so that the IC problem for the
417  // positional variables can be solved; setup equation numbering
418  // scheme
419  setup_problem();
420 
421  // Number of history values
422  unsigned ntstorage=IC_pt->geom_object_pt()->time_stepper_pt()->
423  ntstorage();
424 
425  // Set values at previous time
426  //----------------------------
427 
428  // Loop over number of previous times stored
429  unsigned nprevtime=IC_pt->geom_object_pt()->time_stepper_pt()->
430  nprev_values();
431 
432  // Backup previous times:
433  Vector<double> prev_time(nprevtime+1);
434  for (unsigned i=0;i<=nprevtime;i++)
435  {
436  prev_time[i]=IC_pt->geom_object_pt()->time_stepper_pt()->
437  time_pt()->time(i);
438  }
439 
440  // Loop over previous times & set values themselves
441  //-------------------------------------------------
442  for (unsigned i=1;i<=nprevtime;i++)
443  {
444 
445  // Set time for geometric object that specifies initial condition
446  // [Note: this acts on time everywhere!]
448  prev_time[i];
449 
450  // Set flag to ensure that the t_deriv-th time derivative
451  // of the prescribed solution gets stored in displacements
452  IC_pt->ic_time_deriv()=0;
453 
454  // Solve the problem for initial shape: After this solve
455  // The nodes's current positions represent the position at
456  // previous time level i.
457  newton_solve();
458 
459  //Loop over all the nodes
460  unsigned n_node=mesh_pt()->nnode();
461  for(unsigned n=0;n<n_node;n++)
462  {
463  //Get the variable position data
464  Data* position_data_pt =
465  dynamic_cast<SolidNode*>(mesh_pt()->node_pt(n))->variable_position_pt();
466  // Get number of values
467  unsigned nval= position_data_pt->nvalue();
468 
469  // Assign values at previous times into their corresponding
470  // slots
471  for (unsigned ival=0;ival<nval;ival++)
472  {
473  position_data_pt->set_value(i,ival,
474  position_data_pt->value(0,ival));
475  }
476  }
477  }
478 
479  // Set veloc (1st time deriv) at previous time and store in appropriate
480  //---------------------------------------------------------------------
481  // history value. Also assign zero value for 2nd time deriv. at
482  //-------------------------------------------------------------
483  // previous time
484  //--------------
485 
486  // Set time for geometric object that specifies initial condition
487  // to previous time [Note: this acts on time everywhere!]
489  prev_time[1];
490 
491  // Set flag to ensure that the t_deriv-th time derivative
492  // of the prescribed solution gets stored in displacements
493  IC_pt->ic_time_deriv()=1;
494 
495  // Solve the problem for initial shape: After this solve
496  // The nodes's current positions represent the time derivatives of at
497  // the positons at previous time level.
498  newton_solve();
499 
500  //Loop over all the nodes
501  unsigned n_node=mesh_pt()->nnode();
502  for(unsigned n=0;n<n_node;n++)
503  {
504  //Get the position data
505  Data* position_data_pt = dynamic_cast<SolidNode*>
506  (mesh_pt()->node_pt(n))->variable_position_pt();
507 
508  // Get number of values
509  unsigned nval = position_data_pt->nvalue();
510 
511  // Assign values at previous times into their corresponding
512  // slots (last but one history value of Newmark scheme)
513  for (unsigned ival=0;ival<nval;ival++)
514  {
515  position_data_pt->set_value(ntstorage-2,ival,
516  position_data_pt->value(0,ival));
517  position_data_pt->set_value(ntstorage-1,ival,0.0);
518  }
519  }
520 
521 
522  // Set values at current time
523  //---------------------------
524 
525  // Reset time to current value
526  // [Note: this acts on time everywhere!]
528  prev_time[0];
529 
530  // Set flag to ensure that the t_deriv-th time derivative
531  // of the prescribed solution gets stored in displacements
532  IC_pt->ic_time_deriv()=0;
533 
534  // Solve the problem for initial shape
535  newton_solve();
536 
537 
538  // Now solve for the correction to the Newmark accelerations
539  //----------------------------------------------------------
540  // at previous time:
541  //------------------
542 
543  //Loop over the elements
544  unsigned Nelement = mesh_pt()->nelement();
545  for(unsigned i=0;i<Nelement;i++)
546  {
547  //Cast to proper element type
548  SolidFiniteElement* elem_pt = dynamic_cast<SolidFiniteElement*>(
549  mesh_pt()->element_pt(i));
550 
551  // Switch system to the one that determines the Newmark accelerations
552  // by setting the Jacobian to the mass matrix
554 
555  // Set pointer to multiplier function
556  elem_pt->multiplier_fct_pt() = multiplier_fct_pt;
557 
558  // Switch off pointer to initial condition object
559  elem_pt->solid_ic_pt() = 0;
560 
561  }
562 
563  // Correction vector
564  DoubleVector correction;
565 
566  /// Pointer to member type solver
567  typedef void (LinearSolver::*SolverMemPtr)(Problem* const &problem,
568  DoubleVector &result);
569  SolverMemPtr solver_mem_pt=&LinearSolver::solve;
570 
571  //Now do the linear solve
572  (linear_solver_pt()->*solver_mem_pt)(this,correction);
573 
574  // Update discrete 2nd deriv at previous time so that it's consistent
575  // with PDE at current time
576 
577  //Loop over all the nodes
578  for(unsigned n=0;n<n_node;n++)
579  {
580  //Get the pointer to the position data
581  Data* position_data_pt =
582  dynamic_cast<SolidNode*>(mesh_pt()->node_pt(n))
583  ->variable_position_pt();
584 
585  // Get number of values
586  unsigned nval = position_data_pt->nvalue();
587 
588  // Assign values for the history value that corresponds to the
589  // previous accel in Newmark scheme so that the PDE is satsified
590  // at current time
591  for (unsigned ival=0;ival<nval;ival++)
592  {
593  // Global equation number
594  int ieqn = position_data_pt->eqn_number(ival);
595 
596 #ifdef PARANOID
597  if (ieqn<0)
598  {
599  throw OomphLibError(
600  "No positional dofs should be pinned at this stage!",
601  OOMPH_CURRENT_FUNCTION,
602  OOMPH_EXCEPTION_LOCATION);
603  }
604 #endif
605 
606  // Update the value
607  *(position_data_pt->value_pt(ntstorage-1,ival))
608  -= correction[ieqn];
609  }
610  }
611 
612 
613 #ifdef PARANOID
614  // Check the residual
615  DoubleVector residuals;
616  get_residuals(residuals);
617  double res_max=residuals.max();
618  oomph_info << "Max. residual after assigning consistent initial conditions: "
619  << res_max << std::endl;
621  {
622  std::ostringstream error_message;
623  error_message << "Residual is bigger than allowed! [Current tolerance: "
625  error_message << "This is probably because you've not specified the "
626  << "correct multiplier \n(the product of growth factor "
627  << "and timescale ratio [the non-dim density]). \nPlease "
628  << "check the Solid Mechanics Theory Tutorial for "
629  << "details. \n\n"
630  << "If you're sure that the residual is OK, overwrite "
631  << "the default tolerance using\n";
632  error_message
633  << "SolidICProblem::max_residual_after_consistent_newton_ic()"
634  << std::endl << "or recompile without the PARANOID flag." << std::endl;
635 
636  throw OomphLibError(
637  error_message.str(),
638  OOMPH_CURRENT_FUNCTION,
639  OOMPH_EXCEPTION_LOCATION);
640  }
641 #endif
642 
643  // Reset the pinned status and re-attach the external data to the elements
645 
646  // Set pointer to dummy mesh so there's something that can be deleted
647  // when static problem finally goes out of scope.
648  mesh_pt()=new DummyMesh;
649 
650  // We have temporarily over-written equation numbers -- need
651  // to reset them now
652  oomph_info << "Number of equations in big problem: "
653  << problem_pt->assign_eqn_numbers() << std::endl;
654 
655 }
656 
657 }
658 
659 #endif
virtual void solve(Problem *const &problem_pt, DoubleVector &result)=0
Solver: Takes pointer to problem and returns the results vector which contains the solution of the li...
void newton_solve()
Use Newton method to solve the problem.
Definition: problem.cc:8741
void set_newmark_initial_condition_consistently(Problem *problem_pt, Mesh *mesh_pt, TIMESTEPPER *timestepper_pt, SolidInitialCondition *ic_pt, const double &dt, SolidFiniteElement::MultiplierFctPt multiplier_fct_pt=0)
Setup initial condition for time-integration with Newmark's method. Past displacements and velocities...
void broken_copy(const std::string &class_name)
Issue error message and terminate execution.
void set_newmark_initial_condition_directly(Problem *problem_pt, Mesh *mesh_pt, TIMESTEPPER *timestepper_pt, SolidInitialCondition *ic_pt, const double &dt)
Setup initial condition for time-integration with Newmark's method. History values are assigned to th...
double Max_residual_after_consistent_newton_ic
Max. tolerated residual after application of consistent Newmark IC. Used to check if we have specifie...
A class to specify the initial conditions for a solid body. Solid bodies are often discretised with H...
Definition: elements.h:3244
unsigned long nnode() const
Return number of nodes in the mesh.
Definition: mesh.h:590
unsigned & ic_time_deriv()
Which time derivative are we currently assigning?
Definition: elements.h:3275
SolidInitialCondition *& solid_ic_pt()
Pointer to object that describes the initial condition.
Definition: elements.h:3686
SolidICProblem()
Constructor. Initialise pointer to IC object to NULL. Create a dummy mesh that can be deleted when st...
GeomObject *& geom_object_pt()
(Reference to) pointer to geom object that specifies the initial condition
Definition: elements.h:3269
cstr elem_len * i
Definition: cfortran.h:607
double & max_residual_after_consistent_newton_ic()
Max. tolerated residual after application of consistent Newmark IC. Used to check if we have specifie...
The Problem class.
Definition: problem.h:152
void operator=(const SolidICProblem &)
Broken assignment operator.
double * value_pt(const unsigned &i) const
Return the pointer to the i-the stored value. Typically this is required when direct access to the st...
Definition: nodes.h:322
Mesh *& mesh_pt()
Return a pointer to the global mesh.
Definition: problem.h:1264
OomphInfo oomph_info
long & eqn_number(const unsigned &i)
Return the equation number of the i-th stored variable.
Definition: nodes.h:365
Dummy mesh that can be created and deleted in SolidICProblem.
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
Definition: nodes.h:448
void enable_solve_for_consistent_newmark_accel()
Set to alter the problem being solved when assigning the initial conditions for time-dependent proble...
Definition: elements.h:3697
MultiplierFctPt & multiplier_fct_pt()
Access function: Pointer to multiplicator function for assignment of consistent assignement of initia...
Definition: elements.h:3706
unsigned long nelement() const
Return number of elements in the mesh.
Definition: mesh.h:587
void backup_original_state()
Backup original state of all data associated with mesh.
TimeStepper *& time_stepper_pt()
Access function for pointer to time stepper: Null if object is not time-dependent.
Definition: geom_objects.h:197
void reset_original_state()
Reset original state of all data associated with mesh.
GeneralisedElement *& element_pt(const unsigned long &e)
Return pointer to element e.
Definition: mesh.h:462
Time *const & time_pt() const
Access function for the pointer to time (const version)
Definition: timesteppers.h:540
void set_value(const unsigned &i, const double &value_)
Set the i-th stored data value to specified value. The only reason that we require an explicit set fu...
Definition: nodes.h:267
void actions_before_newton_solve()
Update the problem specs before solve. (empty)
void set_static_initial_condition(Problem *problem_pt, Mesh *mesh_pt, SolidInitialCondition *ic_pt, const double &time)
Force the elastic structure that is discretised on the specified mesh to deform in the shape of the i...
Time *& time_pt()
Return a pointer to the global time object.
Definition: problem.h:1446
A class that represents a collection of data; each Data object may contain many different individual ...
Definition: nodes.h:89
SolidInitialCondition * IC_pt
Pointer to initial condition object.
virtual void get_residuals(DoubleVector &residuals)
Return the fully-assembled residuals Vector for the problem: Virtual so it can be overloaded in for m...
Definition: problem.cc:3671
double & time()
Return the current value of the continuous time.
Definition: timesteppers.h:130
Node *& node_pt(const unsigned long &n)
Return pointer to global node n.
Definition: mesh.h:456
void actions_after_newton_solve()
Update after solve (empty)
A Class for nodes that deform elastically (i.e. position is an unknown in the problem). The idea is that the Eulerian positions are stored in a Data object and the Lagrangian coordinates are stored in addition. The pointer that addresses the Eulerian positions is set to the pointer to Value in the Data object. Hence, SolidNode uses knowledge of the internal structure of Data and must be a friend of the Data class. In order to allow a mesh to deform via an elastic-style equation in deforming-domain problems, the positions are stored separately from the values, so that elastic problems may be combined with any other type of problem.
Definition: nodes.h:1568
LinearSolver *& linear_solver_pt()
Return a pointer to the linear solver object.
Definition: problem.h:1424
void broken_assign(const std::string &class_name)
Issue error message and terminate execution.
Vector< int > Backup_pinned
Vector to store pinned status of all data.
unsigned long assign_eqn_numbers(const bool &assign_local_eqn_numbers=true)
Assign all equation numbers for problem: Deals with global data (= data that isn't attached to any el...
Definition: problem.cc:1965
Vector< Vector< Data * > > Backup_ext_data
Vector of Vectors to store pointers to exernal data in the elements.
A vector in the mathematical sense, initially developed for linear algebra type applications. If MPI then this vector can be distributed - its distribution is described by the LinearAlgebraDistribution object at Distribution_pt. Data is stored in a C-style pointer vector (double*)
Definition: double_vector.h:61
SolidICProblem(const SolidICProblem &)
Broken copy constructor.
double(* MultiplierFctPt)(const Vector< double > &xi)
Pointer to function that computes the "multiplier" for the inertia terms in the consistent determinat...
Definition: elements.h:3339
double value(const unsigned &i) const
Return i-th stored value. This function is not virtual so that it can be inlined. This means that if ...
Definition: nodes.h:291
SolidFiniteElement class.
Definition: elements.h:3320
void set_static_initial_condition(Problem *problem_pt, Mesh *mesh_pt, SolidInitialCondition *ic_pt)
Force the elastic structure that is discretised on the specified mesh to deform in the shape of the i...
double max() const
returns the maximum coefficient
A general mesh class.
Definition: mesh.h:74
IC problem for an elastic body discretised on a given (sub)-mesh. We switch the elements' residuals a...
double & time()
Return the current value of continuous time.
Definition: problem.cc:11377