v0.14.0
Public Types | Public Member Functions | Public Attributes | List of all members
EshelbianPlasticity::OpAssembleBasic< T > Struct Template Reference

#include <users_modules/eshelbian_plasticit/src/EshelbianPlasticity.hpp>

Inheritance diagram for EshelbianPlasticity::OpAssembleBasic< T >:
[legend]
Collaboration diagram for EshelbianPlasticity::OpAssembleBasic< T >:
[legend]

Public Types

using ScaleOff = boost::function< double()>
 

Public Member Functions

 OpAssembleBasic (const std::string &field_name, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const char type)
 
 OpAssembleBasic (const std::string &row_field, const std::string &col_field, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const char type, const bool assemble_symmetry, ScaleOff scale_off=[]() { return 1;})
 
virtual MoFEMErrorCode integrate (EntData &data)
 
virtual MoFEMErrorCode integrate (int row_side, EntityType row_type, EntData &data)
 
virtual MoFEMErrorCode assemble (EntData &data)
 
virtual MoFEMErrorCode assemble (int row_side, EntityType row_type, EntData &data)
 
virtual MoFEMErrorCode integrate (EntData &row_data, EntData &col_data)
 
virtual MoFEMErrorCode assemble (int row_side, int col_side, EntityType row_type, EntityType col_type, EntData &row_data, EntData &col_data)
 
MoFEMErrorCode doWork (int side, EntityType type, EntData &data)
 
MoFEMErrorCode doWork (int row_side, int col_side, EntityType row_type, EntityType col_type, EntData &row_data, EntData &col_data)
 

Public Attributes

const bool assembleSymmetry
 
boost::shared_ptr< DataAtIntegrationPtsdataAtPts
 data at integration pts More...
 
VectorDouble nF
 local right hand side vector More...
 
MatrixDouble K
 local tangent matrix More...
 
MatrixDouble transposeK
 
ScaleOff scaleOff
 

Detailed Description

template<typename T>
struct EshelbianPlasticity::OpAssembleBasic< T >

Definition at line 351 of file EshelbianPlasticity.hpp.

Member Typedef Documentation

◆ ScaleOff

template<typename T >
using EshelbianPlasticity::OpAssembleBasic< T >::ScaleOff = boost::function<double()>

Definition at line 353 of file EshelbianPlasticity.hpp.

Constructor & Destructor Documentation

◆ OpAssembleBasic() [1/2]

template<typename T >
EshelbianPlasticity::OpAssembleBasic< T >::OpAssembleBasic ( const std::string &  field_name,
boost::shared_ptr< DataAtIntegrationPts data_ptr,
const char  type 
)
inline

Definition at line 359 of file EshelbianPlasticity.hpp.

362  : T(field_name, type), dataAtPts(data_ptr), assembleSymmetry(false) {}

◆ OpAssembleBasic() [2/2]

template<typename T >
EshelbianPlasticity::OpAssembleBasic< T >::OpAssembleBasic ( const std::string &  row_field,
const std::string &  col_field,
boost::shared_ptr< DataAtIntegrationPts data_ptr,
const char  type,
const bool  assemble_symmetry,
ScaleOff  scale_off = []() { return 1; } 
)
inline

Definition at line 364 of file EshelbianPlasticity.hpp.

367  { return 1; })
368  : T(row_field, col_field, type, false), dataAtPts(data_ptr),
369  assembleSymmetry(assemble_symmetry), scaleOff(scale_off) {}

Member Function Documentation

◆ assemble() [1/3]

template<typename T >
virtual MoFEMErrorCode EshelbianPlasticity::OpAssembleBasic< T >::assemble ( EntData data)
inlinevirtual

Definition at line 390 of file EshelbianPlasticity.hpp.

390  {
392  double *vec_ptr = &*nF.begin();
393  int nb_dofs = data.getIndices().size();
394  int *ind_ptr = &*data.getIndices().begin();
395  CHKERR VecSetValues(this->getTSf(), nb_dofs, ind_ptr, vec_ptr, ADD_VALUES);
397  }

◆ assemble() [2/3]

template<typename T >
virtual MoFEMErrorCode EshelbianPlasticity::OpAssembleBasic< T >::assemble ( int  row_side,
EntityType  row_type,
EntData data 
)
inlinevirtual

Definition at line 399 of file EshelbianPlasticity.hpp.

400  {
402  CHKERR assemble(data);
404  }

◆ assemble() [3/3]

template<typename T >
virtual MoFEMErrorCode EshelbianPlasticity::OpAssembleBasic< T >::assemble ( int  row_side,
int  col_side,
EntityType  row_type,
EntityType  col_type,
EntData row_data,
EntData col_data 
)
inlinevirtual

Definition at line 412 of file EshelbianPlasticity.hpp.

414  {
416 
417  if (assembleSymmetry) {
418  const auto row_nb_dofs = row_data.getIndices().size();
419  const auto col_nb_dofs = col_data.getIndices().size();
420  transposeK.resize(col_nb_dofs, row_nb_dofs, false);
421  noalias(transposeK) = trans(K);
422  transposeK *= scaleOff();
423  }
424 
425  CHKERR MatSetValues<SchurL2Mats>(this->getTSA(), row_data, col_data, K,
426  ADD_VALUES);
427  if (assembleSymmetry) {
428  CHKERR MatSetValues<SchurL2Mats>(this->getTSA(), col_data, row_data,
429  transposeK, ADD_VALUES);
430  }
431 
433  }

◆ doWork() [1/2]

