v0.9.1
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 574 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 581 of file EshelbianPlasticity.hpp.

584  : 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 586 of file EshelbianPlasticity.hpp.

589  : T(row_field, col_field, type, false), dataAtPts(data_ptr),
590  assembleSymmetry(assemble_symmetry) {}
const double T
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 609 of file EshelbianPlasticity.hpp.

609  {
611  double *vec_ptr = &*nF.begin();
612  int nb_dofs = data.getIndices().size();
613  int *ind_ptr = &*data.getIndices().begin();
614  CHKERR VecSetValues(T::getFEMethod()->ts_F, nb_dofs, ind_ptr, vec_ptr,
615  ADD_VALUES);
617  }
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:482
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:601
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:412

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

620  {
622  CHKERR assemble(data);
624  }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:482
virtual MoFEMErrorCode assemble(EntData &data)
#define CHKERR
Inline error check.
Definition: definitions.h:601
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:412

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

634  {
636 
637  auto &bmc = dataAtPts->blockMatContainor;
638  int *row_ind_ptr = &*row_data.getIndices().begin();
639  int *col_ind_ptr = &*col_data.getIndices().begin();
640  int row_nb_dofs = row_data.getIndices().size();
641  int col_nb_dofs = col_data.getIndices().size();
642 
643  auto add_block = [&](auto &row_name, auto &col_name, auto row_side,
644  auto col_side, auto row_type, auto col_type,
645  const auto &m, const auto &row_ind,
646  const auto &col_ind) {
647  auto it = bmc.get<0>().find(boost::make_tuple(
648  row_name, col_name, row_type, col_type, row_side, col_side));
649  if (it != bmc.get<0>().end()) {
650  it->setMat(m);
651  it->setInd(row_ind, col_ind);
652  it->setSetAtElement();
653  } else
654  bmc.insert(DataAtIntegrationPts::BlockMatData(
655  row_name, col_name, row_type, col_type, row_side, col_side, m,
656  row_ind, col_ind));
657  };
658 
659  add_block(this->rowFieldName, this->colFieldName, row_side, col_side,
660  row_type, col_type, K, row_data.getIndices(),
661  col_data.getIndices());
662  if (assembleSymmetry) {
663  transposeK.resize(col_nb_dofs, row_nb_dofs, false);
664  noalias(transposeK) = trans(K);
665  add_block(this->colFieldName, this->rowFieldName, col_side, row_side,
666  col_type, row_type, transposeK, col_data.getIndices(),
667  row_data.getIndices());
668  }
669 
670  double *mat_ptr = &*K.data().begin();
671  CHKERR MatSetValues(T::getFEMethod()->ts_B, row_nb_dofs, row_ind_ptr,
672  col_nb_dofs, col_ind_ptr, mat_ptr, ADD_VALUES);
673  if (assembleSymmetry) {
674  double *mat_ptr = &*transposeK.data().begin();
675  CHKERR MatSetValues(T::getFEMethod()->ts_B, col_nb_dofs, col_ind_ptr,
676  row_nb_dofs, row_ind_ptr, mat_ptr, ADD_VALUES);
677  }
678 
680  }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:482
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
FTensor::Index< 'm', 2 > m
Definition: PlasticOps.hpp:67
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:601
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:412

◆ doWork() [1/2]

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

Definition at line 682 of file EshelbianPlasticity.hpp.

682  {
684  if (data.getIndices().empty())
686  nF.resize(data.getIndices().size(), false);
687  nF.clear();
688  CHKERR integrate(side, type, data);
689  CHKERR assemble(side, type, data);
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:482
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:513
virtual MoFEMErrorCode assemble(EntData &data)
const VectorInt & getIndices() const
Get global indices of dofs on entity.
#define CHKERR
Inline error check.
Definition: definitions.h:601
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:412
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 693 of file EshelbianPlasticity.hpp.

695  {
697  if (row_data.getIndices().empty())
699  if (col_data.getIndices().empty())
701  K.resize(row_data.getIndices().size(), col_data.getIndices().size(), false);
702  K.clear();
703  CHKERR integrate(row_data, col_data);
704  CHKERR assemble(row_side, col_side, row_type, col_type, row_data, col_data);
706  }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:482
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:513
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:601
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:412
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 596 of file EshelbianPlasticity.hpp.

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

◆ integrate() [2/3]

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

Definition at line 602 of file EshelbianPlasticity.hpp.

603  {
605  CHKERR integrate(data);
607  }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:482
#define CHKERR
Inline error check.
Definition: definitions.h:601
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:412
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_dw, EshelbianPlasticity::OpSpatialEquilibrium_dw_dP, EshelbianPlasticity::OpRotationBc_dx, and EshelbianPlasticity::OpDispBc_dx.

Definition at line 626 of file EshelbianPlasticity.hpp.

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

Member Data Documentation

◆ assembleSymmetry

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

Definition at line 576 of file EshelbianPlasticity.hpp.

◆ dataAtPts

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

data at integration pts

Definition at line 579 of file EshelbianPlasticity.hpp.

◆ K

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

local tangent matrix

Definition at line 593 of file EshelbianPlasticity.hpp.

◆ nF

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

local right hand side vector

Definition at line 592 of file EshelbianPlasticity.hpp.

◆ transposeK

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

Definition at line 594 of file EshelbianPlasticity.hpp.


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