26 #ifndef OOMPH_ELASTIC_PROBLEMS_HEADER
27 #define OOMPH_ELASTIC_PROBLEMS_HEADER
31 #include <oomph-lib-config.h>
138 template<
class TIMESTEPPER>
141 TIMESTEPPER* timestepper_pt,
159 template<
class TIMESTEPPER>
163 TIMESTEPPER* timestepper_pt,
211 template<
class TIMESTEPPER>
215 TIMESTEPPER* timestepper_pt,
220 if (timestepper_pt->type() !=
"Newmark")
222 std::ostringstream error_message;
224 <<
"SolidICProblem::set_newmark_initial_condition_directly()\n"
225 <<
"can only be called for Newmark type timestepper whereas\n "
226 <<
"you've called it for " << timestepper_pt->type() << std::endl;
230 "SolidICProblem::set_newmark_initial_condition_directly()",
236 timestepper_pt->time_pt()->dt() = dt;
239 timestepper_pt->set_weights();
261 double current_time = timestepper_pt->time_pt()->time();
262 double previous_time = timestepper_pt->time_pt()->time(1);
272 for (
unsigned t_deriv = 0; t_deriv <= 2; t_deriv++)
283 for (
unsigned n = 0;
n < n_node;
n++)
287 timestepper_pt->assign_initial_data_values_stage1(
290 ->variable_position_pt());
315 for (
unsigned n = 0;
n < n_node;
n++)
317 timestepper_pt->assign_initial_data_values_stage2(
319 ->variable_position_pt());
335 oomph_info <<
"Number of equations in big problem: "
355 template<
class TIMESTEPPER>
359 TIMESTEPPER* timestepper_pt,
365 if (timestepper_pt->type() !=
"Newmark")
367 std::ostringstream error_message;
369 <<
"SolidICProblem::set_newmark_initial_condition_consistently()\n"
370 <<
"can only be called for Newmark type timestepper whereas\n "
371 <<
"you've called it for " << timestepper_pt->type() << std::endl;
375 "SolidICProblem::set_newmark_initial_condition_consistently()",
381 timestepper_pt->time_pt()->dt() = dt;
384 timestepper_pt->set_weights();
417 for (
unsigned i = 0;
i <= nprevtime;
i++)
425 for (
unsigned i = 1;
i <= nprevtime;
i++)
443 for (
unsigned n = 0;
n < n_node;
n++)
447 ->variable_position_pt();
449 unsigned nval = position_data_pt->
nvalue();
453 for (
unsigned ival = 0; ival < nval; ival++)
456 i, ival, position_data_pt->
value(0, ival));
484 for (
unsigned n = 0;
n < n_node;
n++)
487 Data* position_data_pt =
491 unsigned nval = position_data_pt->
nvalue();
495 for (
unsigned ival = 0; ival < nval; ival++)
498 ntstorage - 2, ival, position_data_pt->
value(0, ival));
499 position_data_pt->
set_value(ntstorage - 1, ival, 0.0);
527 for (
unsigned i = 0;
i < Nelement;
i++)
559 for (
unsigned n = 0;
n < n_node;
n++)
562 Data* position_data_pt =
566 unsigned nval = position_data_pt->
nvalue();
571 for (
unsigned ival = 0; ival < nval; ival++)
574 int ieqn = position_data_pt->
eqn_number(ival);
580 "No positional dofs should be pinned at this stage!",
587 *(position_data_pt->
value_pt(ntstorage - 1, ival)) -= correction[ieqn];
596 double res_max = residuals.
max();
598 <<
"Max. residual after assigning consistent initial conditions: "
599 << res_max << std::endl;
602 std::ostringstream error_message;
603 error_message <<
"Residual is bigger than allowed! [Current tolerance: "
605 error_message <<
"This is probably because you've not specified the "
606 <<
"correct multiplier \n(the product of growth factor "
607 <<
"and timescale ratio [the non-dim density]). \nPlease "
608 <<
"check the Solid Mechanics Theory Tutorial for "
610 <<
"If you're sure that the residual is OK, overwrite "
611 <<
"the default tolerance using\n";
613 <<
"SolidICProblem::max_residual_after_consistent_newton_ic()"
615 <<
"or recompile without the PARANOID flag." << std::endl;
631 oomph_info <<
"Number of equations in big problem: "
int i
Definition: BiCGSTAB_step_by_step.cpp:9
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
long & eqn_number(const unsigned &i)
Return the equation number of the i-th stored variable.
Definition: nodes.h:367
double * value_pt(const unsigned &i) const
Definition: nodes.h:324
void set_value(const unsigned &i, const double &value_)
Definition: nodes.h:271
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
Definition: nodes.h:483
double value(const unsigned &i) const
Definition: nodes.h:293
Definition: double_vector.h:58
double max() const
returns the maximum coefficient
Definition: double_vector.cc:604
Definition: elastic_problems.h:54
DummyMesh()
Definition: elastic_problems.h:57
TimeStepper *& time_stepper_pt()
Definition: geom_objects.h:192
Definition: linear_solver.h:68
virtual void solve(Problem *const &problem_pt, DoubleVector &result)=0
GeneralisedElement *& element_pt(const unsigned long &e)
Return pointer to element e.
Definition: mesh.h:448
unsigned long nnode() const
Return number of nodes in the mesh.
Definition: mesh.h:596
Node *& node_pt(const unsigned long &n)
Return pointer to global node n.
Definition: mesh.h:436
unsigned long nelement() const
Return number of elements in the mesh.
Definition: mesh.h:590
Definition: oomph_definitions.h:222
Definition: problem.h:151
virtual void get_residuals(DoubleVector &residuals)
Get the total residuals Vector for the problem.
Definition: problem.cc:3714
LinearSolver *& linear_solver_pt()
Return a pointer to the linear solver object.
Definition: problem.h:1466
Mesh *& mesh_pt()
Return a pointer to the global mesh.
Definition: problem.h:1280
void newton_solve()
Use Newton method to solve the problem.
Definition: problem.cc:8783
unsigned long assign_eqn_numbers(const bool &assign_local_eqn_numbers=true)
Definition: problem.cc:1989
double & time()
Return the current value of continuous time.
Definition: problem.cc:11531
Definition: elements.h:3561
double(* MultiplierFctPt)(const Vector< double > &xi)
Definition: elements.h:3582
void enable_solve_for_consistent_newmark_accel()
Definition: elements.h:3966
MultiplierFctPt & multiplier_fct_pt()
Definition: elements.h:3979
SolidInitialCondition *& solid_ic_pt()
Pointer to object that describes the initial condition.
Definition: elements.h:3955
Definition: elastic_problems.h:88
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)
Definition: elastic_problems.h:356
void backup_original_state()
Backup original state of all data associated with mesh.
Definition: elastic_problems.cc:191
double & max_residual_after_consistent_newton_ic()
Definition: elastic_problems.h:172
Vector< Vector< Data * > > Backup_ext_data
Vector of Vectors to store pointers to exernal data in the elements.
Definition: elastic_problems.h:196
void operator=(const SolidICProblem &)=delete
Broken assignment operator.
void setup_problem()
Definition: elastic_problems.cc:48
void set_static_initial_condition(Problem *problem_pt, Mesh *mesh_pt, SolidInitialCondition *ic_pt, const double &time)
Definition: elastic_problems.cc:522
SolidICProblem(const SolidICProblem &)=delete
Broken copy constructor.
Vector< int > Backup_pinned
Vector to store pinned status of all data.
Definition: elastic_problems.h:193
double Max_residual_after_consistent_newton_ic
Definition: elastic_problems.h:201
void reset_original_state()
Reset original state of all data associated with mesh.
Definition: elastic_problems.cc:343
SolidInitialCondition * IC_pt
Pointer to initial condition object.
Definition: elastic_problems.h:190
void set_newmark_initial_condition_directly(Problem *problem_pt, Mesh *mesh_pt, TIMESTEPPER *timestepper_pt, SolidInitialCondition *ic_pt, const double &dt)
Definition: elastic_problems.h:212
void actions_before_newton_solve()
Update the problem specs before solve. (empty)
Definition: elastic_problems.h:114
SolidICProblem()
Definition: elastic_problems.h:94
void set_static_initial_condition(Problem *problem_pt, Mesh *mesh_pt, SolidInitialCondition *ic_pt)
Definition: elastic_problems.h:126
void actions_after_newton_solve()
Update after solve (empty)
Definition: elastic_problems.h:111
Definition: elements.h:3496
GeomObject *& geom_object_pt()
Definition: elements.h:3511
unsigned & ic_time_deriv()
Which time derivative are we currently assigning?
Definition: elements.h:3517
virtual unsigned nprev_values() const =0
Number of previous values available: 0 for static, 1 for BDF<1>,...
unsigned ntstorage() const
Definition: timesteppers.h:601
Time *const & time_pt() const
Access function for the pointer to time (const version)
Definition: timesteppers.h:572
double & time()
Return the current value of the continuous time.
Definition: timesteppers.h:123
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
Definition: AnisotropicHookean.h:10
OomphInfo oomph_info
Definition: oomph_definitions.cc:319
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86
Constructor for SteadyAxisymAdvectionDiffusion problem
Definition: steady_axisym_advection_diffusion.cc:213