template<typename T >
MoFEMErrorCode EshelbianPlasticity::OpAssembleBasic< T >::doWork ( int  row_side,
int  col_side,
EntityType  row_type,
EntityType  col_type,
EntData row_data,
EntData col_data 
)
inline

Definition at line 446 of file EshelbianPlasticity.hpp.

448  {
450  if (row_data.getIndices().empty())
452  if (col_data.getIndices().empty())
454  K.resize(row_data.getIndices().size(), col_data.getIndices().size(), false);
455  K.clear();
456  CHKERR integrate(row_data, col_data);
457  CHKERR assemble(row_side, col_side, row_type, col_type, row_data, col_data);
459  }

◆ doWork() [2/2]

template<typename T >
MoFEMErrorCode EshelbianPlasticity::OpAssembleBasic< T >::doWork ( int  side,
EntityType  type,
EntData data 
)
inline

Definition at line 435 of file EshelbianPlasticity.hpp.

435  {
437  if (data.getIndices().empty())
439  nF.resize(data.getIndices().size(), false);
440  nF.clear();
441  CHKERR integrate(side, type, data);
442  CHKERR assemble(side, type, data);
444  }

◆ integrate() [1/3]

template<typename T >
virtual MoFEMErrorCode EshelbianPlasticity::OpAssembleBasic< T >::integrate ( EntData data)
inlinevirtual

◆ integrate() [2/3]

template<typename T >
virtual MoFEMErrorCode EshelbianPlasticity::OpAssembleBasic< T >::integrate ( EntData row_data,
EntData col_data 
)
inlinevirtual

◆ integrate() [3/3]

template<typename T >
virtual MoFEMErrorCode EshelbianPlasticity::OpAssembleBasic< T >::integrate ( int  row_side,
EntityType  row_type,
EntData data 
)
inlinevirtual

Definition at line 383 of file EshelbianPlasticity.hpp.

384  {
386  CHKERR integrate(data);
388  }

Member Data Documentation

◆ assembleSymmetry

template<typename T >
const bool EshelbianPlasticity::OpAssembleBasic< T >::assembleSymmetry

Definition at line 354 of file EshelbianPlasticity.hpp.

◆ dataAtPts

template<typename T >
boost::shared_ptr<DataAtIntegrationPts> EshelbianPlasticity::OpAssembleBasic< T >::dataAtPts

data at integration pts

Definition at line 357 of file EshelbianPlasticity.hpp.

◆ K

template<typename T >
MatrixDouble EshelbianPlasticity::OpAssembleBasic< T >::K

local tangent matrix

Definition at line 372 of file EshelbianPlasticity.hpp.

◆ nF

template<typename T >
VectorDouble EshelbianPlasticity::OpAssembleBasic< T >::nF

local right hand side vector

Definition at line 371 of file EshelbianPlasticity.hpp.

◆ scaleOff

template<typename T >
ScaleOff EshelbianPlasticity::OpAssembleBasic< T >::scaleOff

Definition at line 375 of file EshelbianPlasticity.hpp.

◆ transposeK

template<typename T >
MatrixDouble EshelbianPlasticity::OpAssembleBasic< T >::transposeK

Definition at line 373 of file EshelbianPlasticity.hpp.


The documentation for this struct was generated from the following file:
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:447
EshelbianPlasticity::OpAssembleBasic::scaleOff
ScaleOff scaleOff
Definition: EshelbianPlasticity.hpp:375
EshelbianPlasticity::OpAssembleBasic::nF
VectorDouble nF
local right hand side vector
Definition: EshelbianPlasticity.hpp:371
MoFEM::VecSetValues
MoFEMErrorCode VecSetValues(Vec V, const EntitiesFieldData::EntData &data, const double *ptr, InsertMode iora)
Assemble PETSc vector.
Definition: EntitiesFieldData.hpp:1576
EshelbianPlasticity::OpAssembleBasic::assemble
virtual MoFEMErrorCode assemble(EntData &data)
Definition: EshelbianPlasticity.hpp:390
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:535
EshelbianPlasticity::OpAssembleBasic::integrate
virtual MoFEMErrorCode integrate(EntData &data)
Definition: EshelbianPlasticity.hpp:377
convert.type
type
Definition: convert.py:64
MoFEM::EntitiesFieldData::EntData::getIndices
const VectorInt & getIndices() const
Get global indices of dofs on entity.
Definition: EntitiesFieldData.hpp:1201
EshelbianPlasticity::OpAssembleBasic::transposeK
MatrixDouble transposeK
Definition: EshelbianPlasticity.hpp:373
EshelbianPlasticity::OpAssembleBasic::dataAtPts
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
data at integration pts
Definition: EshelbianPlasticity.hpp:357
MoFEM::MatSetValues< SchurL2Mats >
MoFEMErrorCode MatSetValues< SchurL2Mats >(Mat M, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, const MatrixDouble &mat, InsertMode iora)
Definition: Schur.hpp:189
field_name
constexpr auto field_name
Definition: poisson_2d_homogeneous.cpp:13
EshelbianPlasticity::OpAssembleBasic::K
MatrixDouble K
local tangent matrix
Definition: EshelbianPlasticity.hpp:372
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
MOFEM_NOT_IMPLEMENTED
@ MOFEM_NOT_IMPLEMENTED
Definition: definitions.h:32
EshelbianPlasticity::OpAssembleBasic::assembleSymmetry
const bool assembleSymmetry
Definition: EshelbianPlasticity.hpp:354
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346