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