Flow123d  PE_user_fields-12e8aadde
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("user_fields", Array(Elasticity::EqFields().get_user_field(equation_name)),
61  "Input fields of the equation defined by user.")
62  .declare_key("input_fields", Array(
64  .make_field_descriptor_type(equation_name)),
66  "Input fields of the equation.")
67  .declare_key("output",
68  EqFields().output_fields.make_output_type(equation_name, ""),
69  IT::Default("{ \"fields\": [ \"displacement\" ] }"),
70  "Setting of the field output.")
71  .close();
72 }
73 
74 const int Elasticity::registrar =
75  Input::register_class< Elasticity, Mesh &, const Input::Record>(std::string(name_) + "_FE") +
77 
78 
79 
80 double lame_mu(double young, double poisson)
81 {
82  return young*0.5/(poisson+1.);
83 }
84 
85 
86 double lame_lambda(double young, double poisson)
87 {
88  return young*poisson/((poisson+1.)*(1.-2.*poisson));
89 }
90 
91 // Functor computing lame_mu
92 struct fn_lame_mu {
93  inline double operator() (double young, double poisson) {
94  return young * 0.5 / (poisson+1.);
95  }
96 };
97 
98 // Functor computing lame_lambda
100  inline double operator() (double young, double poisson) {
101  return young * poisson / ((poisson+1.)*(1.-2.*poisson));
102  }
103 };
104 
105 // Functor computing base of dirichlet_penalty (without dividing by side meassure)
107  inline double operator() (double lame_mu, double lame_lambda) {
108  return 1e3 * (2 * lame_mu + lame_lambda);
109  }
110 };
111 
112 
113 
114 
115 
116 
118  return Selection("Elasticity_BC_Type", "Types of boundary conditions for mechanics.")
119  .add_value(bc_type_displacement, "displacement",
120  "Prescribed displacement.")
121  .add_value(bc_type_displacement_normal, "displacement_n",
122  "Prescribed displacement in the normal direction to the boundary.")
123  .add_value(bc_type_traction, "traction",
124  "Prescribed traction.")
125  .add_value(bc_type_stress, "stress",
126  "Prescribed stress tensor.")
127  .close();
128 }
129 
130 
132 {
133  *this+=bc_type
134  .name("bc_type")
135  .description(
136  "Type of boundary condition.")
137  .units( UnitSI::dimensionless() )
138  .input_default("\"traction\"")
139  .input_selection( get_bc_type_selection() )
141 
142  *this+=bc_displacement
143  .name("bc_displacement")
144  .description("Prescribed displacement on boundary.")
145  .units( UnitSI().m() )
146  .input_default("0.0")
147  .flags_add(in_rhs);
148 
149  *this+=bc_traction
150  .name("bc_traction")
151  .description("Prescribed traction on boundary.")
152  .units( UnitSI().Pa() )
153  .input_default("0.0")
154  .flags_add(in_rhs);
155 
156  *this+=bc_stress
157  .name("bc_stress")
158  .description("Prescribed stress on boundary.")
159  .units( UnitSI().Pa() )
160  .input_default("0.0")
161  .flags_add(in_rhs);
162 
163  *this+=load
164  .name("load")
165  .description("Prescribed bulk load.")
166  .units( UnitSI().N().m(-3) )
167  .input_default("0.0")
168  .flags_add(in_rhs);
169 
170  *this+=young_modulus
171  .name("young_modulus")
172  .description("Young's modulus.")
173  .units( UnitSI().Pa() )
174  .input_default("0.0")
175  .flags_add(in_main_matrix & in_rhs);
176 
177  *this+=poisson_ratio
178  .name("poisson_ratio")
179  .description("Poisson's ratio.")
180  .units( UnitSI().dimensionless() )
181  .input_default("0.0")
182  .flags_add(in_main_matrix & in_rhs);
183 
184  *this+=fracture_sigma
185  .name("fracture_sigma")
186  .description(
187  "Coefficient of transfer of forces through fractures.")
188  .units( UnitSI::dimensionless() )
189  .input_default("1.0")
190  .flags_add(in_main_matrix & in_rhs);
191 
192  *this+=initial_stress
193  .name("initial_stress")
194  .description("Initial stress tensor.")
195  .units( UnitSI().Pa() )
196  .input_default("0.0")
197  .flags_add(in_rhs);
198 
199  *this += region_id.name("region_id")
200  .units( UnitSI::dimensionless())
202 
203  *this += subdomain.name("subdomain")
204  .units( UnitSI::dimensionless() )
206 
207  *this+=cross_section
208  .name("cross_section")
209  .units( UnitSI().m(3).md() )
210  .flags(input_copy & in_time_term & in_main_matrix & in_rhs);
211 
212  *this+=potential_load
213  .name("potential_load")
214  .units( UnitSI().m() )
215  .flags(input_copy & in_rhs);
216 
217  *this+=output_field
218  .name("displacement")
219  .description("Displacement vector field output.")
220  .units( UnitSI().m() )
221  .flags(equation_result);
222 
223  *this += output_stress
224  .name("stress")
225  .description("Stress tensor output.")
226  .units( UnitSI().Pa() )
227  .flags(equation_result);
228 
229  *this += output_von_mises_stress
230  .name("von_mises_stress")
231  .description("von Mises stress output.")
232  .units( UnitSI().Pa() )
233  .flags(equation_result);
234 
235  *this += output_mean_stress
236  .name("mean_stress")
237  .description("mean stress output.")
238  .units( UnitSI().Pa() )
239  .flags(equation_result);
240 
241  *this += output_cross_section
242  .name("cross_section_updated")
243  .description("Cross-section after deformation - output.")
244  .units( UnitSI().m() )
245  .flags(equation_result);
246 
247  *this += output_divergence
248  .name("displacement_divergence")
249  .description("Displacement divergence output.")
250  .units( UnitSI().dimensionless() )
251  .flags(equation_result);
252 
253  *this += lame_mu.name("lame_mu")
254  .description("Field lame_mu.")
255  .input_default("0.0")
256  .units( UnitSI().Pa() );
257 
258  *this += lame_lambda.name("lame_lambda")
259  .description("Field lame_lambda.")
260  .input_default("0.0")
261  .units( UnitSI().Pa() );
262 
263  *this += dirichlet_penalty.name("dirichlet_penalty")
264  .description("Field dirichlet_penalty.")
265  .input_default("0.0")
266  .units( UnitSI().Pa() );
267 
268  // add all input fields to the output list
269  output_fields += *this;
270 
271 }
272 
273 void Elasticity::EqData::create_dh(Mesh * mesh, unsigned int fe_order)
274 {
275  ASSERT_EQ(fe_order, 1)(fe_order).error("Unsupported polynomial order for finite elements in Elasticity");
276  MixedPtr<FE_P> fe_p(1);
278 
279  std::shared_ptr<DiscreteSpace> ds = std::make_shared<EqualOrderDiscreteSpace>(mesh, fe);
280  dh_ = std::make_shared<DOFHandlerMultiDim>(*mesh);
281 
282  dh_->distribute_dofs(ds);
283 
284 
285  MixedPtr<FE_P_disc> fe_p_disc(0);
286  dh_scalar_ = make_shared<DOFHandlerMultiDim>(*mesh);
287  std::shared_ptr<DiscreteSpace> ds_scalar = std::make_shared<EqualOrderDiscreteSpace>( mesh, fe_p_disc);
288  dh_scalar_->distribute_dofs(ds_scalar);
289 
290 
292  dh_tensor_ = make_shared<DOFHandlerMultiDim>(*mesh);
293  std::shared_ptr<DiscreteSpace> dst = std::make_shared<EqualOrderDiscreteSpace>( mesh, fe_t);
294  dh_tensor_->distribute_dofs(dst);
295 }
296 
297 
298 Elasticity::Elasticity(Mesh & init_mesh, const Input::Record in_rec, TimeGovernor *tm)
299  : EquationBase(init_mesh, in_rec),
300  input_rec(in_rec),
301  stiffness_assembly_(nullptr),
302  rhs_assembly_(nullptr),
303  output_fields_assembly_(nullptr)
304 {
305  // Can not use name() + "constructor" here, since START_TIMER only accepts const char *
306  // due to constexpr optimization.
308 
309  eq_data_ = std::make_shared<EqData>();
310  eq_fields_ = std::make_shared<EqFields>();
311  eq_fields_->add_coords_field();
312  this->eq_fieldset_ = eq_fields_.get();
313 
314  auto time_rec = in_rec.val<Input::Record>("time");
315  if (tm == nullptr)
316  {
317  time_ = new TimeGovernor(time_rec);
318  }
319  else
320  {
321  TimeGovernor time_from_rec(time_rec);
322  ASSERT( time_from_rec.is_default() ).error("Duplicate key 'time', time in elasticity is already initialized from parent class!");
323  time_ = tm;
324  }
325 
326 
327  // Set up physical parameters.
328  eq_fields_->set_mesh(init_mesh);
331  eq_data_->balance_ = this->balance();
332 
333  // create finite element structures and distribute DOFs
334  eq_data_->create_dh(mesh_, 1);
335  DebugOut().fmt("Mechanics: solution size {}\n", eq_data_->dh_->n_global_dofs());
336 
337 }
338 
339 
341 {
342  output_stream_ = OutputTime::create_output_stream("mechanics", input_rec.val<Input::Record>("output_stream"), time().get_unit_conversion());
343 
344  eq_fields_->set_components({"displacement"});
345  eq_fields_->set_input_list( input_rec.val<Input::Array>("input_fields"), time() );
346 
347 // balance_ = std::make_shared<Balance>("mechanics", mesh_);
348 // balance_->init_from_input(input_rec.val<Input::Record>("balance"), *time_);
349  // initialization of balance object
350 // eq_data_->balance_idx_ = {
351 // balance_->add_quantity("force_x"),
352 // balance_->add_quantity("force_y"),
353 // balance_->add_quantity("force_z")
354 // };
355 // balance_->units(UnitSI().kg().m().s(-2));
356 
357  // create shared pointer to a FieldFE, pass FE data and push this FieldFE to output_field on all regions
358  eq_fields_->output_field_ptr = create_field_fe<3, FieldValue<3>::VectorFixed>(eq_data_->dh_);
359  eq_fields_->output_field.set(eq_fields_->output_field_ptr, 0.);
360 
361  // setup output stress
362  eq_fields_->output_stress_ptr = create_field_fe<3, FieldValue<3>::TensorFixed>(eq_data_->dh_tensor_);
363  eq_fields_->output_stress.set(eq_fields_->output_stress_ptr, 0.);
364 
365  // setup output von Mises stress
366  eq_fields_->output_von_mises_stress_ptr = create_field_fe<3, FieldValue<3>::Scalar>(eq_data_->dh_scalar_);
367  eq_fields_->output_von_mises_stress.set(eq_fields_->output_von_mises_stress_ptr, 0.);
368 
369  // setup output mean stress
370  eq_fields_->output_mean_stress_ptr = create_field_fe<3, FieldValue<3>::Scalar>(eq_data_->dh_scalar_);
371  eq_fields_->output_mean_stress.set(eq_fields_->output_mean_stress_ptr, 0.);
372 
373  // setup output cross-section
374  eq_fields_->output_cross_section_ptr = create_field_fe<3, FieldValue<3>::Scalar>(eq_data_->dh_scalar_);
375  eq_fields_->output_cross_section.set(eq_fields_->output_cross_section_ptr, 0.);
376 
377  // setup output divergence
378  eq_fields_->output_div_ptr = create_field_fe<3, FieldValue<3>::Scalar>(eq_data_->dh_scalar_);
379  eq_fields_->output_divergence.set(eq_fields_->output_div_ptr, 0.);
380 
381  eq_fields_->output_fields.set_mesh(*mesh_);
382  eq_fields_->output_field.output_type(OutputTime::CORNER_DATA);
383 
384  // set time marks for writing the output
385  eq_fields_->output_fields.initialize(output_stream_, mesh_, input_rec.val<Input::Record>("output"), this->time());
386 
387  // set instances of FieldModel
388  eq_fields_->lame_mu.set(Model<3, FieldValue<3>::Scalar>::create(fn_lame_mu(), eq_fields_->young_modulus, eq_fields_->poisson_ratio), 0.0);
389  eq_fields_->lame_lambda.set(Model<3, FieldValue<3>::Scalar>::create(fn_lame_lambda(), eq_fields_->young_modulus, eq_fields_->poisson_ratio), 0.0);
390  eq_fields_->dirichlet_penalty.set(Model<3, FieldValue<3>::Scalar>::create(fn_dirichlet_penalty(), eq_fields_->lame_mu, eq_fields_->lame_lambda), 0.0);
391 
392  // read optional user fields
393  Input::Array user_fields_arr;
394  if (input_rec.opt_val("user_fields", user_fields_arr)) {
395  eq_fields_->set_user_fields_map(user_fields_arr);
396  }
397 
398  // equation default PETSc solver options
399  std::string petsc_default_opts;
400  petsc_default_opts = "-ksp_type cg -pc_type hypre -pc_hypre_type boomeramg";
401 
402  // allocate matrix and vector structures
403  LinSys_PETSC *ls = new LinSys_PETSC(eq_data_->dh_->distr().get(), petsc_default_opts);
404  ls->set_from_input( input_rec.val<Input::Record>("solver") );
405  ls->set_solution(eq_fields_->output_field_ptr->vec().petsc_vec());
407  eq_data_->ls = ls;
408 
412 
413  // initialization of balance object
414 // balance_->allocate(eq_data_->dh_->distr()->lsize(),
415 // max(feo->fe<1>()->n_dofs(), max(feo->fe<2>()->n_dofs(), feo->fe<3>()->n_dofs())));
416 
417 }
418 
419 
421 {
422 // delete time_;
423 
424  if (stiffness_assembly_!=nullptr) delete stiffness_assembly_;
425  if (rhs_assembly_!=nullptr) delete rhs_assembly_;
427 
428  eq_data_.reset();
429  eq_fields_.reset();
430 }
431 
432 
433 
435 {
436  eq_fields_->set_time(time_->step(), LimitSide::right);
437 
438  // update ghost values of solution vector and prepare dependent fields
439  eq_fields_->output_field_ptr->vec().local_to_ghost_begin();
440  eq_fields_->output_stress_ptr->vec().zero_entries();
441  eq_fields_->output_cross_section_ptr->vec().zero_entries();
442  eq_fields_->output_div_ptr->vec().zero_entries();
443  eq_fields_->output_field_ptr->vec().local_to_ghost_end();
444 
445  // compute new output fields depending on solution (stress, divergence etc.)
447 
448  // update ghost values of computed fields
449  eq_fields_->output_stress_ptr->vec().local_to_ghost_begin();
450  eq_fields_->output_von_mises_stress_ptr->vec().local_to_ghost_begin();
451  eq_fields_->output_mean_stress_ptr->vec().local_to_ghost_begin();
452  eq_fields_->output_cross_section_ptr->vec().local_to_ghost_begin();
453  eq_fields_->output_div_ptr->vec().local_to_ghost_begin();
454  eq_fields_->output_stress_ptr->vec().local_to_ghost_end();
455  eq_fields_->output_von_mises_stress_ptr->vec().local_to_ghost_end();
456  eq_fields_->output_mean_stress_ptr->vec().local_to_ghost_end();
457  eq_fields_->output_cross_section_ptr->vec().local_to_ghost_end();
458  eq_fields_->output_div_ptr->vec().local_to_ghost_end();
459 }
460 
461 
462 
463 
465 {
467  eq_fields_->mark_input_times( *time_ );
468  eq_fields_->set_time(time_->step(), LimitSide::right);
469  std::stringstream ss; // print warning message with table of uninitialized fields
470  if ( FieldCommon::print_message_table(ss, "mechanics") ) {
471  WarningOut() << ss.str();
472  }
473 
474  preallocate();
475 
476 
477  // after preallocation we assemble the matrices and vectors required for balance of forces
478 // for (auto subst_idx : eq_data_->balance_idx_)
479 // balance_->calculate_instant(subst_idx, eq_data_->ls->get_solution());
480 
481 // update_solution();
482  eq_data_->ls->start_add_assembly();
483  MatSetOption(*eq_data_->ls->get_matrix(), MAT_KEEP_NONZERO_PATTERN, PETSC_TRUE);
484  eq_data_->ls->mat_zero_entries();
485  eq_data_->ls->rhs_zero_entries();
488  eq_data_->ls->finish_assembly();
489  LinSys::SolveInfo si = eq_data_->ls->solve();
490  MessageOut().fmt("[mech solver] lin. it: {}, reason: {}, residual: {}\n",
491  si.n_iterations, si.converged_reason, eq_data_->ls->compute_residual());
492  output_data();
493 }
494 
495 
496 
498 {
499  // preallocate system matrix
500  eq_data_->ls->start_allocation();
503 }
504 
505 
506 
507 
509 {
510  START_TIMER("DG-ONE STEP");
511 
512  next_time();
514 
516 
517  output_data();
518 
519  END_TIMER("DG-ONE STEP");
520 }
521 
523 {
524  time_->next_time();
525  time_->view("MECH");
526 
527 }
528 
529 
530 
532 {
533  START_TIMER("data reinit");
534  eq_fields_->set_time(time_->step(), LimitSide::right);
535  END_TIMER("data reinit");
536 
537  // assemble stiffness matrix
538  if (eq_data_->ls->get_matrix() == NULL
539  || eq_fields_->subset(FieldFlag::in_main_matrix).changed())
540  {
541  DebugOut() << "Mechanics: Assembling matrix.\n";
542  eq_data_->ls->start_add_assembly();
543  eq_data_->ls->mat_zero_entries();
545  eq_data_->ls->finish_assembly();
546  }
547 
548  // assemble right hand side (due to sources and boundary conditions)
549  if (eq_data_->ls->get_rhs() == NULL
550  || eq_fields_->subset(FieldFlag::in_rhs).changed())
551  {
552  DebugOut() << "Mechanics: Assembling right hand side.\n";
553  eq_data_->ls->start_add_assembly();
554  eq_data_->ls->rhs_zero_entries();
556  eq_data_->ls->finish_assembly();
557  }
558 
559  START_TIMER("solve");
560  LinSys::SolveInfo si = eq_data_->ls->solve();
561  MessageOut().fmt("[mech solver] lin. it: {}, reason: {}, residual: {}\n",
562  si.n_iterations, si.converged_reason, eq_data_->ls->compute_residual());
563  END_TIMER("solve");
564 }
565 
566 
567 
568 
569 
570 
572 {
573  START_TIMER("MECH-OUTPUT");
574 
575  // gather the solution from all processors
576  eq_fields_->output_fields.set_time( this->time().step(), LimitSide::left);
577  //if (eq_fields_->output_fields.is_field_output_time(eq_fields_->output_field, this->time().step()) )
579  eq_fields_->output_fields.output(this->time().step());
580 
581 // START_TIMER("MECH-balance");
582 // balance_->calculate_instant(subst_idx, eq_data_->ls->get_solution());
583 // balance_->output();
584 // END_TIMER("MECH-balance");
585 
586  END_TIMER("MECH-OUTPUT");
587 }
588 
589 
590 
591 
593 {
594 // if (balance_->cumulative())
595 // {
596 // balance_->calculate_cumulative(subst_idx, eq_data_->ls->get_solution());
597 // }
598 }
599 
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:219
LinSys::SolveInfo::n_iterations
int n_iterations
Definition: linsys.hh:109
fe_rt.hh
Definitions of Raviart-Thomas finite elements.
Elasticity::update_output_fields
void update_output_fields()
Definition: elasticity.cc:434
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:522
neighbours.h
Elasticity::solve_linear_system
void solve_linear_system()
Solve without updating time step and without output.
Definition: elasticity.cc:531
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:104
ASSERT
#define ASSERT(expr)
Definition: asserts.hh:351
fn_dirichlet_penalty
Definition: elasticity.cc:106
fn_lame_lambda
Definition: elasticity.cc:99
EquationBase::time_
TimeGovernor * time_
Definition: equation.hh:220
Input::Record::val
const Ret val(const string &key) const
Definition: accessors_impl.hh:31
EquationBase::time
TimeGovernor & time()
Definition: equation.hh:148
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:108
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:592
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:186
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:340
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:298
ASSERT_EQ
#define ASSERT_EQ(a, b)
Definition of comparative assert macro (EQual) only for debug mode.
Definition: asserts.hh:333
Input::Record::opt_val
bool opt_val(const string &key, Ret &value) const
Definition: accessors_impl.hh:107
Elasticity::preallocate
void preallocate()
Definition: elasticity.cc:497
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:56
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:80
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:289
fn_lame_mu
Definition: elasticity.cc:92
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:228
Elasticity::~Elasticity
~Elasticity()
Destructor.
Definition: elasticity.cc:420
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:508
lame_lambda
double lame_lambda(double young, double poisson)
Definition: elasticity.cc:86
Elasticity::EqFields::EqFields
EqFields()
Definition: elasticity.cc:131
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
Input::Type::Default::optional
static Default optional()
The factory function to make an empty default value which is optional.
Definition: type_record.hh:124
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:273
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:464
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:571
Elasticity::EqFields::get_bc_type_selection
static const Input::Type::Selection & get_bc_type_selection()
Definition: elasticity.cc:117
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