v0.9.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 648 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 655 of file EshelbianPlasticity.hpp.

658  : T(field_name, type), dataAtPts(data_ptr), assembleSymmetry(false) {}
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 660 of file EshelbianPlasticity.hpp.

663  : T(row_field, col_field, type, false), dataAtPts(data_ptr),
664  assembleSymmetry(assemble_symmetry) {}
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
data at integration pts

Member Function Documentation

◆ assemble() [1/3]

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

Definition at line 683 of file EshelbianPlasticity.hpp.

683  {
685  double *vec_ptr = &*nF.begin();
686  int nb_dofs = data.getIndices().size();
687  int *ind_ptr = &*data.getIndices().begin();
688  CHKERR VecSetValues(T::getFEMethod()->ts_F, nb_dofs, ind_ptr, vec_ptr,
689  ADD_VALUES);
691  }
VectorDouble nF
local right hand side vector
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
const VectorInt & getIndices() const
Get global indices of dofs on entity.
MoFEMErrorCode VecSetValues(Vec V, const DataForcesAndSourcesCore::EntData &data, const double *ptr, InsertMode iora)
Assemble PETSc vector.
#define CHKERR
Inline error check.
Definition: definitions.h:596
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407

◆ assemble() [2/3]

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

Reimplemented in EshelbianPlasticity::OpSpatialSchurEnd, EshelbianPlasticity::OpSpatialPreconditionMass, and EshelbianPlasticity::OpSpatialSchurBegin.

Definition at line 693 of file EshelbianPlasticity.hpp.

694  {
696  CHKERR assemble(data);
698  }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
virtual MoFEMErrorCode assemble(EntData &data)
#define CHKERR
Inline error check.
Definition: definitions.h:596
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407

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

708  {
710 
711  auto &bmc = dataAtPts->blockMatContainor;
712  int *row_ind_ptr = &*row_data.getIndices().begin();
713  int *col_ind_ptr = &*col_data.getIndices().begin();
714  int row_nb_dofs = row_data.getIndices().size();
715  int col_nb_dofs = col_data.getIndices().size();
716 
717  auto add_block = [&](auto &row_name, auto &col_name, auto row_side,
718  auto col_side, auto row_type, auto col_type,
719  const auto &m, const auto &row_ind,
720  const auto &col_ind) {
721  auto it = bmc.get<0>().find(boost::make_tuple(
722  row_name, col_name, row_type, col_type, row_side, col_side));
723  if (it != bmc.get<0>().end()) {
724  it->setMat(m);
725  it->setInd(row_ind, col_ind);
726  it->setSetAtElement();
727  } else
728  bmc.insert(DataAtIntegrationPts::BlockMatData(
729  row_name, col_name, row_type, col_type, row_side, col_side, m,
730  row_ind, col_ind));
731  };
732 
733  add_block(this->rowFieldName, this->colFieldName, row_side, col_side,
734  row_type, col_type, K, row_data.getIndices(),
735  col_data.getIndices());
736  if (assembleSymmetry) {
737  transposeK.resize(col_nb_dofs, row_nb_dofs, false);
738  noalias(transposeK) = trans(K);
739  add_block(this->colFieldName, this->rowFieldName, col_side, row_side,
740  col_type, row_type, transposeK, col_data.getIndices(),
741  row_data.getIndices());
742  }
743 
744  double *mat_ptr = &*K.data().begin();
745  CHKERR MatSetValues(T::getFEMethod()->ts_B, row_nb_dofs, row_ind_ptr,
746  col_nb_dofs, col_ind_ptr, mat_ptr, ADD_VALUES);
747  if (assembleSymmetry) {
748  double *mat_ptr = &*transposeK.data().begin();
749  CHKERR MatSetValues(T::getFEMethod()->ts_B, col_nb_dofs, col_ind_ptr,
750  row_nb_dofs, row_ind_ptr, mat_ptr, ADD_VALUES);
751  }
752 
754  }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
data at integration pts
const VectorInt & getIndices() const
Get global indices of dofs on entity.
MatrixDouble K
local tangent matrix
MoFEMErrorCode MatSetValues(Mat M, const DataForcesAndSourcesCore::EntData &row_data, const DataForcesAndSourcesCore::EntData &col_data, const double *ptr, InsertMode iora)
Assemble PETSc matrix.
#define CHKERR
Inline error check.
Definition: definitions.h:596
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407

◆ doWork() [1/2]

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

Definition at line 756 of file EshelbianPlasticity.hpp.

