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

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

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

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)
 
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
 

Detailed Description

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

Definition at line 598 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 
)

Definition at line 605 of file EshelbianPlasticity.hpp.

608  : T(field_name, type), dataAtPts(data_ptr), assembleSymmetry(false) {}
const double T
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
data at integration pts

◆ 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 
)

Definition at line 610 of file EshelbianPlasticity.hpp.

613  : T(row_field, col_field, type, false), dataAtPts(data_ptr),
614  assembleSymmetry(assemble_symmetry) {}

Member Function Documentation

◆ assemble() [1/3]

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

Definition at line 633 of file EshelbianPlasticity.hpp.

633  {
635  double *vec_ptr = &*nF.begin();
636  int nb_dofs = data.getIndices().size();
637  int *ind_ptr = &*data.getIndices().begin();
638  CHKERR VecSetValues(this->getTSf(), nb_dofs, ind_ptr, vec_ptr, ADD_VALUES);
640  }
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
#define CHKERR
Inline error check.
Definition: definitions.h:604
constexpr auto VecSetValues
VectorDouble nF
local right hand side vector
const VectorInt & getIndices() const
Get global indices of dofs on entity.

◆ assemble() [2/3]

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

◆ 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 
)
virtual

Definition at line 655 of file EshelbianPlasticity.hpp.

657  {
659 
660  auto &bmc = dataAtPts->blockMatContainor;
661  int *row_ind_ptr = &*row_data.getIndices().begin();
662  int *col_ind_ptr = &*col_data.getIndices().begin();
663  int row_nb_dofs = row_data.getIndices().size();
664  int col_nb_dofs = col_data.getIndices().size();
665 
666  auto add_block = [&](auto &row_name, auto &col_name, auto row_side,
667  auto col_side, auto row_type, auto col_type,
668  const auto &m, const auto &row_ind,
669  const auto &col_ind) {
670  auto it = bmc.get<0>().find(boost::make_tuple(
671  row_name, col_name, row_type, col_type, row_side, col_side));
672  if (it != bmc.get<0>().end()) {
673  it->setMat(m);
674  it->setInd(row_ind, col_ind);
675  it->setSetAtElement();
676  } else
677  bmc.insert(DataAtIntegrationPts::BlockMatData(
678  row_name, col_name, row_type, col_type, row_side, col_side, m,
679  row_ind, col_ind));
680  };
681 
682  add_block(this->rowFieldName, this->colFieldName, row_side, col_side,
683  row_type, col_type, K, row_data.getIndices(),
684  col_data.getIndices());
685  if (assembleSymmetry) {
686  transposeK.resize(col_nb_dofs, row_nb_dofs, false);
687  noalias(transposeK) = trans(K);
688  add_block(this->colFieldName, this->rowFieldName, col_side, row_side,
689  col_type, row_type, transposeK, col_data.getIndices(),
690  row_data.getIndices());
691  }
692 
693  double *mat_ptr = &*K.data().begin();
694  CHKERR MatSetValues(this->getTSB(), row_nb_dofs, row_ind_ptr, col_nb_dofs,
695  col_ind_ptr, mat_ptr, ADD_VALUES);
696  if (assembleSymmetry) {
697  double *mat_ptr = &*transposeK.data().begin();
698  CHKERR MatSetValues(this->getTSB(), col_nb_dofs, col_ind_ptr, row_nb_dofs,
699  row_ind_ptr, mat_ptr, ADD_VALUES);
700  }
701 
703  }
static Index< 'm', 3 > m
constexpr auto MatSetValues
MatrixDouble K
local tangent matrix

◆ 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 
)

Definition at line 716 of file EshelbianPlasticity.hpp.

718  {
720  if (row_data.getIndices().empty())
722  if (col_data.getIndices().empty())
724  K.resize(row_data.getIndices().size(), col_data.getIndices().size(), false);
725  K.clear();
726  CHKERR integrate(row_data, col_data);
727  CHKERR assemble(row_side, col_side, row_type, col_type, row_data, col_data);
729  }
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:516
virtual MoFEMErrorCode integrate(EntData &data)

◆ doWork() [2/2]

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

Definition at line 705 of file EshelbianPlasticity.hpp.

705  {
707  if (data.getIndices().empty())
709  nF.resize(data.getIndices().size(), false);
710  nF.clear();
711  CHKERR integrate(side, type, data);
712  CHKERR assemble(side, type, data);
714  }

◆ integrate() [1/3]

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

◆ integrate() [2/3]

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

◆ integrate() [3/3]

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

Definition at line 626 of file EshelbianPlasticity.hpp.

627  {
629  CHKERR integrate(data);
631  }

Member Data Documentation

◆ assembleSymmetry

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

Definition at line 600 of file EshelbianPlasticity.hpp.

◆ dataAtPts

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

data at integration pts

Definition at line 603 of file EshelbianPlasticity.hpp.

◆ K

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

local tangent matrix

Definition at line 617 of file EshelbianPlasticity.hpp.

◆ nF

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

local right hand side vector

Definition at line 616 of file EshelbianPlasticity.hpp.

◆ transposeK

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

Definition at line 618 of file EshelbianPlasticity.hpp.


The documentation for this struct was generated from the following file: