Flow123d  JS_before_hm-2210-gb57a0a528
assembly_elasticity.hh
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 assembly_elasticity.hh
15  * @brief
16  */
17 
18 #ifndef ASSEMBLY_ELASTICITY_HH_
19 #define ASSEMBLY_ELASTICITY_HH_
20 
23 #include "mechanics/elasticity.hh"
24 #include "fem/fe_p.hh"
25 #include "fem/fe_values.hh"
27 #include "coupling/balance.hh"
29 
30 
31 /**
32  * Auxiliary container class for Finite element and related objects of given dimension.
33  */
34 template <unsigned int dim>
36 {
37 public:
38  typedef typename Elasticity::EqFields EqFields;
39  typedef typename Elasticity::EqData EqData;
40 
41  static constexpr const char * name() { return "StiffnessAssemblyElasticity"; }
42 
43  /// Constructor.
45  : AssemblyBase<dim>(1), eq_fields_(eq_fields), eq_data_(eq_data) {
53  }
54 
55  /// Destructor.
57 
58  /// Initialize auxiliary vectors and other data members
59  void initialize(ElementCacheMap *element_cache_map) {
60  //this->balance_ = eq_data_->balance_;
61  this->element_cache_map_ = element_cache_map;
62 
63  shared_ptr<FE_P<dim>> fe_p = std::make_shared< FE_P<dim> >(1);
64  shared_ptr<FE_P<dim-1>> fe_p_low = std::make_shared< FE_P<dim-1> >(1);
65  fe_ = std::make_shared<FESystem<dim>>(fe_p, FEVector, 3);
66  fe_low_ = std::make_shared<FESystem<dim-1>>(fe_p_low, FEVector, 3);
67  fe_values_.initialize(*this->quad_, *fe_,
71  fe_values_sub_.initialize(*this->quad_low_, *fe_low_,
73 
74  n_dofs_ = fe_->n_dofs();
75  n_dofs_sub_ = fe_low_->n_dofs();
77  dof_indices_.resize(n_dofs_);
78  side_dof_indices_.resize(2);
79  side_dof_indices_[0].resize(n_dofs_sub_); // index 0 = element with lower dimension,
80  side_dof_indices_[1].resize(n_dofs_); // index 1 = side of element with higher dimension
82  local_matrix_ngh_.resize(2);
83  for (uint m=0; m<2; ++m) {
84  local_matrix_ngh_[m].resize(2);
85  for (uint n=0; n<2; ++n)
86  local_matrix_ngh_[m][n].resize(n_dofs_*n_dofs_);
87  }
90  if (dim>1) vec_view_sub_ = &fe_values_sub_.vector_view(0);
91  }
92 
93 
94  /// Assemble integral over element
95  inline void cell_integral(DHCellAccessor cell, unsigned int element_patch_idx)
96  {
97  if (cell.dim() != dim) return;
98 
99  ElementAccessor<3> elm_acc = cell.elm();
100 
101  fe_values_.reinit(elm_acc);
103 
104  // assemble the local stiffness matrix
105  for (unsigned int i=0; i<n_dofs_; i++)
106  for (unsigned int j=0; j<n_dofs_; j++)
107  local_matrix_[i*n_dofs_+j] = 0;
108 
109  unsigned int k=0;
110  for (auto p : this->bulk_points(element_patch_idx) )
111  {
112  for (unsigned int i=0; i<n_dofs_; i++)
113  {
114  for (unsigned int j=0; j<n_dofs_; j++)
116  2*eq_fields_->lame_mu(p)*arma::dot(vec_view_->sym_grad(j,k), vec_view_->sym_grad(i,k))
118  )*fe_values_.JxW(k);
119  }
120  k++;
121  }
123  }
124 
125  /// Assembles boundary integral.
126  inline void boundary_side_integral(DHCellSide cell_side)
127  {
128  ASSERT_EQ(cell_side.dim(), dim).error("Dimension of element mismatch!");
129  if (!cell_side.cell().is_own()) return;
130 
131  Side side = cell_side.side();
132  const DHCellAccessor &dh_cell = cell_side.cell();
133  dh_cell.get_dof_indices(dof_indices_);
134  fe_values_side_.reinit(side);
135 
136  for (unsigned int i=0; i<n_dofs_; i++)
137  for (unsigned int j=0; j<n_dofs_; j++)
138  local_matrix_[i*n_dofs_+j] = 0;
139 
140  auto p_side = *( this->boundary_points(cell_side).begin() );
141  auto p_bdr = p_side.point_bdr( side.cond().element_accessor() );
142  unsigned int bc_type = eq_fields_->bc_type(p_bdr);
143  double side_measure = cell_side.measure();
144  if (bc_type == EqFields::bc_type_displacement)
145  {
146  unsigned int k=0;
147  for (auto p : this->boundary_points(cell_side) ) {
148  for (unsigned int i=0; i<n_dofs_; i++)
149  for (unsigned int j=0; j<n_dofs_; j++)
150  local_matrix_[i*n_dofs_+j] += (eq_fields_->dirichlet_penalty(p) / side_measure) *
151  arma::dot(vec_view_side_->value(i,k),vec_view_side_->value(j,k)) * fe_values_side_.JxW(k);
152  k++;
153  }
154  }
155  else if (bc_type == EqFields::bc_type_displacement_normal)
156  {
157  unsigned int k=0;
158  for (auto p : this->boundary_points(cell_side) ) {
159  for (unsigned int i=0; i<n_dofs_; i++)
160  for (unsigned int j=0; j<n_dofs_; j++)
161  local_matrix_[i*n_dofs_+j] += (eq_fields_->dirichlet_penalty(p) / side_measure) *
162  arma::dot(vec_view_side_->value(i,k), fe_values_side_.normal_vector(k)) *
164  k++;
165  }
166  }
167 
169  }
170 
171 
172  /// Assembles between elements of different dimensions.
173  inline void dimjoin_intergral(DHCellAccessor cell_lower_dim, DHCellSide neighb_side) {
174  if (dim == 1) return;
175  ASSERT_EQ(cell_lower_dim.dim(), dim-1).error("Dimension of element mismatch!");
176 
177  cell_lower_dim.get_dof_indices(side_dof_indices_[0]);
178  ElementAccessor<3> cell_sub = cell_lower_dim.elm();
179  fe_values_sub_.reinit(cell_sub);
180 
181  DHCellAccessor cell_higher_dim = eq_data_->dh_->cell_accessor_from_element( neighb_side.element().idx() );
182  cell_higher_dim.get_dof_indices(side_dof_indices_[1]);
183  fe_values_side_.reinit(neighb_side.side());
184 
185  // Element id's for testing if they belong to local partition.
186  bool own_element_id[2];
187  own_element_id[0] = cell_lower_dim.is_own();
188  own_element_id[1] = cell_higher_dim.is_own();
189 
190  for (unsigned int n=0; n<2; ++n)
191  for (unsigned int i=0; i<n_dofs_; i++)
192  for (unsigned int m=0; m<2; ++m)
193  for (unsigned int j=0; j<n_dofs_; j++)
194  local_matrix_ngh_[n][m][i*(n_dofs_)+j] = 0;
195 
196  // set transmission conditions
197  unsigned int k=0;
198  for (auto p_high : this->coupling_points(neighb_side) )
199  {
200  auto p_low = p_high.lower_dim(cell_lower_dim);
202 
203  for (int n=0; n<2; n++)
204  {
205  if (!own_element_id[n]) continue;
206 
207  for (unsigned int i=0; i<n_dofs_ngh_[n]; i++)
208  {
209  arma::vec3 vi = (n==0) ? arma::zeros(3) : vec_view_side_->value(i,k);
210  arma::vec3 vf = (n==1) ? arma::zeros(3) : vec_view_sub_->value(i,k);
211  arma::mat33 gvft = (n==0) ? vec_view_sub_->grad(i,k) : arma::zeros(3,3);
212 
213  for (int m=0; m<2; m++)
214  for (unsigned int j=0; j<n_dofs_ngh_[m]; j++) {
215  arma::vec3 ui = (m==0) ? arma::zeros(3) : vec_view_side_->value(j,k);
216  arma::vec3 uf = (m==1) ? arma::zeros(3) : vec_view_sub_->value(j,k);
217  arma::mat33 guit = (m==1) ? mat_t(vec_view_side_->grad(j,k),nv) : arma::zeros(3,3);
218  double divuit = (m==1) ? arma::trace(guit) : 0;
219 
220  local_matrix_ngh_[n][m][i*n_dofs_ngh_[m] + j] +=
221  eq_fields_->fracture_sigma(p_low)*(
222  arma::dot(vf-vi,
223  2/eq_fields_->cross_section(p_low)*(eq_fields_->lame_mu(p_low)*(uf-ui)+(eq_fields_->lame_mu(p_low)+eq_fields_->lame_lambda(p_low))*(arma::dot(uf-ui,nv)*nv))
224  + eq_fields_->lame_mu(p_low)*arma::trans(guit)*nv
225  + eq_fields_->lame_lambda(p_low)*divuit*nv
226  )
227  - arma::dot(gvft, eq_fields_->lame_mu(p_low)*arma::kron(nv,ui.t()) + eq_fields_->lame_lambda(p_low)*arma::dot(ui,nv)*arma::eye(3,3))
228  )*fe_values_sub_.JxW(k);
229  }
230 
231  }
232  }
233  k++;
234  }
235 
236  for (unsigned int n=0; n<2; ++n)
237  for (unsigned int m=0; m<2; ++m)
239  }
240 
241 
242 
243 private:
244  inline arma::mat33 mat_t(const arma::mat33 &m, const arma::vec3 &n)
245  {
246  arma::mat33 mt = m - m*arma::kron(n,n.t());
247  return mt;
248  }
249 
250 
251 
252  shared_ptr<FiniteElement<dim>> fe_; ///< Finite element for the solution of the advection-diffusion equation.
253  shared_ptr<FiniteElement<dim-1>> fe_low_; ///< Finite element for the solution of the advection-diffusion equation (dim-1).
254 
255  /// Data objects shared with Elasticity
258 
259  /// Sub field set contains fields used in calculation.
261 
262  unsigned int n_dofs_; ///< Number of dofs
263  unsigned int n_dofs_sub_; ///< Number of dofs (on lower dim element)
264  std::vector<unsigned int> n_dofs_ngh_; ///< Number of dofs on lower and higher dimension element (vector of 2 items)
265  FEValues<3> fe_values_; ///< FEValues of cell object (FESystem of P disc finite element type)
266  FEValues<3> fe_values_side_; ///< FEValues of side object
267  FEValues<3> fe_values_sub_; ///< FEValues of lower dimension cell object
268 
269  vector<LongIdx> dof_indices_; ///< Vector of global DOF indices
270  vector<vector<LongIdx> > side_dof_indices_; ///< 2 items vector of DOF indices in neighbour calculation.
271  vector<PetscScalar> local_matrix_; ///< Auxiliary vector for assemble methods
272  vector<vector<vector<PetscScalar>>> local_matrix_ngh_; ///< Auxiliary vectors for assemble ngh integral
273  const FEValuesViews::Vector<3> * vec_view_; ///< Vector view in cell integral calculation.
274  const FEValuesViews::Vector<3> * vec_view_side_; ///< Vector view in boundary / neighbour calculation.
275  const FEValuesViews::Vector<3> * vec_view_sub_; ///< Vector view of low dim element in neighbour calculation.
276 
277  template < template<IntDim...> class DimAssembly>
278  friend class GenericAssembly;
279 
280 };
281 
282 
283 template <unsigned int dim>
285 {
286 public:
287  typedef typename Elasticity::EqFields EqFields;
288  typedef typename Elasticity::EqData EqData;
289 
290  static constexpr const char * name() { return "RhsAssemblyElasticity"; }
291 
292  /// Constructor.
293  RhsAssemblyElasticity(EqFields *eq_fields, EqData *eq_data)
294  : AssemblyBase<dim>(1), eq_fields_(eq_fields), eq_data_(eq_data) {
297  this->used_fields_ += eq_fields_->load;
302  this->used_fields_ += eq_fields_->bc_type;
306  }
307 
308  /// Destructor.
310 
311  /// Initialize auxiliary vectors and other data members
312  void initialize(ElementCacheMap *element_cache_map) {
313  //this->balance_ = eq_data_->balance_;
314  this->element_cache_map_ = element_cache_map;
315 
316  shared_ptr<FE_P<dim>> fe_p = std::make_shared< FE_P<dim> >(1);
317  shared_ptr<FE_P<dim-1>> fe_p_low = std::make_shared< FE_P<dim-1> >(1);
318  fe_ = std::make_shared<FESystem<dim>>(fe_p, FEVector, 3);
319  fe_low_ = std::make_shared<FESystem<dim-1>>(fe_p_low, FEVector, 3);
320  fe_values_.initialize(*this->quad_, *fe_,
324  fe_values_side_.initialize(*this->quad_low_, *fe_,
326  fe_values_sub_.initialize(*this->quad_low_, *fe_low_,
328  n_dofs_ = fe_->n_dofs();
329  n_dofs_sub_ = fe_low_->n_dofs();
331  dof_indices_.resize(n_dofs_);
332  side_dof_indices_.resize(2);
333  side_dof_indices_[0].resize(n_dofs_sub_); // index 0 = element with lower dimension,
334  side_dof_indices_[1].resize(n_dofs_); // index 1 = side of element with higher dimension
335  local_rhs_.resize(n_dofs_);
336  local_rhs_ngh_.resize(2);
337  for (uint n=0; n<2; ++n) local_rhs_ngh_[n].resize(n_dofs_);
341  if (dim>1) vec_view_sub_ = &fe_values_sub_.vector_view(0);
342  }
343 
344 
345  /// Assemble integral over element
346  inline void cell_integral(DHCellAccessor cell, unsigned int element_patch_idx)
347  {
348  if (cell.dim() != dim) return;
349  if (!cell.is_own()) return;
350 
351  ElementAccessor<3> elm_acc = cell.elm();
352 
353  fe_values_.reinit(elm_acc);
355 
356  // assemble the local stiffness matrix
357  fill_n(&(local_rhs_[0]), n_dofs_, 0);
358  //local_source_balance_vector.assign(n_dofs_, 0);
359  //local_source_balance_rhs.assign(n_dofs_, 0);
360 
361  // compute sources
362  unsigned int k=0;
363  for (auto p : this->bulk_points(element_patch_idx) )
364  {
365  for (unsigned int i=0; i<n_dofs_; i++)
366  local_rhs_[i] += (
367  arma::dot(eq_fields_->load(p), vec_view_->value(i,k))
370  ++k;
371  }
373 
374 // for (unsigned int i=0; i<n_dofs_; i++)
375 // {
376 // for (unsigned int k=0; k<qsize_; k++) // point range
377 // local_source_balance_vector[i] -= 0;//sources_sigma[k]*fe_values_[vec_view_].value(i,k)*fe_values_.JxW(k);
378 //
379 // local_source_balance_rhs[i] += local_rhs_[i];
380 // }
381 // balance_->add_source_matrix_values(subst_idx, elm_acc.region().bulk_idx(), dof_indices_, local_source_balance_vector);
382 // balance_->add_source_vec_values(subst_idx, elm_acc.region().bulk_idx(), dof_indices_, local_source_balance_rhs);
383  }
384 
385  /// Assembles boundary integral.
386  inline void boundary_side_integral(DHCellSide cell_side)
387  {
388  ASSERT_EQ(cell_side.dim(), dim).error("Dimension of element mismatch!");
389  if (!cell_side.cell().is_own()) return;
390 
391  Side side = cell_side.side();
392  const DHCellAccessor &dh_cell = cell_side.cell();
393  dh_cell.get_dof_indices(dof_indices_);
395 
396  auto p_side = *( this->boundary_points(cell_side).begin() );
397  auto p_bdr = p_side.point_bdr( side.cond().element_accessor() );
398  unsigned int bc_type = eq_fields_->bc_type(p_bdr);
399 
400  fill_n(&(local_rhs_[0]), n_dofs_, 0);
401  // local_flux_balance_vector.assign(n_dofs_, 0);
402  // local_flux_balance_rhs = 0;
403 
404  unsigned int k=0;
405  if (bc_type == EqFields::bc_type_displacement)
406  {
407  double side_measure = cell_side.measure();
408  for (auto p : this->boundary_points(cell_side) )
409  {
410  auto p_bdr = p.point_bdr( side.cond().element_accessor() );
411  for (unsigned int i=0; i<n_dofs_; i++)
412  local_rhs_[i] += (eq_fields_->dirichlet_penalty(p) / side_measure) *
413  arma::dot(eq_fields_->bc_displacement(p_bdr), vec_view_bdr_->value(i,k)) *
415  ++k;
416  }
417  }
418  else if (bc_type == EqFields::bc_type_displacement_normal)
419  {
420  double side_measure = cell_side.measure();
421  for (auto p : this->boundary_points(cell_side) )
422  {
423  auto p_bdr = p.point_bdr( side.cond().element_accessor() );
424  for (unsigned int i=0; i<n_dofs_; i++)
425  local_rhs_[i] += (eq_fields_->dirichlet_penalty(p) / side_measure) *
429  ++k;
430  }
431  }
432  else if (bc_type == EqFields::bc_type_traction)
433  {
434  for (auto p : this->boundary_points(cell_side) )
435  {
436  auto p_bdr = p.point_bdr( side.cond().element_accessor() );
437  for (unsigned int i=0; i<n_dofs_; i++)
441  ++k;
442  }
443  }
444  else if (bc_type == EqFields::bc_type_stress)
445  {
446  for (auto p : this->boundary_points(cell_side) )
447  {
448  auto p_bdr = p.point_bdr( side.cond().element_accessor() );
449  for (unsigned int i=0; i<n_dofs_; i++)
450  // stress is multiplied by inward normal to obtain traction
455  ++k;
456  }
457  }
459 
460 
461 // balance_->add_flux_matrix_values(subst_idx, loc_b, side_dof_indices, local_flux_balance_vector);
462 // balance_->add_flux_vec_value(subst_idx, loc_b, local_flux_balance_rhs);
463  // ++loc_b;
464  }
465 
466 
467  /// Assembles between elements of different dimensions.
468  inline void dimjoin_intergral(DHCellAccessor cell_lower_dim, DHCellSide neighb_side) {
469  if (dim == 1) return;
470  ASSERT_EQ(cell_lower_dim.dim(), dim-1).error("Dimension of element mismatch!");
471 
472  cell_lower_dim.get_dof_indices(side_dof_indices_[0]);
473  ElementAccessor<3> cell_sub = cell_lower_dim.elm();
474  fe_values_sub_.reinit(cell_sub);
475 
476  DHCellAccessor cell_higher_dim = eq_data_->dh_->cell_accessor_from_element( neighb_side.element().idx() );
477  cell_higher_dim.get_dof_indices(side_dof_indices_[1]);
478  fe_values_side_.reinit(neighb_side.side());
479 
480  // Element id's for testing if they belong to local partition.
481  bool own_element_id[2];
482  own_element_id[0] = cell_lower_dim.is_own();
483  own_element_id[1] = cell_higher_dim.is_own();
484 
485  for (unsigned int n=0; n<2; ++n)
486  for (unsigned int i=0; i<n_dofs_; i++)
487  local_rhs_ngh_[n][i] = 0;
488 
489  // set transmission conditions
490  unsigned int k=0;
491  for (auto p_high : this->coupling_points(neighb_side) )
492  {
493  auto p_low = p_high.lower_dim(cell_lower_dim);
495 
496  for (int n=0; n<2; n++)
497  {
498  if (!own_element_id[n]) continue;
499 
500  for (unsigned int i=0; i<n_dofs_ngh_[n]; i++)
501  {
502  arma::vec3 vi = (n==0) ? arma::zeros(3) : vec_view_side_->value(i,k);
503  arma::vec3 vf = (n==1) ? arma::zeros(3) : vec_view_sub_->value(i,k);
504 
505  local_rhs_ngh_[n][i] -= eq_fields_->fracture_sigma(p_low) * eq_fields_->cross_section(p_high) *
506  arma::dot(vf-vi, eq_fields_->potential_load(p_high) * nv) * fe_values_sub_.JxW(k);
507  }
508  }
509  ++k;
510  }
511 
512  for (unsigned int n=0; n<2; ++n)
514  }
515 
516 
517 
518 private:
519  shared_ptr<FiniteElement<dim>> fe_; ///< Finite element for the solution of the advection-diffusion equation.
520  shared_ptr<FiniteElement<dim-1>> fe_low_; ///< Finite element for the solution of the advection-diffusion equation (dim-1).
521 
522  /// Data objects shared with Elasticity
525 
526  /// Sub field set contains fields used in calculation.
528 
529  unsigned int n_dofs_; ///< Number of dofs
530  unsigned int n_dofs_sub_; ///< Number of dofs (on lower dim element)
531  std::vector<unsigned int> n_dofs_ngh_; ///< Number of dofs on lower and higher dimension element (vector of 2 items)
532  FEValues<3> fe_values_; ///< FEValues of cell object (FESystem of P disc finite element type)
533  FEValues<3> fe_values_bdr_side_; ///< FEValues of side (boundary integral) object
534  FEValues<3> fe_values_side_; ///< FEValues of side (neighbour integral) object
535  FEValues<3> fe_values_sub_; ///< FEValues of lower dimension cell object
536 
537  vector<LongIdx> dof_indices_; ///< Vector of global DOF indices
538  vector<vector<LongIdx> > side_dof_indices_; ///< 2 items vector of DOF indices in neighbour calculation.
539  vector<PetscScalar> local_rhs_; ///< Auxiliary vector for assemble methods
540  vector<vector<PetscScalar>> local_rhs_ngh_; ///< Auxiliary vectors for assemble ngh integral
541  const FEValuesViews::Vector<3> * vec_view_; ///< Vector view in cell integral calculation.
542  const FEValuesViews::Vector<3> * vec_view_bdr_; ///< Vector view in boundary calculation.
543  const FEValuesViews::Vector<3> * vec_view_side_; ///< Vector view in neighbour calculation.
544  const FEValuesViews::Vector<3> * vec_view_sub_; ///< Vector view of low dim element in neighbour calculation.
545 
546 
547  template < template<IntDim...> class DimAssembly>
548  friend class GenericAssembly;
549 
550 };
551 
552 template <unsigned int dim>
554 {
555 public:
556  typedef typename Elasticity::EqFields EqFields;
557  typedef typename Elasticity::EqData EqData;
558 
559  static constexpr const char * name() { return "OutpuFieldsAssemblyElasticity"; }
560 
561  /// Constructor.
563  : AssemblyBase<dim>(0), eq_fields_(eq_fields), eq_data_(eq_data) {
566  this->used_fields_ += eq_fields_->lame_mu;
568  }
569 
570  /// Destructor.
572 
573  /// Initialize auxiliary vectors and other data members
574  void initialize(ElementCacheMap *element_cache_map) {
575  //this->balance_ = eq_data_->balance_;
576  this->element_cache_map_ = element_cache_map;
577 
578  shared_ptr<FE_P<dim>> fe_p = std::make_shared< FE_P<dim> >(1);
579  fe_ = std::make_shared<FESystem<dim>>(fe_p, FEVector, 3);
580  fv_.initialize(*this->quad_, *fe_,
582  fsv_.initialize(*this->quad_low_, *fe_,
584  n_dofs_ = fe_->n_dofs();
585  vec_view_ = &fv_.vector_view(0);
586  // if (dim>1) ??
588 
594  }
595 
596 
597  /// Assemble integral over element
598  inline void cell_integral(DHCellAccessor cell, unsigned int element_patch_idx)
599  {
600  if (cell.dim() != dim) return;
601  if (!cell.is_own()) return;
602  DHCellAccessor cell_tensor = cell.cell_with_other_dh(eq_data_->dh_tensor_.get());
603  DHCellAccessor cell_scalar = cell.cell_with_other_dh(eq_data_->dh_scalar_.get());
604 
605  auto elm = cell.elm();
606 
607  fv_.reinit(elm);
611 
612  auto p = *( this->bulk_points(element_patch_idx).begin() );
613 
614  arma::mat33 stress = arma::zeros(3,3);
615  double div = 0;
616  for (unsigned int i=0; i<n_dofs_; i++)
617  {
618  stress += (2*eq_fields_->lame_mu(p)*vec_view_->sym_grad(i,0) + eq_fields_->lame_lambda(p)*vec_view_->divergence(i,0)*arma::eye(3,3))
621  }
622 
623  arma::mat33 stress_dev = stress - arma::trace(stress)/3*arma::eye(3,3);
624  double von_mises_stress = sqrt(1.5*arma::dot(stress_dev, stress_dev));
626 
627  for (unsigned int i=0; i<3; i++)
628  for (unsigned int j=0; j<3; j++)
629  output_stress_vec_.add( dof_indices_tensor_[i*3+j], stress(i,j) );
630  output_von_mises_stress_vec_.set( dof_indices_scalar_[0], von_mises_stress );
631 
633  }
634 
635 
636  /// Assembles between elements of different dimensions.
637  inline void dimjoin_intergral(DHCellAccessor cell_lower_dim, DHCellSide neighb_side) {
638  if (dim == 1) return;
639  ASSERT_EQ(cell_lower_dim.dim(), dim-1).error("Dimension of element mismatch!");
640 
642  normal_stress_.zeros();
643 
644  DHCellAccessor cell_higher_dim = neighb_side.cell();
645  DHCellAccessor cell_tensor = cell_lower_dim.cell_with_other_dh(eq_data_->dh_tensor_.get());
646  DHCellAccessor cell_scalar = cell_lower_dim.cell_with_other_dh(eq_data_->dh_scalar_.get());
647  fsv_.reinit(neighb_side.side());
648 
649  dof_indices_ = cell_higher_dim.get_loc_dof_indices();
650  auto p_high = *( this->coupling_points(neighb_side).begin() );
651  auto p_low = p_high.lower_dim(cell_lower_dim);
652 
653  for (unsigned int i=0; i<n_dofs_; i++)
654  {
656  arma::mat33 grad = -arma::kron(vec_view_side_->value(i,0)*output_vec_.get(dof_indices_[i]), fsv_.normal_vector(0).t()) / eq_fields_->cross_section(p_low);
657  normal_stress_ += eq_fields_->lame_mu(p_low)*(grad+grad.t()) + eq_fields_->lame_lambda(p_low)*arma::trace(grad)*arma::eye(3,3);
658  }
659 
662  for (unsigned int i=0; i<3; i++)
663  for (unsigned int j=0; j<3; j++)
667  }
668 
669 
670 
671 private:
672  shared_ptr<FiniteElement<dim>> fe_; ///< Finite element for the solution of the advection-diffusion equation.
673 
674  /// Data objects shared with Elasticity
677 
678  /// Sub field set contains fields used in calculation.
680 
681  unsigned int n_dofs_; ///< Number of dofs
682  FEValues<3> fv_; ///< FEValues of cell object (FESystem of P disc finite element type)
683  FEValues<3> fsv_; ///< FEValues of side (neighbour integral) object
684 
685  LocDofVec dof_indices_; ///< Vector of local DOF indices of vector fields
686  LocDofVec dof_indices_scalar_; ///< Vector of local DOF indices of scalar fields
687  LocDofVec dof_indices_tensor_; ///< Vector of local DOF indices of tensor fields
688  const FEValuesViews::Vector<3> * vec_view_; ///< Vector view in cell integral calculation.
689  const FEValuesViews::Vector<3> * vec_view_side_; ///< Vector view in neighbour calculation.
690 
691  double normal_displacement_; ///< Holds constributions of normal displacement.
692  arma::mat33 normal_stress_; ///< Holds constributions of normal stress.
693 
694  /// Data vectors of output fields (FieldFE).
700 
701  template < template<IntDim...> class DimAssembly>
702  friend class GenericAssembly;
703 
704 };
705 
706 
707 #endif /* ASSEMBLY_ELASTICITY_HH_ */
708 
RhsAssemblyElasticity::fe_
shared_ptr< FiniteElement< dim > > fe_
Finite element for the solution of the advection-diffusion equation.
Definition: assembly_elasticity.hh:519
OutpuFieldsAssemblyElasticity::EqData
Elasticity::EqData EqData
Definition: assembly_elasticity.hh:557
LocDofVec
arma::Col< IntIdx > LocDofVec
Definition: index_types.hh:28
Elasticity::EqFields
Definition: elasticity.hh:51
Elasticity::EqFields::output_stress_ptr
std::shared_ptr< FieldFE< 3, FieldValue< 3 >::TensorFixed > > output_stress_ptr
Definition: elasticity.hh:97
StiffnessAssemblyElasticity::vec_view_sub_
const FEValuesViews::Vector< 3 > * vec_view_sub_
Vector view of low dim element in neighbour calculation.
Definition: assembly_elasticity.hh:275
update_gradients
@ update_gradients
Shape function gradients.
Definition: update_flags.hh:95
OutpuFieldsAssemblyElasticity::fe_
shared_ptr< FiniteElement< dim > > fe_
Finite element for the solution of the advection-diffusion equation.
Definition: assembly_elasticity.hh:672
Elasticity::EqFields::bc_stress
BCField< 3, FieldValue< 3 >::TensorFixed > bc_stress
Definition: elasticity.hh:68
RhsAssemblyElasticity::fe_low_
shared_ptr< FiniteElement< dim-1 > > fe_low_
Finite element for the solution of the advection-diffusion equation (dim-1).
Definition: assembly_elasticity.hh:520
FEValues::vector_view
const FEValuesViews::Vector< spacedim > & vector_view(unsigned int i) const
Accessor to vector values of multicomponent FE.
Definition: fe_values.hh:277
StiffnessAssemblyElasticity
Definition: assembly_elasticity.hh:35
DHCellSide::side
Side side() const
Return Side of given cell and side_idx.
Definition: dh_cell_accessor.hh:198
RhsAssemblyElasticity::EqFields
Elasticity::EqFields EqFields
Definition: assembly_elasticity.hh:287
FEValuesViews::Vector::divergence
double divergence(unsigned int function_no, unsigned int point_no) const
Return divergence of vector-valued shape function.
Definition: fe_values_views.cc:82
RhsAssemblyElasticity::name
static constexpr const char * name()
Definition: assembly_elasticity.hh:290
RhsAssemblyElasticity::vec_view_
const FEValuesViews::Vector< 3 > * vec_view_
Vector view in cell integral calculation.
Definition: assembly_elasticity.hh:541
StiffnessAssemblyElasticity::dimjoin_intergral
void dimjoin_intergral(DHCellAccessor cell_lower_dim, DHCellSide neighb_side)
Assembles between elements of different dimensions.
Definition: assembly_elasticity.hh:173
RhsAssemblyElasticity::fe_values_bdr_side_
FEValues< 3 > fe_values_bdr_side_
FEValues of side (boundary integral) object.
Definition: assembly_elasticity.hh:533
StiffnessAssemblyElasticity::eq_data_
EqData * eq_data_
Definition: assembly_elasticity.hh:257
RhsAssemblyElasticity::used_fields_
FieldSet used_fields_
Sub field set contains fields used in calculation.
Definition: assembly_elasticity.hh:527
StiffnessAssemblyElasticity::fe_values_sub_
FEValues< 3 > fe_values_sub_
FEValues of lower dimension cell object.
Definition: assembly_elasticity.hh:267
FEValuesViews::Vector< 3 >
StiffnessAssemblyElasticity::vec_view_side_
const FEValuesViews::Vector< 3 > * vec_view_side_
Vector view in boundary / neighbour calculation.
Definition: assembly_elasticity.hh:274
RhsAssemblyElasticity::local_rhs_ngh_
vector< vector< PetscScalar > > local_rhs_ngh_
Auxiliary vectors for assemble ngh integral.
Definition: assembly_elasticity.hh:540
AssemblyBase::quad_low_
Quadrature * quad_low_
Quadrature used in assembling methods (dim-1).
Definition: assembly_base.hh:190
FEValues::normal_vector
arma::vec::fixed< spacedim > normal_vector(unsigned int point_no)
Returns the normal vector to a side at given quadrature point.
Definition: fe_values.hh:257
StiffnessAssemblyElasticity::n_dofs_sub_
unsigned int n_dofs_sub_
Number of dofs (on lower dim element)
Definition: assembly_elasticity.hh:263
RhsAssemblyElasticity::cell_integral
void cell_integral(DHCellAccessor cell, unsigned int element_patch_idx)
Assemble integral over element.
Definition: assembly_elasticity.hh:346
Elasticity::EqData::ls
LinSys * ls
Linear algebraic system.
Definition: elasticity.hh:128
FEValues::JxW
double JxW(const unsigned int point_no)
Return the product of Jacobian determinant and the quadrature weight at given quadrature point.
Definition: fe_values.hh:223
ElementCacheMap
Directing class of FieldValueCache.
Definition: field_value_cache.hh:151
DHCellAccessor::get_dof_indices
unsigned int get_dof_indices(std::vector< LongIdx > &indices) const
Fill vector of the global indices of dofs associated to the cell.
Definition: dh_cell_accessor.hh:80
RhsAssemblyElasticity::fe_values_sub_
FEValues< 3 > fe_values_sub_
FEValues of lower dimension cell object.
Definition: assembly_elasticity.hh:535
Elasticity::EqFields::bc_type
BCField< 3, FieldValue< 3 >::Enum > bc_type
Definition: elasticity.hh:65
OutpuFieldsAssemblyElasticity::eq_fields_
EqFields * eq_fields_
Data objects shared with Elasticity.
Definition: assembly_elasticity.hh:675
fe_values.hh
Class FEValues calculates finite element data on the actual cells such as shape function values,...
DHCellAccessor::is_own
bool is_own() const
Return true if accessor represents own element (false for ghost element)
Definition: dh_cell_accessor.hh:130
StiffnessAssemblyElasticity::fe_
shared_ptr< FiniteElement< dim > > fe_
Finite element for the solution of the advection-diffusion equation.
Definition: assembly_elasticity.hh:252
RhsAssemblyElasticity::n_dofs_
unsigned int n_dofs_
Number of dofs.
Definition: assembly_elasticity.hh:529
StiffnessAssemblyElasticity::~StiffnessAssemblyElasticity
~StiffnessAssemblyElasticity()
Destructor.
Definition: assembly_elasticity.hh:56
RhsAssemblyElasticity::eq_data_
EqData * eq_data_
Definition: assembly_elasticity.hh:524
update_values
@ update_values
Shape function values.
Definition: update_flags.hh:87
RhsAssemblyElasticity::~RhsAssemblyElasticity
~RhsAssemblyElasticity()
Destructor.
Definition: assembly_elasticity.hh:309
FEValues::initialize
void initialize(Quadrature &_quadrature, FiniteElement< DIM > &_fe, UpdateFlags _flags)
Initialize structures and calculates cell-independent data.
Definition: fe_values.cc:137
OutpuFieldsAssemblyElasticity::normal_displacement_
double normal_displacement_
Holds constributions of normal displacement.
Definition: assembly_elasticity.hh:691
StiffnessAssemblyElasticity::side_dof_indices_
vector< vector< LongIdx > > side_dof_indices_
2 items vector of DOF indices in neighbour calculation.
Definition: assembly_elasticity.hh:270
std::vector< unsigned int >
StiffnessAssemblyElasticity::n_dofs_ngh_
std::vector< unsigned int > n_dofs_ngh_
Number of dofs on lower and higher dimension element (vector of 2 items)
Definition: assembly_elasticity.hh:264
ElementAccessor< 3 >
update_quadrature_points
@ update_quadrature_points
Transformed quadrature points.
Definition: update_flags.hh:102
arma::vec3
Definition: doxy_dummy_defs.hh:17
DHCellAccessor::dim
unsigned int dim() const
Return dimension of element appropriate to cell.
Definition: dh_cell_accessor.hh:101
update_normal_vectors
@ update_normal_vectors
Normal vectors.
Definition: update_flags.hh:124
Elasticity::EqFields::output_div_ptr
std::shared_ptr< FieldFE< 3, FieldValue< 3 >::Scalar > > output_div_ptr
Definition: elasticity.hh:100
uint
unsigned int uint
Definition: mh_dofhandler.hh:101
DHCellSide::dim
unsigned int dim() const
Return dimension of element appropriate to the side.
Definition: dh_cell_accessor.hh:214
Side::cond
Boundary cond() const
Definition: accessors_impl.hh:231
RhsAssemblyElasticity::fe_values_
FEValues< 3 > fe_values_
FEValues of cell object (FESystem of P disc finite element type)
Definition: assembly_elasticity.hh:532
OutpuFieldsAssemblyElasticity::dof_indices_
LocDofVec dof_indices_
Vector of local DOF indices of vector fields.
Definition: assembly_elasticity.hh:685
Elasticity::EqData::dh_
std::shared_ptr< DOFHandlerMultiDim > dh_
Objects for distribution of dofs.
Definition: elasticity.hh:120
StiffnessAssemblyElasticity::EqFields
Elasticity::EqFields EqFields
Definition: assembly_elasticity.hh:38
assembly_base.hh
StiffnessAssemblyElasticity::fe_low_
shared_ptr< FiniteElement< dim-1 > > fe_low_
Finite element for the solution of the advection-diffusion equation (dim-1).
Definition: assembly_elasticity.hh:253
RhsAssemblyElasticity::initialize
void initialize(ElementCacheMap *element_cache_map)
Initialize auxiliary vectors and other data members.
Definition: assembly_elasticity.hh:312
FEValues< 3 >
fe_p.hh
Definitions of basic Lagrangean finite elements with polynomial shape functions.
VectorMPI::set
void set(unsigned int pos, double val)
Set value on given position.
Definition: vector_mpi.hh:111
StiffnessAssemblyElasticity::cell_integral
void cell_integral(DHCellAccessor cell, unsigned int element_patch_idx)
Assemble integral over element.
Definition: assembly_elasticity.hh:95
DHCellSide
Side accessor allows to iterate over sides of DOF handler cell.
Definition: dh_cell_accessor.hh:176
FEValuesViews::Vector::sym_grad
arma::mat::fixed< spacedim, spacedim > sym_grad(unsigned int function_no, unsigned int point_no) const
Return symmetric gradient of vector-valued shape function.
Definition: fe_values_views.cc:73
Elasticity::EqFields::fracture_sigma
Field< 3, FieldValue< 3 >::Scalar > fracture_sigma
Transition parameter for diffusive transfer on fractures.
Definition: elasticity.hh:72
StiffnessAssemblyElasticity::EqData
Elasticity::EqData EqData
Definition: assembly_elasticity.hh:39
Elasticity::EqFields::output_von_mises_stress_ptr
std::shared_ptr< FieldFE< 3, FieldValue< 3 >::Scalar > > output_von_mises_stress_ptr
Definition: elasticity.hh:98
StiffnessAssemblyElasticity::fe_values_
FEValues< 3 > fe_values_
FEValues of cell object (FESystem of P disc finite element type)
Definition: assembly_elasticity.hh:265
Elasticity::EqFields::bc_displacement
BCField< 3, FieldValue< 3 >::VectorFixed > bc_displacement
Definition: elasticity.hh:66
DHCellAccessor::cell_with_other_dh
DHCellAccessor cell_with_other_dh(const DOFHandlerMultiDim *dh) const
Create new accessor with same local idx and given DOF handler. Actual and given DOF handler must be c...
Definition: dh_cell_accessor.hh:135
RhsAssemblyElasticity::vec_view_side_
const FEValuesViews::Vector< 3 > * vec_view_side_
Vector view in neighbour calculation.
Definition: assembly_elasticity.hh:543
DHCellSide::cell
const DHCellAccessor & cell() const
Return DHCellAccessor appropriate to the side.
Definition: dh_cell_accessor.hh:204
StiffnessAssemblyElasticity::local_matrix_
vector< PetscScalar > local_matrix_
Auxiliary vector for assemble methods.
Definition: assembly_elasticity.hh:271
OutpuFieldsAssemblyElasticity::output_vec_
VectorMPI output_vec_
Data vectors of output fields (FieldFE).
Definition: assembly_elasticity.hh:695
FE_P
Conforming Lagrangean finite element on dim dimensional simplex.
Definition: fe_p.hh:86
OutpuFieldsAssemblyElasticity::normal_stress_
arma::mat33 normal_stress_
Holds constributions of normal stress.
Definition: assembly_elasticity.hh:692
elasticity.hh
FEM for linear elasticity.
generic_assembly.hh
quadrature_lib.hh
Definitions of particular quadrature rules on simplices.
OutpuFieldsAssemblyElasticity::vec_view_
const FEValuesViews::Vector< 3 > * vec_view_
Vector view in cell integral calculation.
Definition: assembly_elasticity.hh:688
StiffnessAssemblyElasticity::dof_indices_
vector< LongIdx > dof_indices_
Vector of global DOF indices.
Definition: assembly_elasticity.hh:269
StiffnessAssemblyElasticity::eq_fields_
EqFields * eq_fields_
Data objects shared with Elasticity.
Definition: assembly_elasticity.hh:256
OutpuFieldsAssemblyElasticity::vec_view_side_
const FEValuesViews::Vector< 3 > * vec_view_side_
Vector view in neighbour calculation.
Definition: assembly_elasticity.hh:689
DHCellAccessor::elm
const ElementAccessor< 3 > elm() const
Return ElementAccessor to element of loc_ele_idx_.
Definition: dh_cell_accessor.hh:71
Side
Definition: accessors.hh:390
StiffnessAssemblyElasticity::StiffnessAssemblyElasticity
StiffnessAssemblyElasticity(EqFields *eq_fields, EqData *eq_data)
Constructor.
Definition: assembly_elasticity.hh:44
Elasticity::EqFields::lame_mu
Field< 3, FieldValue< 3 >::Scalar > lame_mu
Definition: elasticity.hh:90
OutpuFieldsAssemblyElasticity::output_von_mises_stress_vec_
VectorMPI output_von_mises_stress_vec_
Definition: assembly_elasticity.hh:697
ASSERT_EQ
#define ASSERT_EQ(a, b)
Definition of comparative assert macro (EQual) only for debug mode.
Definition: asserts.hh:332
FEValuesViews::Vector::grad
arma::mat::fixed< spacedim, spacedim > grad(unsigned int function_no, unsigned int point_no) const
Return gradient of vector-valued shape function.
Definition: fe_values_views.cc:62
StiffnessAssemblyElasticity::mat_t
arma::mat33 mat_t(const arma::mat33 &m, const arma::vec3 &n)
Definition: assembly_elasticity.hh:244
Elasticity::EqFields::output_field_ptr
std::shared_ptr< FieldFE< 3, FieldValue< 3 >::VectorFixed > > output_field_ptr
Definition: elasticity.hh:96
RhsAssemblyElasticity::RhsAssemblyElasticity
RhsAssemblyElasticity(EqFields *eq_fields, EqData *eq_data)
Constructor.
Definition: assembly_elasticity.hh:293
Elasticity::EqFields::cross_section
Field< 3, FieldValue< 3 >::Scalar > cross_section
Pointer to DarcyFlow field cross_section.
Definition: elasticity.hh:75
RhsAssemblyElasticity::side_dof_indices_
vector< vector< LongIdx > > side_dof_indices_
2 items vector of DOF indices in neighbour calculation.
Definition: assembly_elasticity.hh:538
OutpuFieldsAssemblyElasticity::cell_integral
void cell_integral(DHCellAccessor cell, unsigned int element_patch_idx)
Assemble integral over element.
Definition: assembly_elasticity.hh:598
FieldSet
Container for various descendants of FieldCommonBase.
Definition: field_set.hh:159
RhsAssemblyElasticity::n_dofs_sub_
unsigned int n_dofs_sub_
Number of dofs (on lower dim element)
Definition: assembly_elasticity.hh:530
FEVector
@ FEVector
Definition: finite_element.hh:201
RhsAssemblyElasticity::vec_view_sub_
const FEValuesViews::Vector< 3 > * vec_view_sub_
Vector view of low dim element in neighbour calculation.
Definition: assembly_elasticity.hh:544
Boundary::element_accessor
ElementAccessor< 3 > element_accessor()
Definition: accessors_impl.hh:259
coupling
@ coupling
Definition: generic_assembly.hh:35
OutpuFieldsAssemblyElasticity::dof_indices_tensor_
LocDofVec dof_indices_tensor_
Vector of local DOF indices of tensor fields.
Definition: assembly_elasticity.hh:687
OutpuFieldsAssemblyElasticity
Definition: assembly_elasticity.hh:553
Elasticity::EqFields::bc_type_displacement
@ bc_type_displacement
Definition: elasticity.hh:55
LinSys::rhs_set_values
virtual void rhs_set_values(int nrow, int *rows, double *vals)=0
FiniteElement
Abstract class for the description of a general finite element on a reference simplex in dim dimensio...
Definition: discrete_space.hh:26
OutpuFieldsAssemblyElasticity::output_div_vec_
VectorMPI output_div_vec_
Definition: assembly_elasticity.hh:699
VectorMPI::add
void add(unsigned int pos, double val)
Add value to item on given position.
Definition: vector_mpi.hh:125
DHCellSide::element
ElementAccessor< 3 > element() const
Definition: dh_cell_accessor.hh:223
OutpuFieldsAssemblyElasticity::output_cross_sec_vec_
VectorMPI output_cross_sec_vec_
Definition: assembly_elasticity.hh:698
AssemblyBase::bulk_points
Range< BulkPoint > bulk_points(unsigned int element_patch_idx) const
Return BulkPoint range of appropriate dimension.
Definition: assembly_base.hh:104
Elasticity::EqFields::ref_potential_load
Field< 3, FieldValue< 3 >::Scalar > ref_potential_load
Potential of reference external load on boundary. TODO: Switch to BCField when possible.
Definition: elasticity.hh:77
OutpuFieldsAssemblyElasticity::OutpuFieldsAssemblyElasticity
OutpuFieldsAssemblyElasticity(EqFields *eq_fields, EqData *eq_data)
Constructor.
Definition: assembly_elasticity.hh:562
RhsAssemblyElasticity
Definition: assembly_elasticity.hh:284
OutpuFieldsAssemblyElasticity::fsv_
FEValues< 3 > fsv_
FEValues of side (neighbour integral) object.
Definition: assembly_elasticity.hh:683
bulk
@ bulk
Definition: generic_assembly.hh:33
Elasticity::EqData::dh_tensor_
std::shared_ptr< DOFHandlerMultiDim > dh_tensor_
Definition: elasticity.hh:122
Elasticity::EqFields::bc_traction
BCField< 3, FieldValue< 3 >::VectorFixed > bc_traction
Definition: elasticity.hh:67
OutpuFieldsAssemblyElasticity::EqFields
Elasticity::EqFields EqFields
Definition: assembly_elasticity.hh:556
DHCellAccessor
Cell accessor allow iterate over DOF handler cells.
Definition: dh_cell_accessor.hh:43
RhsAssemblyElasticity::dimjoin_intergral
void dimjoin_intergral(DHCellAccessor cell_lower_dim, DHCellSide neighb_side)
Assembles between elements of different dimensions.
Definition: assembly_elasticity.hh:468
StiffnessAssemblyElasticity::fe_values_side_
FEValues< 3 > fe_values_side_
FEValues of side object.
Definition: assembly_elasticity.hh:266
RhsAssemblyElasticity::dof_indices_
vector< LongIdx > dof_indices_
Vector of global DOF indices.
Definition: assembly_elasticity.hh:537
Elasticity::EqFields::dirichlet_penalty
Field< 3, FieldValue< 3 >::Scalar > dirichlet_penalty
Definition: elasticity.hh:92
StiffnessAssemblyElasticity::local_matrix_ngh_
vector< vector< vector< PetscScalar > > > local_matrix_ngh_
Auxiliary vectors for assemble ngh integral.
Definition: assembly_elasticity.hh:272
Elasticity::EqFields::lame_lambda
Field< 3, FieldValue< 3 >::Scalar > lame_lambda
Definition: elasticity.hh:91
field_value_cache.hh
Elasticity::EqFields::load
Field< 3, FieldValue< 3 >::VectorFixed > load
Definition: elasticity.hh:69
StiffnessAssemblyElasticity::name
static constexpr const char * name()
Definition: assembly_elasticity.hh:41
AssemblyBase::active_integrals_
int active_integrals_
Holds mask of active integrals.
Definition: assembly_base.hh:191
update_JxW_values
@ update_JxW_values
Transformed quadrature weights.
Definition: update_flags.hh:114
DHCellAccessor::get_loc_dof_indices
LocDofVec get_loc_dof_indices() const
Returns the local indices of dofs associated to the cell on the local process.
Definition: dh_cell_accessor.hh:88
FEValuesViews::Vector::value
arma::vec::fixed< spacedim > value(unsigned int function_no, unsigned int point_no) const
Return value of vector-valued shape function.
Definition: fe_values_views.cc:51
std::vector::data
T data
Definition: doxy_dummy_defs.hh:7
RhsAssemblyElasticity::eq_fields_
EqFields * eq_fields_
Data objects shared with Elasticity.
Definition: assembly_elasticity.hh:523
StiffnessAssemblyElasticity::initialize
void initialize(ElementCacheMap *element_cache_map)
Initialize auxiliary vectors and other data members.
Definition: assembly_elasticity.hh:59
ElementAccessor::idx
unsigned int idx() const
We need this method after replacing Region by RegionIdx, and movinf RegionDB instance into particular...
Definition: accessors.hh:215
Elasticity::EqFields::bc_type_stress
@ bc_type_stress
Definition: elasticity.hh:58
AssemblyBase
Definition: assembly_base.hh:34
VectorMPI::get
double get(unsigned int pos) const
Return value on given position.
Definition: vector_mpi.hh:105
balance.hh
FEValues::reinit
void reinit(const ElementAccessor< spacedim > &cell)
Update cell-dependent data (gradients, Jacobians etc.)
Definition: fe_values.cc:536
OutpuFieldsAssemblyElasticity::output_stress_vec_
VectorMPI output_stress_vec_
Definition: assembly_elasticity.hh:696
update_side_JxW_values
@ update_side_JxW_values
Transformed quadrature weight for cell sides.
Definition: update_flags.hh:153
OutpuFieldsAssemblyElasticity::fv_
FEValues< 3 > fv_
FEValues of cell object (FESystem of P disc finite element type)
Definition: assembly_elasticity.hh:682
StiffnessAssemblyElasticity::vec_view_
const FEValuesViews::Vector< 3 > * vec_view_
Vector view in cell integral calculation.
Definition: assembly_elasticity.hh:273
OutpuFieldsAssemblyElasticity::used_fields_
FieldSet used_fields_
Sub field set contains fields used in calculation.
Definition: assembly_elasticity.hh:679
VectorMPI
Definition: vector_mpi.hh:43
Elasticity::EqData
Definition: elasticity.hh:106
Elasticity::EqFields::bc_type_traction
@ bc_type_traction
Definition: elasticity.hh:57
boundary
@ boundary
Definition: generic_assembly.hh:36
OutpuFieldsAssemblyElasticity::dimjoin_intergral
void dimjoin_intergral(DHCellAccessor cell_lower_dim, DHCellSide neighb_side)
Assembles between elements of different dimensions.
Definition: assembly_elasticity.hh:637
AssemblyBase::coupling_points
Range< CouplingPoint > coupling_points(const DHCellSide &cell_side) const
Return CouplingPoint range of appropriate dimension.
Definition: assembly_base.hh:115
OutpuFieldsAssemblyElasticity::initialize
void initialize(ElementCacheMap *element_cache_map)
Initialize auxiliary vectors and other data members.
Definition: assembly_elasticity.hh:574
Elasticity::EqFields::output_cross_section_ptr
std::shared_ptr< FieldFE< 3, FieldValue< 3 >::Scalar > > output_cross_section_ptr
Definition: elasticity.hh:99
StiffnessAssemblyElasticity::n_dofs_
unsigned int n_dofs_
Number of dofs.
Definition: assembly_elasticity.hh:262
StiffnessAssemblyElasticity::used_fields_
FieldSet used_fields_
Sub field set contains fields used in calculation.
Definition: assembly_elasticity.hh:260
Elasticity::EqData::dh_scalar_
std::shared_ptr< DOFHandlerMultiDim > dh_scalar_
Definition: elasticity.hh:121
StiffnessAssemblyElasticity::boundary_side_integral
void boundary_side_integral(DHCellSide cell_side)
Assembles boundary integral.
Definition: assembly_elasticity.hh:126
RhsAssemblyElasticity::boundary_side_integral
void boundary_side_integral(DHCellSide cell_side)
Assembles boundary integral.
Definition: assembly_elasticity.hh:386
GenericAssembly
Generic class of assemblation.
Definition: generic_assembly.hh:160
FESystem
Compound finite element on dim dimensional simplex.
Definition: fe_system.hh:101
OutpuFieldsAssemblyElasticity::name
static constexpr const char * name()
Definition: assembly_elasticity.hh:559
RhsAssemblyElasticity::fe_values_side_
FEValues< 3 > fe_values_side_
FEValues of side (neighbour integral) object.
Definition: assembly_elasticity.hh:534
AssemblyBase::boundary_points
Range< BoundaryPoint > boundary_points(const DHCellSide &cell_side) const
Return BoundaryPoint range of appropriate dimension.
Definition: assembly_base.hh:121
RhsAssemblyElasticity::EqData
Elasticity::EqData EqData
Definition: assembly_elasticity.hh:288
OutpuFieldsAssemblyElasticity::n_dofs_
unsigned int n_dofs_
Number of dofs.
Definition: assembly_elasticity.hh:681
AssemblyBase::element_cache_map_
ElementCacheMap * element_cache_map_
ElementCacheMap shared with GenericAssembly object.
Definition: assembly_base.hh:193
RhsAssemblyElasticity::n_dofs_ngh_
std::vector< unsigned int > n_dofs_ngh_
Number of dofs on lower and higher dimension element (vector of 2 items)
Definition: assembly_elasticity.hh:531
OutpuFieldsAssemblyElasticity::eq_data_
EqData * eq_data_
Definition: assembly_elasticity.hh:676
OutpuFieldsAssemblyElasticity::dof_indices_scalar_
LocDofVec dof_indices_scalar_
Vector of local DOF indices of scalar fields.
Definition: assembly_elasticity.hh:686
Elasticity::EqFields::potential_load
Field< 3, FieldValue< 3 >::Scalar > potential_load
Potential of an additional (external) load.
Definition: elasticity.hh:76
RhsAssemblyElasticity::vec_view_bdr_
const FEValuesViews::Vector< 3 > * vec_view_bdr_
Vector view in boundary calculation.
Definition: assembly_elasticity.hh:542
arma::mat33
Definition: doxy_dummy_defs.hh:18
AssemblyBase::quad_
Quadrature * quad_
Quadrature used in assembling methods.
Definition: assembly_base.hh:189
LinSys::mat_set_values
virtual void mat_set_values(int nrow, int *rows, int ncol, int *cols, double *vals)=0
RhsAssemblyElasticity::local_rhs_
vector< PetscScalar > local_rhs_
Auxiliary vector for assemble methods.
Definition: assembly_elasticity.hh:539
Elasticity::EqFields::bc_type_displacement_normal
@ bc_type_displacement_normal
Definition: elasticity.hh:56
DHCellSide::measure
double measure() const
Definition: dh_cell_accessor.hh:239
OutpuFieldsAssemblyElasticity::~OutpuFieldsAssemblyElasticity
~OutpuFieldsAssemblyElasticity()
Destructor.
Definition: assembly_elasticity.hh:571
IntDim
unsigned int IntDim
A dimension index type.
Definition: mixed.hh:19