756  {
758  if (data.getIndices().empty())
760  nF.resize(data.getIndices().size(), false);
761  nF.clear();
762  CHKERR integrate(side, type, data);
763  CHKERR assemble(side, type, data);
765  }
VectorDouble nF
local right hand side vector
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:508
virtual MoFEMErrorCode assemble(EntData &data)
const VectorInt & getIndices() const
Get global indices of dofs on entity.
#define CHKERR
Inline error check.
Definition: definitions.h:596
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407
virtual MoFEMErrorCode integrate(EntData &data)

◆ doWork() [2/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 767 of file EshelbianPlasticity.hpp.

769  {
771  if (row_data.getIndices().empty())
773  if (col_data.getIndices().empty())
775  K.resize(row_data.getIndices().size(), col_data.getIndices().size(), false);
776  K.clear();
777  CHKERR integrate(row_data, col_data);
778  CHKERR assemble(row_side, col_side, row_type, col_type, row_data, col_data);
780  }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:508
virtual MoFEMErrorCode assemble(EntData &data)
const VectorInt & getIndices() const
Get global indices of dofs on entity.
MatrixDouble K
local tangent matrix
#define CHKERR
Inline error check.
Definition: definitions.h:596
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407
virtual MoFEMErrorCode integrate(EntData &data)

◆ integrate() [1/3]

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

Reimplemented in EshelbianPlasticity::OpSpatialSchurEnd, EshelbianPlasticity::OpSpatialPreconditionMass, EshelbianPlasticity::OpSpatialSchurBegin, EshelbianPlasticity::OpSpatialPrj, EshelbianPlasticity::OpRotationBc, EshelbianPlasticity::OpDispBc, EshelbianPlasticity::OpSpatialConsistencyDivTerm, EshelbianPlasticity::OpSpatialConsistencyBubble, EshelbianPlasticity::OpSpatialConsistencyP, EshelbianPlasticity::OpSpatialPhysical, EshelbianPlasticity::OpSpatialRotation, and EshelbianPlasticity::OpSpatialEquilibrium.

Definition at line 670 of file EshelbianPlasticity.hpp.

670  {
672  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "Not yet implemented");
674  }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407

◆ integrate() [2/3]

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

Definition at line 676 of file EshelbianPlasticity.hpp.

677  {
679  CHKERR integrate(data);
681  }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
#define CHKERR
Inline error check.
Definition: definitions.h:596
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407
virtual MoFEMErrorCode integrate(EntData &data)

◆ integrate() [3/3]

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

Reimplemented in EshelbianPlasticity::OpSpatialPrj_dx_dw, EshelbianPlasticity::OpSpatialPrj_dx_dx, EshelbianPlasticity::OpSpatialConsistency_dBubble_dx, EshelbianPlasticity::OpSpatialConsistency_dP_dx, EshelbianPlasticity::OpSpatialConsistency_dBubble_domega, EshelbianPlasticity::OpSpatialConsistency_dP_domega, EshelbianPlasticity::OpSpatialRotation_domega_dx, EshelbianPlasticity::OpSpatialRotation_domega_du, EshelbianPlasticity::OpSpatialRotation_domega_domega, EshelbianPlasticity::OpSpatialRotation_domega_dBubble, EshelbianPlasticity::OpSpatialRotation_domega_dP, EshelbianPlasticity::OpSpatialPhysical_du_dx, EshelbianPlasticity::OpSpatialPhysical_du_domega, EshelbianPlasticity::OpSpatialPhysical_du_dBubble, EshelbianPlasticity::OpSpatialPhysical_du_dP, EshelbianPlasticity::OpSpatialPhysical_du_du, EshelbianPlasticity::OpSpatialEquilibrium_dw_dP, EshelbianPlasticity::OpRotationBc_dx, and EshelbianPlasticity::OpDispBc_dx.

Definition at line 700 of file EshelbianPlasticity.hpp.

700  {
702  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "Not yet implemented");
704  }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407

Member Data Documentation

◆ assembleSymmetry

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

Definition at line 650 of file EshelbianPlasticity.hpp.

◆ dataAtPts

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

data at integration pts

Definition at line 653 of file EshelbianPlasticity.hpp.

◆ K

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

local tangent matrix

Definition at line 667 of file EshelbianPlasticity.hpp.

◆ nF

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

local right hand side vector

Definition at line 666 of file EshelbianPlasticity.hpp.

◆ transposeK

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

Definition at line 668 of file EshelbianPlasticity.hpp.


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