Flow123d  JS_before_hm-1822-gbb48b12e9
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_DBG(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_DBG(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;
301  this->used_fields_ += eq_fields_->bc_type;
304  }
305 
306  /// Destructor.
308 
309  /// Initialize auxiliary vectors and other data members
310  void initialize(ElementCacheMap *element_cache_map) {
311  //this->balance_ = eq_data_->balance_;
312  this->element_cache_map_ = element_cache_map;
313 
314  shared_ptr<FE_P<dim>> fe_p = std::make_shared< FE_P<dim> >(1);
315  shared_ptr<FE_P<dim-1>> fe_p_low = std::make_shared< FE_P<dim-1> >(1);
316  fe_ = std::make_shared<FESystem<dim>>(fe_p, FEVector, 3);
317  fe_low_ = std::make_shared<FESystem<dim-1>>(fe_p_low, FEVector, 3);
318  fe_values_.initialize(*this->quad_, *fe_,
322  fe_values_side_.initialize(*this->quad_low_, *fe_,
324  fe_values_sub_.initialize(*this->quad_low_, *fe_low_,
326  n_dofs_ = fe_->n_dofs();
327  n_dofs_sub_ = fe_low_->n_dofs();
329  dof_indices_.resize(n_dofs_);
330  side_dof_indices_.resize(2);
331  side_dof_indices_[0].resize(n_dofs_sub_); // index 0 = element with lower dimension,
332  side_dof_indices_[1].resize(n_dofs_); // index 1 = side of element with higher dimension
333  local_rhs_.resize(n_dofs_);
334  local_rhs_ngh_.resize(2);
335  for (uint n=0; n<2; ++n) local_rhs_ngh_[n].resize(n_dofs_);
339  if (dim>1) vec_view_sub_ = &fe_values_sub_.vector_view(0);
340  }
341 
342 
343  /// Assemble integral over element
344  inline void cell_integral(DHCellAccessor cell, unsigned int element_patch_idx)
345  {
346  if (cell.dim() != dim) return;
347  if (!cell.is_own()) return;
348 
349  ElementAccessor<3> elm_acc = cell.elm();
350 
351  fe_values_.reinit(elm_acc);
353 
354  // assemble the local stiffness matrix
355  fill_n(&(local_rhs_[0]), n_dofs_, 0);
356  //local_source_balance_vector.assign(n_dofs_, 0);
357  //local_source_balance_rhs.assign(n_dofs_, 0);
358 
359  // compute sources
360  unsigned int k=0;
361  for (auto p : this->bulk_points(element_patch_idx) )
362  {
363  for (unsigned int i=0; i<n_dofs_; i++)
364  local_rhs_[i] += (
365  arma::dot(eq_fields_->load(p), vec_view_->value(i,k))
368  ++k;
369  }
371 
372 // for (unsigned int i=0; i<n_dofs_; i++)
373 // {
374 // for (unsigned int k=0; k<qsize_; k++) // point range
375 // local_source_balance_vector[i] -= 0;//sources_sigma[k]*fe_values_[vec_view_].value(i,k)*fe_values_.JxW(k);
376 //
377 // local_source_balance_rhs[i] += local_rhs_[i];
378 // }
379 // balance_->add_source_matrix_values(subst_idx, elm_acc.region().bulk_idx(), dof_indices_, local_source_balance_vector);
380 // balance_->add_source_vec_values(subst_idx, elm_acc.region().bulk_idx(), dof_indices_, local_source_balance_rhs);
381  }
382 
383  /// Assembles boundary integral.
384  inline void boundary_side_integral(DHCellSide cell_side)
385  {
386  ASSERT_EQ_DBG(cell_side.dim(), dim).error("Dimension of element mismatch!");
387  if (!cell_side.cell().is_own()) return;
388 
389  Side side = cell_side.side();
390  const DHCellAccessor &dh_cell = cell_side.cell();
391  dh_cell.get_dof_indices(dof_indices_);
393 
394  auto p_side = *( this->boundary_points(cell_side).begin() );
395  auto p_bdr = p_side.point_bdr( side.cond().element_accessor() );
396  unsigned int bc_type = eq_fields_->bc_type(p_bdr);
397 
398  fill_n(&(local_rhs_[0]), n_dofs_, 0);
399  // local_flux_balance_vector.assign(n_dofs_, 0);
400  // local_flux_balance_rhs = 0;
401 
402  unsigned int k=0;
403  if (bc_type == EqFields::bc_type_displacement)
404  {
405  double side_measure = cell_side.measure();
406  for (auto p : this->boundary_points(cell_side) )
407  {
408  auto p_bdr = p.point_bdr( side.cond().element_accessor() );
409  for (unsigned int i=0; i<n_dofs_; i++)
410  local_rhs_[i] += (eq_fields_->dirichlet_penalty(p) / side_measure) *
411  arma::dot(eq_fields_->bc_displacement(p_bdr), vec_view_bdr_->value(i,k)) *
413  ++k;
414  }
415  }
416  else if (bc_type == EqFields::bc_type_displacement_normal)
417  {
418  double side_measure = cell_side.measure();
419  for (auto p : this->boundary_points(cell_side) )
420  {
421  auto p_bdr = p.point_bdr( side.cond().element_accessor() );
422  for (unsigned int i=0; i<n_dofs_; i++)
423  local_rhs_[i] += (eq_fields_->dirichlet_penalty(p) / side_measure) *
427  ++k;
428  }
429  }
430  else if (bc_type == EqFields::bc_type_traction)
431  {
432  for (auto p : this->boundary_points(cell_side) )
433  {
434  auto p_bdr = p.point_bdr( side.cond().element_accessor() );
435  for (unsigned int i=0; i<n_dofs_; i++)
439  ++k;
440  }
441  }
443 
444 
445 // balance_->add_flux_matrix_values(subst_idx, loc_b, side_dof_indices, local_flux_balance_vector);
446 // balance_->add_flux_vec_value(subst_idx, loc_b, local_flux_balance_rhs);
447  // ++loc_b;
448  }
449 
450 
451  /// Assembles between elements of different dimensions.
452  inline void dimjoin_intergral(DHCellAccessor cell_lower_dim, DHCellSide neighb_side) {
453  if (dim == 1) return;
454  ASSERT_EQ_DBG(cell_lower_dim.dim(), dim-1).error("Dimension of element mismatch!");
455 
456  cell_lower_dim.get_dof_indices(side_dof_indices_[0]);
457  ElementAccessor<3> cell_sub = cell_lower_dim.elm();
458  fe_values_sub_.reinit(cell_sub);
459 
460  DHCellAccessor cell_higher_dim = eq_data_->dh_->cell_accessor_from_element( neighb_side.element().idx() );
461  cell_higher_dim.get_dof_indices(side_dof_indices_[1]);
462  fe_values_side_.reinit(neighb_side.side());
463 
464  // Element id's for testing if they belong to local partition.
465  bool own_element_id[2];
466  own_element_id[0] = cell_lower_dim.is_own();
467  own_element_id[1] = cell_higher_dim.is_own();
468 
469  for (unsigned int n=0; n<2; ++n)
470  for (unsigned int i=0; i<n_dofs_; i++)
471  local_rhs_ngh_[n][i] = 0;
472 
473  // set transmission conditions
474  unsigned int k=0;
475  for (auto p_high : this->coupling_points(neighb_side) )
476  {
477  auto p_low = p_high.lower_dim(cell_lower_dim);
479 
480  for (int n=0; n<2; n++)
481  {
482  if (!own_element_id[n]) continue;
483 
484  for (unsigned int i=0; i<n_dofs_ngh_[n]; i++)
485  {
486  arma::vec3 vi = (n==0) ? arma::zeros(3) : vec_view_side_->value(i,k);
487  arma::vec3 vf = (n==1) ? arma::zeros(3) : vec_view_sub_->value(i,k);
488 
489  local_rhs_ngh_[n][i] -= eq_fields_->fracture_sigma(p_low) * eq_fields_->cross_section(p_high) *
490  arma::dot(vf-vi, eq_fields_->potential_load(p_high) * nv) * fe_values_sub_.JxW(k);
491  }
492  }
493  ++k;
494  }
495 
496  for (unsigned int n=0; n<2; ++n)
498  }
499 
500 
501 
502 private:
503  shared_ptr<FiniteElement<dim>> fe_; ///< Finite element for the solution of the advection-diffusion equation.
504  shared_ptr<FiniteElement<dim-1>> fe_low_; ///< Finite element for the solution of the advection-diffusion equation (dim-1).
505 
506  /// Data objects shared with Elasticity
509 
510  /// Sub field set contains fields used in calculation.
512 
513  unsigned int n_dofs_; ///< Number of dofs
514  unsigned int n_dofs_sub_; ///< Number of dofs (on lower dim element)
515  std::vector<unsigned int> n_dofs_ngh_; ///< Number of dofs on lower and higher dimension element (vector of 2 items)
516  FEValues<3> fe_values_; ///< FEValues of cell object (FESystem of P disc finite element type)
517  FEValues<3> fe_values_bdr_side_; ///< FEValues of side (boundary integral) object
518  FEValues<3> fe_values_side_; ///< FEValues of side (neighbour integral) object
519  FEValues<3> fe_values_sub_; ///< FEValues of lower dimension cell object
520 
521  vector<LongIdx> dof_indices_; ///< Vector of global DOF indices
522  vector<vector<LongIdx> > side_dof_indices_; ///< 2 items vector of DOF indices in neighbour calculation.
523  vector<PetscScalar> local_rhs_; ///< Auxiliary vector for assemble methods
524  vector<vector<PetscScalar>> local_rhs_ngh_; ///< Auxiliary vectors for assemble ngh integral
525  const FEValuesViews::Vector<3> * vec_view_; ///< Vector view in cell integral calculation.
526  const FEValuesViews::Vector<3> * vec_view_bdr_; ///< Vector view in boundary calculation.
527  const FEValuesViews::Vector<3> * vec_view_side_; ///< Vector view in neighbour calculation.
528  const FEValuesViews::Vector<3> * vec_view_sub_; ///< Vector view of low dim element in neighbour calculation.
529 
530 
531  template < template<IntDim...> class DimAssembly>
532  friend class GenericAssembly;
533 
534 };
535 
536 template <unsigned int dim>
538 {
539 public:
540  typedef typename Elasticity::EqFields EqFields;
541  typedef typename Elasticity::EqData EqData;
542 
543  static constexpr const char * name() { return "OutpuFieldsAssemblyElasticity"; }
544 
545  /// Constructor.
547  : AssemblyBase<dim>(0), eq_fields_(eq_fields), eq_data_(eq_data) {
550  this->used_fields_ += eq_fields_->lame_mu;
552  }
553 
554  /// Destructor.
556 
557  /// Initialize auxiliary vectors and other data members
558  void initialize(ElementCacheMap *element_cache_map) {
559  //this->balance_ = eq_data_->balance_;
560  this->element_cache_map_ = element_cache_map;
561 
562  shared_ptr<FE_P<dim>> fe_p = std::make_shared< FE_P<dim> >(1);
563  fe_ = std::make_shared<FESystem<dim>>(fe_p, FEVector, 3);
564  fv_.initialize(*this->quad_, *fe_,
566  fsv_.initialize(*this->quad_low_, *fe_,
568  n_dofs_ = fe_->n_dofs();
569  vec_view_ = &fv_.vector_view(0);
570  // if (dim>1) ??
572 
578  }
579 
580 
581  /// Assemble integral over element
582  inline void cell_integral(DHCellAccessor cell, unsigned int element_patch_idx)
583  {
584  if (cell.dim() != dim) return;
585  if (!cell.is_own()) return;
586  DHCellAccessor cell_tensor = cell.cell_with_other_dh(eq_data_->dh_tensor_.get());
587  DHCellAccessor cell_scalar = cell.cell_with_other_dh(eq_data_->dh_scalar_.get());
588 
589  auto elm = cell.elm();
590 
591  fv_.reinit(elm);
595 
596  auto p = *( this->bulk_points(element_patch_idx).begin() );
597 
598  arma::mat33 stress = arma::zeros(3,3);
599  double div = 0;
600  for (unsigned int i=0; i<n_dofs_; i++)
601  {
602  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))
605  }
606 
607  arma::mat33 stress_dev = stress - arma::trace(stress)/3*arma::eye(3,3);
608  double von_mises_stress = sqrt(1.5*arma::dot(stress_dev, stress_dev));
610 
611  for (unsigned int i=0; i<3; i++)
612  for (unsigned int j=0; j<3; j++)
613  output_stress_vec_.add( dof_indices_tensor_[i*3+j], stress(i,j) );
614  output_von_mises_stress_vec_.set( dof_indices_scalar_[0], von_mises_stress );
615 
617  }
618 
619 
620  /// Assembles between elements of different dimensions.
621  inline void dimjoin_intergral(DHCellAccessor cell_lower_dim, DHCellSide neighb_side) {
622  if (dim == 1) return;
623  ASSERT_EQ_DBG(cell_lower_dim.dim(), dim-1).error("Dimension of element mismatch!");
624 
626  normal_stress_.zeros();
627 
628  DHCellAccessor cell_higher_dim = neighb_side.cell();
629  DHCellAccessor cell_tensor = cell_lower_dim.cell_with_other_dh(eq_data_->dh_tensor_.get());
630  DHCellAccessor cell_scalar = cell_lower_dim.cell_with_other_dh(eq_data_->dh_scalar_.get());
631  fsv_.reinit(neighb_side.side());
632 
633  dof_indices_ = cell_higher_dim.get_loc_dof_indices();
634  auto p_high = *( this->coupling_points(neighb_side).begin() );
635  auto p_low = p_high.lower_dim(cell_lower_dim);
636 
637  for (unsigned int i=0; i<n_dofs_; i++)
638  {
640  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);
641  normal_stress_ += eq_fields_->lame_mu(p_low)*(grad+grad.t()) + eq_fields_->lame_lambda(p_low)*arma::trace(grad)*arma::eye(3,3);
642  }
643 
646  for (unsigned int i=0; i<3; i++)
647  for (unsigned int j=0; j<3; j++)
651  }
652 
653 
654 
655 private:
656  shared_ptr<FiniteElement<dim>> fe_; ///< Finite element for the solution of the advection-diffusion equation.
657 
658  /// Data objects shared with Elasticity
661 
662  /// Sub field set contains fields used in calculation.
664 
665  unsigned int n_dofs_; ///< Number of dofs
666  FEValues<3> fv_; ///< FEValues of cell object (FESystem of P disc finite element type)
667  FEValues<3> fsv_; ///< FEValues of side (neighbour integral) object
668 
669  LocDofVec dof_indices_; ///< Vector of local DOF indices of vector fields
670  LocDofVec dof_indices_scalar_; ///< Vector of local DOF indices of scalar fields
671  LocDofVec dof_indices_tensor_; ///< Vector of local DOF indices of tensor fields
672  const FEValuesViews::Vector<3> * vec_view_; ///< Vector view in cell integral calculation.
673  const FEValuesViews::Vector<3> * vec_view_side_; ///< Vector view in neighbour calculation.
674 
675  double normal_displacement_; ///< Holds constributions of normal displacement.
676  arma::mat33 normal_stress_; ///< Holds constributions of normal stress.
677 
678  /// Data vectors of output fields (FieldFE).
684 
685  template < template<IntDim...> class DimAssembly>
686  friend class GenericAssembly;
687 
688 };
689 
690 
691 #endif /* ASSEMBLY_ELASTICITY_HH_ */
692 
RhsAssemblyElasticity::fe_
shared_ptr< FiniteElement< dim > > fe_
Finite element for the solution of the advection-diffusion equation.
Definition: assembly_elasticity.hh:503
OutpuFieldsAssemblyElasticity::EqData
Elasticity::EqData EqData
Definition: assembly_elasticity.hh:541
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:94
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:656
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:504
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:525
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:517
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:511
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:524
AssemblyBase::quad_low_
Quadrature * quad_low_
Quadrature used in assembling methods (dim-1).
Definition: assembly_base.hh:132
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:344
Elasticity::EqData::ls
LinSys * ls
Linear algebraic system.
Definition: elasticity.hh:125
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:519
Elasticity::EqFields::bc_type
BCField< 3, FieldValue< 3 >::Enum > bc_type
Definition: elasticity.hh:64
OutpuFieldsAssemblyElasticity::eq_fields_
EqFields * eq_fields_
Data objects shared with Elasticity.
Definition: assembly_elasticity.hh:659
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:513
StiffnessAssemblyElasticity::~StiffnessAssemblyElasticity
~StiffnessAssemblyElasticity()
Destructor.
Definition: assembly_elasticity.hh:56
RhsAssemblyElasticity::eq_data_
EqData * eq_data_
Definition: assembly_elasticity.hh:508
update_values
@ update_values
Shape function values.
Definition: update_flags.hh:87
RhsAssemblyElasticity::~RhsAssemblyElasticity
~RhsAssemblyElasticity()
Destructor.
Definition: assembly_elasticity.hh:307
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:675
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
ASSERT_EQ_DBG
#define ASSERT_EQ_DBG(a, b)
Definition of comparative assert macro (EQual) only for debug mode.
Definition: asserts.hh:332
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:97
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:225
RhsAssemblyElasticity::fe_values_
FEValues< 3 > fe_values_
FEValues of cell object (FESystem of P disc finite element type)
Definition: assembly_elasticity.hh:516
OutpuFieldsAssemblyElasticity::dof_indices_
LocDofVec dof_indices_
Vector of local DOF indices of vector fields.
Definition: assembly_elasticity.hh:669
Elasticity::EqData::dh_
std::shared_ptr< DOFHandlerMultiDim > dh_
Objects for distribution of dofs.
Definition: elasticity.hh:117
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:310
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:70
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:95
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:65
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:527
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:679
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:676
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:672
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:673
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:404
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:87
OutpuFieldsAssemblyElasticity::output_von_mises_stress_vec_
VectorMPI output_von_mises_stress_vec_
Definition: assembly_elasticity.hh:681
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:93
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:73
RhsAssemblyElasticity::side_dof_indices_
vector< vector< LongIdx > > side_dof_indices_
2 items vector of DOF indices in neighbour calculation.
Definition: assembly_elasticity.hh:522
OutpuFieldsAssemblyElasticity::cell_integral
void cell_integral(DHCellAccessor cell, unsigned int element_patch_idx)
Assemble integral over element.
Definition: assembly_elasticity.hh:582
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:514
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:528
Boundary::element_accessor
ElementAccessor< 3 > element_accessor()
Definition: accessors_impl.hh:253
coupling
@ coupling
Definition: generic_assembly.hh:34
OutpuFieldsAssemblyElasticity::dof_indices_tensor_
LocDofVec dof_indices_tensor_
Vector of local DOF indices of tensor fields.
Definition: assembly_elasticity.hh:671
OutpuFieldsAssemblyElasticity
Definition: assembly_elasticity.hh:537
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:683
VectorMPI::add
void add(unsigned int pos, double val)
Add value to item on given position.
Definition: vector_mpi.hh:123
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:682
AssemblyBase::bulk_points
Range< BulkPoint > bulk_points(unsigned int element_patch_idx) const
Return BulkPoint range of appropriate dimension.
Definition: assembly_base.hh:93
OutpuFieldsAssemblyElasticity::OutpuFieldsAssemblyElasticity
OutpuFieldsAssemblyElasticity(EqFields *eq_fields, EqData *eq_data)
Constructor.
Definition: assembly_elasticity.hh:546
RhsAssemblyElasticity
Definition: assembly_elasticity.hh:284
OutpuFieldsAssemblyElasticity::fsv_
FEValues< 3 > fsv_
FEValues of side (neighbour integral) object.
Definition: assembly_elasticity.hh:667
bulk
@ bulk
Definition: generic_assembly.hh:32
Elasticity::EqData::dh_tensor_
std::shared_ptr< DOFHandlerMultiDim > dh_tensor_
Definition: elasticity.hh:119
Elasticity::EqFields::bc_traction
BCField< 3, FieldValue< 3 >::VectorFixed > bc_traction
Definition: elasticity.hh:66
OutpuFieldsAssemblyElasticity::EqFields
Elasticity::EqFields EqFields
Definition: assembly_elasticity.hh:540
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:452
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:521
Elasticity::EqFields::dirichlet_penalty
Field< 3, FieldValue< 3 >::Scalar > dirichlet_penalty
Definition: elasticity.hh:89
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:88
field_value_cache.hh
Elasticity::EqFields::load
Field< 3, FieldValue< 3 >::VectorFixed > load
Definition: elasticity.hh:67
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:133
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:507
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
Return local idx of element in boundary / bulk part of element vector.
Definition: accessors.hh:223
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:680
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:666
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:663
VectorMPI
Definition: vector_mpi.hh:43
Elasticity::EqData
Definition: elasticity.hh:103
Elasticity::EqFields::bc_type_traction
@ bc_type_traction
Definition: elasticity.hh:57
boundary
@ boundary
Definition: generic_assembly.hh:35
OutpuFieldsAssemblyElasticity::dimjoin_intergral
void dimjoin_intergral(DHCellAccessor cell_lower_dim, DHCellSide neighb_side)
Assembles between elements of different dimensions.
Definition: assembly_elasticity.hh:621
AssemblyBase::coupling_points
Range< CouplingPoint > coupling_points(const DHCellSide &cell_side) const
Return CouplingPoint range of appropriate dimension.
Definition: assembly_base.hh:104
OutpuFieldsAssemblyElasticity::initialize
void initialize(ElementCacheMap *element_cache_map)
Initialize auxiliary vectors and other data members.
Definition: assembly_elasticity.hh:558
Elasticity::EqFields::output_cross_section_ptr
std::shared_ptr< FieldFE< 3, FieldValue< 3 >::Scalar > > output_cross_section_ptr
Definition: elasticity.hh:96
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:118
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:384
GenericAssembly
Generic class of assemblation.
Definition: generic_assembly.hh:70
FESystem
Compound finite element on dim dimensional simplex.
Definition: fe_system.hh:101
OutpuFieldsAssemblyElasticity::name
static constexpr const char * name()
Definition: assembly_elasticity.hh:543
RhsAssemblyElasticity::fe_values_side_
FEValues< 3 > fe_values_side_
FEValues of side (neighbour integral) object.
Definition: assembly_elasticity.hh:518
AssemblyBase::boundary_points
Range< BoundaryPoint > boundary_points(const DHCellSide &cell_side) const
Return BoundaryPoint range of appropriate dimension.
Definition: assembly_base.hh:110
RhsAssemblyElasticity::EqData
Elasticity::EqData EqData
Definition: assembly_elasticity.hh:288
OutpuFieldsAssemblyElasticity::n_dofs_
unsigned int n_dofs_
Number of dofs.
Definition: assembly_elasticity.hh:665
AssemblyBase::element_cache_map_
ElementCacheMap * element_cache_map_
ElementCacheMap shared with GenericAssembly object.
Definition: assembly_base.hh:135
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:515
OutpuFieldsAssemblyElasticity::eq_data_
EqData * eq_data_
Definition: assembly_elasticity.hh:660
OutpuFieldsAssemblyElasticity::dof_indices_scalar_
LocDofVec dof_indices_scalar_
Vector of local DOF indices of scalar fields.
Definition: assembly_elasticity.hh:670
Elasticity::EqFields::potential_load
Field< 3, FieldValue< 3 >::Scalar > potential_load
Potential of an additional (external) load.
Definition: elasticity.hh:74
RhsAssemblyElasticity::vec_view_bdr_
const FEValuesViews::Vector< 3 > * vec_view_bdr_
Vector view in boundary calculation.
Definition: assembly_elasticity.hh:526
arma::mat33
Definition: doxy_dummy_defs.hh:18
AssemblyBase::quad_
Quadrature * quad_
Quadrature used in assembling methods.
Definition: assembly_base.hh:131
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:523
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:555
IntDim
unsigned int IntDim
A dimension index type.
Definition: mixed.hh:19