Flow123d  3.9.0-b05f67a5a
elasticity.cc
Go to the documentation of this file.
1 /*!
2  *
3  * Copyright (C) 2015 Technical University of Liberec. All rights reserved.
4  *
5  * This program is free software; you can redistribute it and/or modify it under
6  * the terms of the GNU General Public License version 3 as published by the
7  * Free Software Foundation. (http://www.gnu.org/licenses/gpl-3.0.en.html)
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12  *
13  *
14  * @file transport_dg.cc
15  * @brief Discontinuous Galerkin method for equation of transport with dispersion.
16  * @author Jan Stebel
17  */
18 
19 #include "system/sys_profiler.hh"
20 #include "mechanics/elasticity.hh"
22 
23 #include "io/output_time.hh"
25 #include "fem/fe_values.hh"
26 #include "fem/fe_p.hh"
27 #include "fem/fe_rt.hh"
28 #include "fem/fe_system.hh"
29 #include "fields/field_fe.hh"
30 #include "la/linsys_PETSC.hh"
31 #include "coupling/balance.hh"
32 #include "mesh/neighbours.h"
34 
35 #include "fields/multi_field.hh"
36 #include "fields/generic_field.hh"
37 #include "fields/field_model.hh"
38 #include "input/factory.hh"
39 
40 
41 
42 
43 using namespace Input::Type;
44 
45 
46 
48  std::string equation_name = std::string(name_) + "_FE";
49  return IT::Record(
50  std::string(equation_name),
51  "FEM for linear elasticity.")
53  .declare_key("balance", Balance::get_input_type(), Default("{}"),
54  "Settings for computing balance.")
56  "Parameters of output stream.")
58  "Linear solver for elasticity.")
59  .declare_key("input_fields", Array(
61  .make_field_descriptor_type(equation_name)),
63  "Input fields of the equation.")
64  .declare_key("output",
65  EqFields().output_fields.make_output_type(equation_name, ""),
66  IT::Default("{ \"fields\": [ \"displacement\" ] }"),
67  "Setting of the field output.")
68  .close();
69 }
70 
71 const int Elasticity::registrar =
72  Input::register_class< Elasticity, Mesh &, const Input::Record>(std::string(name_) + "_FE") +
74 
75 
76 
77 double lame_mu(double young, double poisson)
78 {
79  return young*0.5/(poisson+1.);
80 }
81 
82 
83 double lame_lambda(double young, double poisson)
84 {
85  return young*poisson/((poisson+1.)*(1.-2.*poisson));
86 }
87 
88 // Functor computing lame_mu
89 struct fn_lame_mu {
90  inline double operator() (double young, double poisson) {
91  return young * 0.5 / (poisson+1.);
92  }
93 };
94 
95 // Functor computing lame_lambda
97  inline double operator() (double young, double poisson) {
98  return young * poisson / ((poisson+1.)*(1.-2.*poisson));
99  }
100 };
101 
102 // Functor computing base of dirichlet_penalty (without dividing by side meassure)
104  inline double operator() (double lame_mu, double lame_lambda) {
105  return 1e3 * (2 * lame_mu + lame_lambda);
106  }
107 };
108 
109 
110 
111 
112 
113 
115  return Selection("Elasticity_BC_Type", "Types of boundary conditions for mechanics.")
116  .add_value(bc_type_displacement, "displacement",
117  "Prescribed displacement.")
118  .add_value(bc_type_displacement_normal, "displacement_n",
119  "Prescribed displacement in the normal direction to the boundary.")
120  .add_value(bc_type_traction, "traction",
121  "Prescribed traction.")
122  .add_value(bc_type_stress, "stress",
123  "Prescribed stress tensor.")
124  .close();
125 }
126 
127 
129 {
130  *this+=bc_type
131  .name("bc_type")
132  .description(
133  "Type of boundary condition.")
134  .units( UnitSI::dimensionless() )
135  .input_default("\"traction\"")
136  .input_selection( get_bc_type_selection() )
138 
139  *this+=bc_displacement
140  .name("bc_displacement")
141  .description("Prescribed displacement on boundary.")
142  .units( UnitSI().m() )
143  .input_default("0.0")
144  .flags_add(in_rhs);
145 
146  *this+=bc_traction
147  .name("bc_traction")
148  .description("Prescribed traction on boundary.")
149  .units( UnitSI().Pa() )
150  .input_default("0.0")
151  .flags_add(in_rhs);
152 
153  *this+=bc_stress
154  .name("bc_stress")
155  .description("Prescribed stress on boundary.")
156  .units( UnitSI().Pa() )
157  .input_default("0.0")
158  .flags_add(in_rhs);
159 
160  *this+=load
161  .name("load")
162  .description("Prescribed bulk load.")
163  .units( UnitSI().N().m(-3) )
164  .input_default("0.0")
165  .flags_add(in_rhs);
166 
167  *this+=young_modulus
168  .name("young_modulus")
169  .description("Young's modulus.")
170  .units( UnitSI().Pa() )
171  .input_default("0.0")
172  .flags_add(in_main_matrix & in_rhs);
173 
174  *this+=poisson_ratio
175  .name("poisson_ratio")
176  .description("Poisson's ratio.")
177  .units( UnitSI().dimensionless() )
178  .input_default("0.0")
179  .flags_add(in_main_matrix & in_rhs);
180 
181  *this+=fracture_sigma
182  .name("fracture_sigma")
183  .description(
184  "Coefficient of transfer of forces through fractures.")
185  .units( UnitSI::dimensionless() )
186  .input_default("1.0")
187  .flags_add(in_main_matrix & in_rhs);
188 
189  *this+=initial_stress
190  .name("initial_stress")
191  .description("Initial stress tensor.")
192  .units( UnitSI().Pa() )
193  .input_default("0.0")
194  .flags_add(in_rhs);
195 
196  *this += region_id.name("region_id")
197  .units( UnitSI::dimensionless())
199 
200  *this += subdomain.name("subdomain")
201  .units( UnitSI::dimensionless() )
203 
204  *this+=cross_section
205  .name("cross_section")
206  .units( UnitSI().m(3).md() )
207  .flags(input_copy & in_time_term & in_main_matrix & in_rhs);
208 
209  *this+=potential_load
210  .name("potential_load")
211  .units( UnitSI().m() )
212  .flags(input_copy & in_rhs);
213 
214  *this+=output_field
215  .name("displacement")
216  .description("Displacement vector field output.")
217  .units( UnitSI().m() )
218  .flags(equation_result);
219 
220  *this += output_stress
221  .name("stress")
222  .description("Stress tensor output.")
223  .units( UnitSI().Pa() )
224  .flags(equation_result);
225 
226  *this += output_von_mises_stress
227  .name("von_mises_stress")
228  .description("von Mises stress output.")
229  .units( UnitSI().Pa() )
230  .flags(equation_result);
231 
232  *this += output_mean_stress
233  .name("mean_stress")
234  .description("mean stress output.")
235  .units( UnitSI().Pa() )
236  .flags(equation_result);
237 
238  *this += output_cross_section
239  .name("cross_section_updated")
240  .description("Cross-section after deformation - output.")
241  .units( UnitSI().m() )
242  .flags(equation_result);
243 
244  *this += output_divergence
245  .name("displacement_divergence")
246  .description("Displacement divergence output.")
247  .units( UnitSI().dimensionless() )
248  .flags(equation_result);
249 
250  *this += lame_mu.name("lame_mu")
251  .description("Field lame_mu.")
252  .input_default("0.0")
253  .units( UnitSI().Pa() );
254 
255  *this += lame_lambda.name("lame_lambda")
256  .description("Field lame_lambda.")
257  .input_default("0.0")
258  .units( UnitSI().Pa() );
259 
260  *this += dirichlet_penalty.name("dirichlet_penalty")
261  .description("Field dirichlet_penalty.")
262  .input_default("0.0")
263  .units( UnitSI().Pa() );
264 
265  // add all input fields to the output list
266  output_fields += *this;
267 
268 }
269 
270 void Elasticity::EqData::create_dh(Mesh * mesh, unsigned int fe_order)
271 {
272  ASSERT_EQ(fe_order, 1)(fe_order).error("Unsupported polynomial order for finite elements in Elasticity");
273  MixedPtr<FE_P> fe_p(1);
275 
276  std::shared_ptr<DiscreteSpace> ds = std::make_shared<EqualOrderDiscreteSpace>(mesh, fe);
277  dh_ = std::make_shared<DOFHandlerMultiDim>(*mesh);
278 
279  dh_->distribute_dofs(ds);
280 
281 
282  MixedPtr<FE_P_disc> fe_p_disc(0);
283  dh_scalar_ = make_shared<DOFHandlerMultiDim>(*mesh);
284  std::shared_ptr<DiscreteSpace> ds_scalar = std::make_shared<EqualOrderDiscreteSpace>( mesh, fe_p_disc);
285  dh_scalar_->distribute_dofs(ds_scalar);
286 
287 
289  dh_tensor_ = make_shared<DOFHandlerMultiDim>(*mesh);
290  std::shared_ptr<DiscreteSpace> dst = std::make_shared<EqualOrderDiscreteSpace>( mesh, fe_t);
291  dh_tensor_->distribute_dofs(dst);
292 }
293 
294 
295 Elasticity::Elasticity(Mesh & init_mesh, const Input::Record in_rec, TimeGovernor *tm)
296  : EquationBase(init_mesh, in_rec),
297  input_rec(in_rec),
298  stiffness_assembly_(nullptr),
299  rhs_assembly_(nullptr),
300  output_fields_assembly_(nullptr)
301 {
302  // Can not use name() + "constructor" here, since START_TIMER only accepts const char *
303  // due to constexpr optimization.
305 
306  eq_data_ = std::make_shared<EqData>();
307  eq_fields_ = std::make_shared<EqFields>();
308  eq_fields_->add_coords_field();
309  this->eq_fieldset_ = eq_fields_.get();
310 
311  auto time_rec = in_rec.val<Input::Record>("time");
312  if (tm == nullptr)
313  {
314  time_ = new TimeGovernor(time_rec);
315  }
316  else
317  {
318  TimeGovernor time_from_rec(time_rec);
319  ASSERT( time_from_rec.is_default() ).error("Duplicate key 'time', time in elasticity is already initialized from parent class!");
320  time_ = tm;
321  }
322 
323 
324  // Set up physical parameters.
325  eq_fields_->set_mesh(init_mesh);
328  eq_data_->balance_ = this->balance();
329 
330  // create finite element structures and distribute DOFs
331  eq_data_->create_dh(mesh_, 1);
332  DebugOut().fmt("Mechanics: solution size {}\n", eq_data_->dh_->n_global_dofs());
333 
334 }
335 
336 
338 {
339  output_stream_ = OutputTime::create_output_stream("mechanics", input_rec.val<Input::Record>("output_stream"), time().get_unit_conversion());
340 
341  eq_fields_->set_components({"displacement"});
342  eq_fields_->set_input_list( input_rec.val<Input::Array>("input_fields"), time() );
343 
344 // balance_ = std::make_shared<Balance>("mechanics", mesh_);
345 // balance_->init_from_input(input_rec.val<Input::Record>("balance"), *time_);
346  // initialization of balance object
347 // eq_data_->balance_idx_ = {
348 // balance_->add_quantity("force_x"),
349 // balance_->add_quantity("force_y"),
350 // balance_->add_quantity("force_z")
351 // };
352 // balance_->units(UnitSI().kg().m().s(-2));
353 
354  // create shared pointer to a FieldFE, pass FE data and push this FieldFE to output_field on all regions
355  eq_fields_->output_field_ptr = create_field_fe<3, FieldValue<3>::VectorFixed>(eq_data_->dh_);
356  eq_fields_->output_field.set(eq_fields_->output_field_ptr, 0.);
357 
358  // setup output stress
359  eq_fields_->output_stress_ptr = create_field_fe<3, FieldValue<3>::TensorFixed>(eq_data_->dh_tensor_);
360  eq_fields_->output_stress.set(eq_fields_->output_stress_ptr, 0.);
361 
362  // setup output von Mises stress
363  eq_fields_->output_von_mises_stress_ptr = create_field_fe<3, FieldValue<3>::Scalar>(eq_data_->dh_scalar_);
364  eq_fields_->output_von_mises_stress.set(eq_fields_->output_von_mises_stress_ptr, 0.);
365 
366  // setup output mean stress
367  eq_fields_->output_mean_stress_ptr = create_field_fe<3, FieldValue<3>::Scalar>(eq_data_->dh_scalar_);
368  eq_fields_->output_mean_stress.set(eq_fields_->output_mean_stress_ptr, 0.);
369 
370  // setup output cross-section
371  eq_fields_->output_cross_section_ptr = create_field_fe<3, FieldValue<3>::Scalar>(eq_data_->dh_scalar_);
372  eq_fields_->output_cross_section.set(eq_fields_->output_cross_section_ptr, 0.);
373 
374  // setup output divergence
375  eq_fields_->output_div_ptr = create_field_fe<3, FieldValue<3>::Scalar>(eq_data_->dh_scalar_);
376  eq_fields_->output_divergence.set(eq_fields_->output_div_ptr, 0.);
377 
378  eq_fields_->output_fields.set_mesh(*mesh_);
379  eq_fields_->output_field.output_type(OutputTime::CORNER_DATA);
380 
381  // set time marks for writing the output
382  eq_fields_->output_fields.initialize(output_stream_, mesh_, input_rec.val<Input::Record>("output"), this->time());
383 
384  // set instances of FieldModel
385  eq_fields_->lame_mu.set(Model<3, FieldValue<3>::Scalar>::create(fn_lame_mu(), eq_fields_->young_modulus, eq_fields_->poisson_ratio), 0.0);
386  eq_fields_->lame_lambda.set(Model<3, FieldValue<3>::Scalar>::create(fn_lame_lambda(), eq_fields_->young_modulus, eq_fields_->poisson_ratio), 0.0);
387  eq_fields_->dirichlet_penalty.set(Model<3, FieldValue<3>::Scalar>::create(fn_dirichlet_penalty(), eq_fields_->lame_mu, eq_fields_->lame_lambda), 0.0);
388 
389  // equation default PETSc solver options
390  std::string petsc_default_opts;
391  petsc_default_opts = "-ksp_type cg -pc_type hypre -pc_hypre_type boomeramg";
392 
393  // allocate matrix and vector structures
394  LinSys_PETSC *ls = new LinSys_PETSC(eq_data_->dh_->distr().get(), petsc_default_opts);
395  ls->set_from_input( input_rec.val<Input::Record>("solver") );
396  ls->set_solution(eq_fields_->output_field_ptr->vec().petsc_vec());
398  eq_data_->ls = ls;
399 
403 
404  // initialization of balance object
405 // balance_->allocate(eq_data_->dh_->distr()->lsize(),
406 // max(feo->fe<1>()->n_dofs(), max(feo->fe<2>()->n_dofs(), feo->fe<3>()->n_dofs())));
407 
408 }
409 
410 
412 {
413 // delete time_;
414 
415  if (stiffness_assembly_!=nullptr) delete stiffness_assembly_;
416  if (rhs_assembly_!=nullptr) delete rhs_assembly_;
418 
419  eq_data_.reset();
420  eq_fields_.reset();
421 }
422 
423 
424 
426 {
427  eq_fields_->set_time(time_->step(), LimitSide::right);
428 
429  // update ghost values of solution vector and prepare dependent fields
430  eq_fields_->output_field_ptr->vec().local_to_ghost_begin();
431  eq_fields_->output_stress_ptr->vec().zero_entries();
432  eq_fields_->output_cross_section_ptr->vec().zero_entries();
433  eq_fields_->output_div_ptr->vec().zero_entries();
434  eq_fields_->output_field_ptr->vec().local_to_ghost_end();
435 
436  // compute new output fields depending on solution (stress, divergence etc.)
438 
439  // update ghost values of computed fields
440  eq_fields_->output_stress_ptr->vec().local_to_ghost_begin();
441  eq_fields_->output_von_mises_stress_ptr->vec().local_to_ghost_begin();
442  eq_fields_->output_mean_stress_ptr->vec().local_to_ghost_begin();
443  eq_fields_->output_cross_section_ptr->vec().local_to_ghost_begin();
444  eq_fields_->output_div_ptr->vec().local_to_ghost_begin();
445  eq_fields_->output_stress_ptr->vec().local_to_ghost_end();
446  eq_fields_->output_von_mises_stress_ptr->vec().local_to_ghost_end();
447  eq_fields_->output_mean_stress_ptr->vec().local_to_ghost_end();
448  eq_fields_->output_cross_section_ptr->vec().local_to_ghost_end();
449  eq_fields_->output_div_ptr->vec().local_to_ghost_end();
450 }
451 
452 
453 
454 
456 {
458  eq_fields_->mark_input_times( *time_ );
459  eq_fields_->set_time(time_->step(), LimitSide::right);
460  std::stringstream ss; // print warning message with table of uninitialized fields
461  if ( FieldCommon::print_message_table(ss, "mechanics") ) {
462  WarningOut() << ss.str();
463  }
464 
465  preallocate();
466 
467 
468  // after preallocation we assemble the matrices and vectors required for balance of forces
469 // for (auto subst_idx : eq_data_->balance_idx_)
470 // balance_->calculate_instant(subst_idx, eq_data_->ls->get_solution());
471 
472 // update_solution();
473  eq_data_->ls->start_add_assembly();
474  MatSetOption(*eq_data_->ls->get_matrix(), MAT_KEEP_NONZERO_PATTERN, PETSC_TRUE);
475  eq_data_->ls->mat_zero_entries();
476  eq_data_->ls->rhs_zero_entries();
479  eq_data_->ls->finish_assembly();
480  LinSys::SolveInfo si = eq_data_->ls->solve();
481  MessageOut().fmt("[mech solver] lin. it: {}, reason: {}, residual: {}\n",
482  si.n_iterations, si.converged_reason, eq_data_->ls->compute_residual());
483  output_data();
484 }
485 
486 
487 
489 {
490  // preallocate system matrix
491  eq_data_->ls->start_allocation();
494 }
495 
496 
497 
498 
500 {
501  START_TIMER("DG-ONE STEP");
502 
503  next_time();
505 
507 
508  output_data();
509 
510  END_TIMER("DG-ONE STEP");
511 }
512 
514 {
515  time_->next_time();
516  time_->view("MECH");
517 
518 }
519 
520 
521 
523 {
524  START_TIMER("data reinit");
525  eq_fields_->set_time(time_->step(), LimitSide::right);
526  END_TIMER("data reinit");
527 
528  // assemble stiffness matrix
529  if (eq_data_->ls->get_matrix() == NULL
530  || eq_fields_->subset(FieldFlag::in_main_matrix).changed())
531  {
532  DebugOut() << "Mechanics: Assembling matrix.\n";
533  eq_data_->ls->start_add_assembly();
534  eq_data_->ls->mat_zero_entries();
536  eq_data_->ls->finish_assembly();
537  }
538 
539  // assemble right hand side (due to sources and boundary conditions)
540  if (eq_data_->ls->get_rhs() == NULL
541  || eq_fields_->subset(FieldFlag::in_rhs).changed())
542  {
543  DebugOut() << "Mechanics: Assembling right hand side.\n";
544  eq_data_->ls->start_add_assembly();
545  eq_data_->ls->rhs_zero_entries();
547  eq_data_->ls->finish_assembly();
548  }
549 
550  START_TIMER("solve");
551  LinSys::SolveInfo si = eq_data_->ls->solve();
552  MessageOut().fmt("[mech solver] lin. it: {}, reason: {}, residual: {}\n",
553  si.n_iterations, si.converged_reason, eq_data_->ls->compute_residual());
554  END_TIMER("solve");
555 }
556 
557 
558 
559 
560 
561 
563 {
564  START_TIMER("MECH-OUTPUT");
565 
566  // gather the solution from all processors
567  eq_fields_->output_fields.set_time( this->time().step(), LimitSide::left);
568  //if (eq_fields_->output_fields.is_field_output_time(eq_fields_->output_field, this->time().step()) )
570  eq_fields_->output_fields.output(this->time().step());
571 
572 // START_TIMER("MECH-balance");
573 // balance_->calculate_instant(subst_idx, eq_data_->ls->get_solution());
574 // balance_->output();
575 // END_TIMER("MECH-balance");
576 
577  END_TIMER("MECH-OUTPUT");
578 }
579 
580 
581 
582 
584 {
585 // if (balance_->cumulative())
586 // {
587 // balance_->calculate_cumulative(subst_idx, eq_data_->ls->get_solution());
588 // }
589 }
590 
LimitSide::right
@ right
OutputTime::create_output_stream
static std::shared_ptr< OutputTime > create_output_stream(const std::string &equation_name, const Input::Record &in_rec, const std::shared_ptr< TimeUnitConversion > &time_unit_conv)
This method delete all object instances of class OutputTime stored in output_streams vector.
Definition: output_time.cc:187
FieldFlag::in_rhs
static constexpr Mask in_rhs
A field is part of the right hand side of the equation.
Definition: field_flag.hh:51
Elasticity::input_rec
Input::Record input_rec
Record with input specification.
Definition: elasticity.hh:236
Elasticity::EqFields
Definition: elasticity.hh:51
EquationBase::mesh_
Mesh * mesh_
Definition: equation.hh:220
LinSys::SolveInfo::n_iterations
int n_iterations
Definition: linsys.hh:110
fe_rt.hh
Definitions of Raviart-Thomas finite elements.
Elasticity::update_output_fields
void update_output_fields()
Definition: elasticity.cc:425
UnitSI::dimensionless
static UnitSI & dimensionless()
Returns dimensionless unit.
Definition: unit_si.cc:55
factory.hh
Elasticity::next_time
void next_time()
Pass to next time and update equation data.
Definition: elasticity.cc:513
neighbours.h
Elasticity::solve_linear_system
void solve_linear_system()
Solve without updating time step and without output.
Definition: elasticity.cc:522
LinSys_PETSC::set_initial_guess_nonzero
void set_initial_guess_nonzero(bool set_nonzero=true)
Definition: linsys_PETSC.cc:331
LinSys::SolveInfo
Definition: linsys.hh:105
ASSERT
#define ASSERT(expr)
Definition: asserts.hh:350
fn_dirichlet_penalty
Definition: elasticity.cc:103
fn_lame_lambda
Definition: elasticity.cc:96
EquationBase::time_
TimeGovernor * time_
Definition: equation.hh:221
Input::Record::val
const Ret val(const string &key) const
Definition: accessors_impl.hh:31
EquationBase::time
TimeGovernor & time()
Definition: equation.hh:149
Input::Type::Selection::close
const Selection & close() const
Close the Selection, no more values can be added.
Definition: type_selection.cc:65
fe_values.hh
Class FEValues calculates finite element data on the actual cells such as shape function values,...
LinSys_PETSC
Definition: linsys_PETSC.hh:43
LinSys::SolveInfo::converged_reason
int converged_reason
Definition: linsys.hh:109
field_fe.hh
linsys_PETSC.hh
Solver based on the original PETSc solver using MPIAIJ matrix and succesive Schur complement construc...
Elasticity::name_
static constexpr const char * name_
Definition: elasticity.hh:242
fe_system.hh
Class FESystem for compound finite elements.
GenericAssembly::assemble
void assemble(std::shared_ptr< DOFHandlerMultiDim > dh) override
General assemble methods.
Definition: generic_assembly.hh:204
FieldFlag::equation_external_output
static constexpr Mask equation_external_output
Match an output field, that can be also copy of other field.
Definition: field_flag.hh:58
Elasticity::calculate_cumulative_balance
void calculate_cumulative_balance()
Definition: elasticity.cc:583
fe_p.hh
Definitions of basic Lagrangean finite elements with polynomial shape functions.
Input::Type::Record::size
unsigned int size() const
Returns number of keys in the Record.
Definition: type_record.hh:602
Input::Type::Default
Class Input::Type::Default specifies default value of keys of a Input::Type::Record.
Definition: type_record.hh:61
EquationBase::balance
std::shared_ptr< Balance > balance() const
Definition: equation.hh:187
Elasticity::registrar
static const int registrar
Registrar of class to factory.
Definition: elasticity.hh:210
LimitSide::left
@ left
Elasticity::initialize
void initialize() override
Definition: elasticity.cc:337
Input::Record
Accessor to the data with type Type::Record.
Definition: accessors.hh:291
elasticity.hh
FEM for linear elasticity.
sys_profiler.hh
field_model.hh
generic_assembly.hh
quadrature_lib.hh
Definitions of particular quadrature rules on simplices.
TimeGovernor
Basic time management functionality for unsteady (and steady) solvers (class Equation).
Definition: time_governor.hh:317
TimeGovernor::step
const TimeStep & step(int index=-1) const
Definition: time_governor.cc:756
output_time.hh
GenericField::subdomain
static auto subdomain(Mesh &mesh) -> IndexField
Definition: generic_field.impl.hh:58
Input::Type::Default::obligatory
static Default obligatory()
The factory function to make an empty default value which is obligatory.
Definition: type_record.hh:110
FETensor
@ FETensor
Definition: finite_element.hh:204
FieldCommon::print_message_table
static bool print_message_table(ostream &stream, std::string equation_name)
Definition: field_common.cc:96
UnitSI
Class for representation SI units of Fields.
Definition: unit_si.hh:40
Elasticity::Elasticity
Elasticity(Mesh &init_mesh, const Input::Record in_rec, TimeGovernor *tm=nullptr)
Constructor.
Definition: elasticity.cc:295
ASSERT_EQ
#define ASSERT_EQ(a, b)
Definition of comparative assert macro (EQual) only for debug mode.
Definition: asserts.hh:332
Elasticity::preallocate
void preallocate()
Definition: elasticity.cc:488
Input::Type::Record::declare_key
Record & declare_key(const string &key, std::shared_ptr< TypeBase > type, const Default &default_value, const string &description, TypeBase::attribute_map key_attributes=TypeBase::attribute_map())
Declares a new key of the Record.
Definition: type_record.cc:503
mixed_fe_system
MixedPtr< FESystem > mixed_fe_system(MixedPtr< FiniteElement > fe, Args &&... args)
Definition: fe_system.hh:176
FEVector
@ FEVector
Definition: finite_element.hh:201
EquationBase
Definition: equation.hh:57
Input::Type::Selection
Template for classes storing finite set of named values.
Definition: type_selection.hh:65
TimeGovernor::view
void view(const char *name="") const
Definition: time_governor.cc:772
Input::Type::Record::close
Record & close() const
Close the Record for further declarations of keys.
Definition: type_record.cc:304
generic_field.hh
Elasticity::output_stream_
std::shared_ptr< OutputTime > output_stream_
Definition: elasticity.hh:233
Input::Type
Definition: balance.hh:41
Input::Type::Record
Record type proxy class.
Definition: type_record.hh:182
assembly_elasticity.hh
GenericField::region_id
static auto region_id(Mesh &mesh) -> IndexField
Definition: generic_field.impl.hh:39
FieldFlag::in_main_matrix
static constexpr Mask in_main_matrix
A field is part of main "stiffness matrix" of the equation.
Definition: field_flag.hh:49
LinSys_PETSC::set_from_input
void set_from_input(const Input::Record in_rec) override
Definition: linsys_PETSC.cc:470
Mesh
Definition: mesh.h:359
OutputTime::get_input_type
static const Input::Type::Record & get_input_type()
The specification of output stream.
Definition: output_time.cc:38
Input::Type::Record::copy_keys
Record & copy_keys(const Record &other)
Copy keys from other record.
Definition: type_record.cc:216
multi_field.hh
Input::Type::Array
Class for declaration of inputs sequences.
Definition: type_base.hh:339
Model
Definition: field_model.hh:338
Input::Array
Accessor to input data conforming to declared Array.
Definition: accessors.hh:566
WarningOut
#define WarningOut()
Macro defining 'warning' record of log.
Definition: logger.hh:278
lame_mu
double lame_mu(double young, double poisson)
Definition: elasticity.cc:77
EquationBase::record_template
static Input::Type::Record & record_template()
Template Record with common keys for derived equations.
Definition: equation.cc:35
OutputTime::CORNER_DATA
@ CORNER_DATA
Definition: output_time.hh:110
MixedPtr
Definition: mixed.hh:247
TimeGovernor::is_default
bool is_default()
Definition: time_governor.hh:388
LinSys::set_solution
void set_solution(Vec sol_vec)
Definition: linsys.hh:290
fn_lame_mu
Definition: elasticity.cc:89
Elasticity::eq_fields_
std::shared_ptr< EqFields > eq_fields_
Fields for model parameters.
Definition: elasticity.hh:221
EquationBase::eq_fieldset_
FieldSet * eq_fieldset_
Definition: equation.hh:229
Elasticity::~Elasticity
~Elasticity()
Destructor.
Definition: elasticity.cc:411
Elasticity::output_fields_assembly_
GenericAssembly< OutpuFieldsAssemblyElasticity > * output_fields_assembly_
Definition: elasticity.hh:248
balance.hh
Elasticity::get_input_type
static const Input::Type::Record & get_input_type()
Declare input record type for the equation TransportDG.
Definition: elasticity.cc:47
Elasticity::rhs_assembly_
GenericAssembly< RhsAssemblyElasticity > * rhs_assembly_
Definition: elasticity.hh:247
Elasticity::update_solution
void update_solution() override
Computes the solution in one time instant.
Definition: elasticity.cc:499
lame_lambda
double lame_lambda(double young, double poisson)
Definition: elasticity.cc:83
Elasticity::EqFields::EqFields
EqFields()
Definition: elasticity.cc:128
Elasticity::stiffness_assembly_
GenericAssembly< StiffnessAssemblyElasticity > * stiffness_assembly_
general assembly objects, hold assembly objects of appropriate dimension
Definition: elasticity.hh:246
DebugOut
#define DebugOut()
Macro defining 'debug' record of log.
Definition: logger.hh:284
Input::Type::Selection::add_value
Selection & add_value(const int value, const std::string &key, const std::string &description="", TypeBase::attribute_map attributes=TypeBase::attribute_map())
Adds one new value with name given by key to the Selection.
Definition: type_selection.cc:50
TimeGovernor::next_time
void next_time()
Proceed to the next time according to current estimated time step.
Definition: time_governor.cc:670
Elasticity::eq_data_
std::shared_ptr< EqData > eq_data_
Data for model parameters.
Definition: elasticity.hh:224
Elasticity::EqData::create_dh
void create_dh(Mesh *mesh, unsigned int fe_order)
Create DOF handler objects.
Definition: elasticity.cc:270
START_TIMER
#define START_TIMER(tag)
Starts a timer with specified tag.
Definition: sys_profiler.hh:115
GenericAssembly< StiffnessAssemblyElasticity >
Elasticity::zero_time_step
void zero_time_step() override
Initialize solution in the zero time.
Definition: elasticity.cc:455
LinSys_PETSC::get_input_type
static const Input::Type::Record & get_input_type()
Definition: linsys_PETSC.cc:32
Elasticity::output_data
void output_data()
Postprocesses the solution and writes to output file.
Definition: elasticity.cc:562
Elasticity::EqFields::get_bc_type_selection
static const Input::Type::Selection & get_bc_type_selection()
Definition: elasticity.cc:114
Balance::get_input_type
static const Input::Type::Record & get_input_type()
Main balance input record type.
Definition: balance.cc:53
END_TIMER
#define END_TIMER(tag)
Ends a timer with specified tag.
Definition: sys_profiler.hh:149
FieldValue
Definition: field_values.hh:645
MessageOut
#define MessageOut()
Macro defining 'message' record of log.
Definition: logger.hh:275