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 (std::string row_field, 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 406 of file EshelbianPlasticity.hpp.

Member Typedef Documentation

◆ ScaleOff

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

Definition at line 408 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 414 of file EshelbianPlasticity.hpp.

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

◆ OpAssembleBasic() [2/2]

template<typename T >
EshelbianPlasticity::OpAssembleBasic< T >::OpAssembleBasic ( std::string  row_field,
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 419 of file EshelbianPlasticity.hpp.

422  { return 1; })
423  : T(row_field, col_field, type, false), dataAtPts(data_ptr),
424  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 445 of file EshelbianPlasticity.hpp.

445  {
447  double *vec_ptr = &*nF.begin();
448  int nb_dofs = data.getIndices().size();
449  int *ind_ptr = &*data.getIndices().begin();
450  CHKERR VecSetValues(this->getTSf(), nb_dofs, ind_ptr, vec_ptr, ADD_VALUES);
452  }

◆ assemble() [2/3]

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

Definition at line 454 of file EshelbianPlasticity.hpp.

455  {
457  CHKERR assemble(data);
459  }

◆ 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 467 of file EshelbianPlasticity.hpp.

469  {
471 
472  if (assembleSymmetry) {
473  const auto row_nb_dofs = row_data.getIndices().size();
474  const auto col_nb_dofs = col_data.getIndices().size();
475  transposeK.resize(col_nb_dofs, row_nb_dofs, false);
476  noalias(transposeK) = trans(K);
477  transposeK *= scaleOff();
478  }
479 
480  CHKERR MatSetValues<AssemblyTypeSelector<A>>(this->getTSB(), row_data,
481  col_data, K, ADD_VALUES);
482  if (assembleSymmetry) {
483  CHKERR MatSetValues<AssemblyTypeSelector<A>>(
484  this->getTSB(), col_data, row_data, transposeK, ADD_VALUES);
485  }
486 
488  }

◆ 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 501 of file EshelbianPlasticity.hpp.

503  {
505  if (row_data.getIndices().empty())
507  if (col_data.getIndices().empty())
509  K.resize(row_data.getIndices().size(), col_data.getIndices().size(), false);
510  K.clear();
511  CHKERR integrate(row_data, col_data);
512  CHKERR assemble(row_side, col_side, row_type, col_type, row_data, col_data);
514  }

◆ doWork() [2/2]

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

Definition at line 490 of file EshelbianPlasticity.hpp.

490  {
492  if (data.getIndices().empty())
494  nF.resize(data.getIndices().size(), false);
495  nF.clear();
496  CHKERR integrate(side, type, data);
497  CHKERR assemble(side, type, data);
499  }

◆ 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 438 of file EshelbianPlasticity.hpp.

439  {
441  CHKERR integrate(data);
443  }

Member Data Documentation

◆ assembleSymmetry

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

Definition at line 409 of file EshelbianPlasticity.hpp.

◆ dataAtPts

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

data at integration pts

Definition at line 412 of file EshelbianPlasticity.hpp.

◆ K

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

local tangent matrix

Definition at line 427 of file EshelbianPlasticity.hpp.

◆ nF

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

local right hand side vector

Definition at line 426 of file EshelbianPlasticity.hpp.

◆ scaleOff

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

Definition at line 430 of file EshelbianPlasticity.hpp.

◆ transposeK

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

Definition at line 428 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:460
EshelbianPlasticity::OpAssembleBasic::scaleOff
ScaleOff scaleOff
Definition: EshelbianPlasticity.hpp:430
EshelbianPlasticity::OpAssembleBasic::nF
VectorDouble nF
local right hand side vector
Definition: EshelbianPlasticity.hpp:426
MoFEM::VecSetValues
MoFEMErrorCode VecSetValues(Vec V, const EntitiesFieldData::EntData &data, const double *ptr, InsertMode iora)
Assemble PETSc vector.
Definition: EntitiesFieldData.hpp:1589
EshelbianPlasticity::OpAssembleBasic::assemble
virtual MoFEMErrorCode assemble(EntData &data)
Definition: EshelbianPlasticity.hpp:445
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
EshelbianPlasticity::OpAssembleBasic::integrate
virtual MoFEMErrorCode integrate(EntData &data)
Definition: EshelbianPlasticity.hpp:432
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:1214
EshelbianPlasticity::OpAssembleBasic::transposeK
MatrixDouble transposeK
Definition: EshelbianPlasticity.hpp:428
EshelbianPlasticity::OpAssembleBasic::dataAtPts
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
data at integration pts
Definition: EshelbianPlasticity.hpp:412
field_name
constexpr auto field_name
Definition: poisson_2d_homogeneous.cpp:13
EshelbianPlasticity::OpAssembleBasic::K
MatrixDouble K
local tangent matrix
Definition: EshelbianPlasticity.hpp:427
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
MOFEM_NOT_IMPLEMENTED
@ MOFEM_NOT_IMPLEMENTED
Definition: definitions.h:32
EshelbianPlasticity::OpAssembleBasic::assembleSymmetry
const bool assembleSymmetry
Definition: EshelbianPlasticity.hpp:409
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359