v0.14.0
Public Member Functions | Public Attributes | List of all members
GelModule::Gel::OpJacobian Struct Reference

#include <users_modules/gels/src/Gels.hpp>

Inheritance diagram for GelModule::Gel::OpJacobian:
[legend]
Collaboration diagram for GelModule::Gel::OpJacobian:
[legend]

Public Member Functions

 OpJacobian (const string field_name, vector< int > tags, boost::shared_ptr< Gel::ConstitutiveEquation< adouble > > ce, CommonData &common_data, bool calculate_residual, bool calculate_jacobian)
 
PetscErrorCode recordStressTotal ()
 
PetscErrorCode recordSolventFlux ()
 
PetscErrorCode recordSolventConcentrationDot ()
 
PetscErrorCode recordResidualStrainHat ()
 
PetscErrorCode calculateFunction (TagEvaluate te, double *ptr)
 
PetscErrorCode calculateJacobian (TagEvaluate te)
 
PetscErrorCode calculateAtIntPtsStressTotal ()
 
PetscErrorCode calculateAtIntPtsSolventFlux ()
 
PetscErrorCode calculateAtIntPtsSolventDot ()
 
PetscErrorCode calculateAtIntPtrsResidualStrainHat ()
 
PetscErrorCode doWork (int row_side, EntityType row_type, DataForcesAndSurcesCore::EntData &row_data)
 
- Public Member Functions inherited from MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator
int getNumNodes ()
 get element number of nodes More...
 
const EntityHandlegetConn ()
 get element connectivity More...
 
double getVolume () const
 element volume (linear geometry) More...
 
doublegetVolume ()
 element volume (linear geometry) More...
 
FTensor::Tensor2< double *, 3, 3 > & getJac ()
 get element Jacobian More...
 
FTensor::Tensor2< double *, 3, 3 > & getInvJac ()
 get element inverse Jacobian More...
 
VectorDoublegetCoords ()
 nodal coordinates More...
 
VolumeElementForcesAndSourcesCoregetVolumeFE () const
 return pointer to Generic Volume Finite Element object More...
 
- Public Member Functions inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
 UserDataOperator (const FieldSpace space, const char type=OPSPACE, const bool symm=true)
 
 UserDataOperator (const std::string field_name, const char type, const bool symm=true)
 
 UserDataOperator (const std::string row_field_name, const std::string col_field_name, const char type, const bool symm=true)
 
boost::shared_ptr< const NumeredEntFiniteElementgetNumeredEntFiniteElementPtr () const
 Return raw pointer to NumeredEntFiniteElement. More...
 
EntityHandle getFEEntityHandle () const
 Return finite element entity handle. More...
 
int getFEDim () const
 Get dimension of finite element. More...
 
EntityType getFEType () const
 Get dimension of finite element. More...
 
boost::weak_ptr< SideNumbergetSideNumberPtr (const int side_number, const EntityType type)
 Get the side number pointer. More...
 
EntityHandle getSideEntity (const int side_number, const EntityType type)
 Get the side entity. More...
 
int getNumberOfNodesOnElement () const
 Get the number of nodes on finite element. More...
 
MoFEMErrorCode getProblemRowIndices (const std::string filed_name, const EntityType type, const int side, VectorInt &indices) const
 Get row indices. More...
 
MoFEMErrorCode getProblemColIndices (const std::string filed_name, const EntityType type, const int side, VectorInt &indices) const
 Get col indices. More...
 
const FEMethodgetFEMethod () const
 Return raw pointer to Finite Element Method object. More...
 
int getOpType () const
 Get operator types. More...
 
void setOpType (const OpType type)
 Set operator type. More...
 
void addOpType (const OpType type)
 Add operator type. More...
 
int getNinTheLoop () const
 get number of finite element in the loop More...
 
int getLoopSize () const
 get size of elements in the loop More...
 
std::string getFEName () const
 Get name of the element. More...
 
ForcesAndSourcesCoregetPtrFE () const
 
ForcesAndSourcesCoregetSidePtrFE () const
 
ForcesAndSourcesCoregetRefinePtrFE () const
 
const PetscData::SwitchesgetDataCtx () const
 
const KspMethod::KSPContext getKSPCtx () const
 
const SnesMethod::SNESContext getSNESCtx () const
 
const TSMethod::TSContext getTSCtx () const
 
Vec getKSPf () const
 
Mat getKSPA () const
 
Mat getKSPB () const
 
Vec getSNESf () const
 
Vec getSNESx () const
 
Mat getSNESA () const
 
Mat getSNESB () const
 
Vec getTSu () const
 
Vec getTSu_t () const
 
Vec getTSu_tt () const
 
Vec getTSf () const
 
Mat getTSA () const
 
Mat getTSB () const
 
int getTSstep () const
 
double getTStime () const
 
double getTStimeStep () const
 
double getTSa () const
 
double getTSaa () const
 
MatrixDoublegetGaussPts ()
 matrix of integration (Gauss) points for Volume Element More...
 
auto getFTensor0IntegrationWeight ()
 Get integration weights. More...
 
MatrixDoublegetCoordsAtGaussPts ()
 Gauss points and weight, matrix (nb. of points x 3) More...
 
auto getFTensor1CoordsAtGaussPts ()
 Get coordinates at integration points assuming linear geometry. More...
 
double getMeasure () const
 get measure of element More...
 
doublegetMeasure ()
 get measure of element More...
 
MoFEMErrorCode loopSide (const string &fe_name, ForcesAndSourcesCore *side_fe, const size_t dim, const EntityHandle ent_for_side=0, const int verb=QUIET, const LogManager::SeverityLevel sev=Sev::noisy, AdjCache *adj_cache=nullptr)
 User calls this function to loop over elements on the side of face. This function calls finite element with its operator to do calculations. More...
 
MoFEMErrorCode loopThis (const string &fe_name, ForcesAndSourcesCore *this_fe, const int verb=QUIET, const LogManager::SeverityLevel sev=Sev::noisy)
 User calls this function to loop over the same element using a different set of integration points. This function calls finite element with its operator to do calculations. More...
 
MoFEMErrorCode loopParent (const string &fe_name, ForcesAndSourcesCore *parent_fe, const int verb=QUIET, const LogManager::SeverityLevel sev=Sev::noisy)
 User calls this function to loop over parent elements. This function calls finite element with its operator to do calculations. More...
 
MoFEMErrorCode loopChildren (const string &fe_name, ForcesAndSourcesCore *child_fe, const int verb=QUIET, const LogManager::SeverityLevel sev=Sev::noisy)
 User calls this function to loop over parent elements. This function calls finite element with its operator to do calculations. More...
 
- Public Member Functions inherited from MoFEM::DataOperator
 DataOperator (const bool symm=true)
 
virtual ~DataOperator ()=default
 
virtual MoFEMErrorCode doWork (int row_side, int col_side, EntityType row_type, EntityType col_type, EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
 Operator for bi-linear form, usually to calculate values on left hand side. More...
 
virtual MoFEMErrorCode opLhs (EntitiesFieldData &row_data, EntitiesFieldData &col_data)
 
virtual MoFEMErrorCode doWork (int side, EntityType type, EntitiesFieldData::EntData &data)
 Operator for linear form, usually to calculate values on right hand side. More...
 
virtual MoFEMErrorCode opRhs (EntitiesFieldData &data, const bool error_if_no_base=false)
 
bool getSymm () const
 Get if operator uses symmetry of DOFs or not. More...
 
void setSymm ()
 set if operator is executed taking in account symmetry More...
 
void unSetSymm ()
 unset if operator is executed for non symmetric problem More...
 

Public Attributes

vector< int > tagS
 
boost::shared_ptr< Gel::ConstitutiveEquation< adouble > > cE
 
CommonDatacommonData
 
bool calculateResidualBool
 
bool calculateJacobianBool
 
boolrecordOn
 
map< int, int > & nbActiveVariables
 
map< int, int > & nbActiveResults
 
int nbGaussPts
 
VectorDouble activeVariables
 
- Public Attributes inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
char opType
 
std::string rowFieldName
 
std::string colFieldName
 
FieldSpace sPace
 
- Public Attributes inherited from MoFEM::DataOperator
DoWorkLhsHookFunType doWorkLhsHook
 
DoWorkRhsHookFunType doWorkRhsHook
 
bool sYmm
 If true assume that matrix is symmetric structure. More...
 
std::array< bool, MBMAXTYPE > doEntities
 If true operator is executed for entity. More...
 
booldoVertices
 \deprectaed If false skip vertices More...
 
booldoEdges
 \deprectaed If false skip edges More...
 
booldoQuads
 \deprectaed More...
 
booldoTris
 \deprectaed More...
 
booldoTets
 \deprectaed More...
 
booldoPrisms
 \deprectaed More...
 

Additional Inherited Members

- Public Types inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
enum  OpType {
  OPROW = 1 << 0, OPCOL = 1 << 1, OPROWCOL = 1 << 2, OPSPACE = 1 << 3,
  OPLAST = 1 << 3
}
 Controls loop over entities on element. More...
 
using AdjCache = std::map< EntityHandle, std::vector< boost::weak_ptr< NumeredEntFiniteElement > >>
 
- Public Types inherited from MoFEM::DataOperator
using DoWorkLhsHookFunType = boost::function< MoFEMErrorCode(DataOperator *op_ptr, int row_side, int col_side, EntityType row_type, EntityType col_type, EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)>
 
using DoWorkRhsHookFunType = boost::function< MoFEMErrorCode(DataOperator *op_ptr, int side, EntityType type, EntitiesFieldData::EntData &data)>
 
- Static Public Attributes inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
static const char *const OpTypeNames []
 
- Protected Member Functions inherited from MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator
MoFEMErrorCode setPtrFE (ForcesAndSourcesCore *ptr)
 
- Protected Attributes inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
ForcesAndSourcesCoreptrFE
 

Detailed Description

Definition at line 541 of file Gels.hpp.

Constructor & Destructor Documentation

◆ OpJacobian()

GelModule::Gel::OpJacobian::OpJacobian ( const string  field_name,
vector< int >  tags,
boost::shared_ptr< Gel::ConstitutiveEquation< adouble > >  ce,
CommonData common_data,
bool  calculate_residual,
bool  calculate_jacobian 
)
inline

Definition at line 553 of file Gels.hpp.

560  :
563  ),
564  tagS(tags),
565  cE(ce),
566  commonData(common_data),
567  calculateResidualBool(calculate_residual),
568  calculateJacobianBool(calculate_jacobian),
569  recordOn(common_data.recordOn),
570  nbActiveVariables(common_data.nbActiveVariables),
571  nbActiveResults(common_data.nbActiveResults) {
572  }

Member Function Documentation

◆ calculateAtIntPtrsResidualStrainHat()

PetscErrorCode GelModule::Gel::OpJacobian::calculateAtIntPtrsResidualStrainHat ( )
inline

Definition at line 1006 of file Gels.hpp.

1006  {
1007  PetscFunctionBegin;
1008 
1009  try {
1010  if(tagS[RESIDUALSTRAINHAT]<0) {
1011  PetscFunctionReturn(0);
1012  }
1013 
1015  for(int gg = 0;gg<nbGaussPts;gg++) {
1019  int nb_active_variables = 0;
1020  // Activate gradient of defamation
1021  for(int dd1 = 0;dd1<3;dd1++) {
1022  for(int dd2 = 0;dd2<3;dd2++) {
1023  activeVariables[nb_active_variables++] = F(dd1,dd2);
1024  }
1025  }
1026  // Using vector notation to store hatStrain
1027  // xx,yy,zz,2xy,2yz,2zy
1028  for(int ii = 0;ii<6;ii++) {
1029  activeVariables[nb_active_variables++] = strain_hat[ii];
1030  }
1031  // Using vector notation to store hatStrainDot
1032  for(int ii = 0;ii<6;ii++) {
1033  activeVariables[nb_active_variables++] = strain_hat_dot[ii];
1034  }
1035  if(nb_active_variables!=nbActiveVariables[tagS[RESIDUALSTRAINHAT]]) {
1036  SETERRQ(
1037  PETSC_COMM_SELF,MOFEM_IMPOSIBLE_CASE,"Number of active variables does not much"
1038  );
1039  }
1040  if(calculateResidualBool) {
1041  if(gg == 0) {
1043  }
1044  commonData.residualStrainHat[gg].resize(6,false);
1047  ); CHKERRQ(ierr);
1048  }
1049  if(calculateJacobianBool) {
1050  if(gg == 0) {
1053  }
1054  commonData.jacStrainHat[gg].resize(
1057  false
1058  );
1059  for(int dd = 0;dd<nbActiveResults[tagS[RESIDUALSTRAINHAT]];dd++) {
1061  }
1063  }
1064  }
1065 
1066 
1067  } catch (const std::exception& ex) {
1068  ostringstream ss;
1069  ss << "throw in method: " << ex.what() << endl;
1070  SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
1071  }
1072 
1073  PetscFunctionReturn(0);
1074  }

◆ calculateAtIntPtsSolventDot()

PetscErrorCode GelModule::Gel::OpJacobian::calculateAtIntPtsSolventDot ( )
inline

Definition at line 958 of file Gels.hpp.

958  {
959  PetscFunctionBegin;
960 
961  if(tagS[SOLVENTRATE]<0) {
962  PetscFunctionReturn(0);
963  }
964 
965 
966 
968 
969  for(int gg = 0;gg<nbGaussPts;gg++) {
972  int nb_active_variables = 0;
973  // Activate gradient of defamation
974  for(int dd1 = 0;dd1<3;dd1++) {
975  for(int dd2 = 0;dd2<3;dd2++) {
976  activeVariables[nb_active_variables++] = F(dd1,dd2);
977  }
978  }
979  for(int dd1 = 0;dd1<3;dd1++) {
980  for(int dd2 = 0;dd2<3;dd2++) {
981  activeVariables[nb_active_variables++] = F_dot(dd1,dd2);
982  }
983  }
984  if(nb_active_variables!=nbActiveVariables[tagS[SOLVENTRATE]]) {
985  SETERRQ(
986  PETSC_COMM_SELF,MOFEM_IMPOSIBLE_CASE,"Number of active variables does not much"
987  );
988  }
991  }
993  if(gg == 0) {
996  }
999  ierr = calculateJacobian(SOLVENTRATE); CHKERRQ(ierr);
1000  }
1001  }
1002 
1003  PetscFunctionReturn(0);
1004  }

◆ calculateAtIntPtsSolventFlux()

PetscErrorCode GelModule::Gel::OpJacobian::calculateAtIntPtsSolventFlux ( )
inline

Definition at line 908 of file Gels.hpp.

908  {
909  PetscFunctionBegin;
910 
911  if(tagS[SOLVENTFLUX]<0) {
912  PetscFunctionReturn(0);
913  }
914 
915 
916 
918 
919  for(int gg = 0;gg<nbGaussPts;gg++) {
921  int nb_active_variables = 0;
922  // Activate rate of gradient of defamation
923  for(int ii = 0;ii<3;ii++) {
924  activeVariables[nb_active_variables++] = gradient_mu(0,ii);
925  }
926  if(nb_active_variables!=nbActiveVariables[tagS[SOLVENTFLUX]]) {
927  SETERRQ(
928  PETSC_COMM_SELF,MOFEM_IMPOSIBLE_CASE,"Number of active variables does not much"
929  );
930  }
932  commonData.solventFlux[gg].resize(3,false);
934  SOLVENTFLUX,
935  &(commonData.solventFlux[gg][0])
936  ); CHKERRQ(ierr);
937  }
939  if(gg == 0) {
942  }
943  commonData.jacSolventFlux[gg].resize(
946  false
947  );
948  for(int dd = 0;dd<nbActiveResults[tagS[SOLVENTFLUX]];dd++) {
950  }
951  ierr = calculateJacobian(SOLVENTFLUX); CHKERRQ(ierr);
952  }
953  }
954 
955  PetscFunctionReturn(0);
956  }

◆ calculateAtIntPtsStressTotal()

PetscErrorCode GelModule::Gel::OpJacobian::calculateAtIntPtsStressTotal ( )
inline

Definition at line 833 of file Gels.hpp.

833  {
834  PetscFunctionBegin;
835 
836  try {
837 
838  if(tagS[STRESSTOTAL]<0) {
839  PetscFunctionReturn(0);
840  }
841 
842 
843 
845 
846  for(int gg = 0;gg<nbGaussPts;gg++) {
847 
850  double mu = (commonData.dataAtGaussPts[commonData.muName])[gg][0];
851  int nb_active_variables = 0;
852  // Activate gradient of defamation
853  for(int dd1 = 0;dd1<3;dd1++) {
854  for(int dd2 = 0;dd2<3;dd2++) {
855  activeVariables[nb_active_variables++] = F(dd1,dd2);
856  }
857  }
858  // Using vector notation to store hatStrain
859  // xx,yy,zz,2xy,2yz,2zy
860  for(int ii = 0;ii<6;ii++) {
861  activeVariables[nb_active_variables++] = strain_hat[ii];
862  }
863  // chemical load
864  activeVariables[nb_active_variables++] = mu;
865 
866  if(nb_active_variables!=nbActiveVariables[tagS[STRESSTOTAL]]) {
867  SETERRQ(
868  PETSC_COMM_SELF,MOFEM_IMPOSIBLE_CASE,
869  "Number of active variables does not much"
870  );
871  }
872 
874  if(gg == 0) {
876  }
877  commonData.stressTotal[gg].resize(3,3,false);
879  }
880 
882  if(gg == 0) {
885  }
886  commonData.jacStressTotal[gg].resize(
889  false
890  );
891  for(int dd = 0;dd<nbActiveResults[tagS[STRESSTOTAL]];dd++) {
893  }
894  ierr = calculateJacobian(STRESSTOTAL); CHKERRQ(ierr);
895  }
896 
897  }
898 
899  } catch (const std::exception& ex) {
900  ostringstream ss;
901  ss << "throw in method: " << ex.what() << endl;
902  SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
903  }
904 
905  PetscFunctionReturn(0);
906  }

◆ calculateFunction()

PetscErrorCode GelModule::Gel::OpJacobian::calculateFunction ( TagEvaluate  te,
double ptr 
)
inline

Definition at line 786 of file Gels.hpp.

786  {
787  PetscFunctionBegin;
788 
789  int r;
790  //play recorder for values
791  r = ::function(
792  tagS[te],
793  nbActiveResults[tagS[te]],
794  nbActiveVariables[tagS[te]],
795  &activeVariables[0],
796  ptr
797  );
798  if(r<3) { // function is locally analytic
799  SETERRQ1(
800  PETSC_COMM_SELF,MOFEM_OPERATION_UNSUCCESSFUL,
801  "ADOL-C function evaluation with error r = %d",r
802  );
803  }
804 
805  PetscFunctionReturn(0);
806  }

◆ calculateJacobian()

PetscErrorCode GelModule::Gel::OpJacobian::calculateJacobian ( TagEvaluate  te)
inline

Definition at line 808 of file Gels.hpp.

808  {
809  PetscFunctionBegin;
810  try {
811  int r;
812  r = jacobian(
813  tagS[te],
814  nbActiveResults[tagS[te]],
815  nbActiveVariables[tagS[te]],
816  &activeVariables[0],
817  &(commonData.jacRowPtr[0])
818  );
819  if(r<3) {
820  SETERRQ(
821  PETSC_COMM_SELF,MOFEM_OPERATION_UNSUCCESSFUL,
822  "ADOL-C function evaluation with error"
823  );
824  }
825  } catch (const std::exception& ex) {
826  ostringstream ss;
827  ss << "throw in method: " << ex.what() << endl;
828  SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
829  }
830  PetscFunctionReturn(0);
831  }

◆ doWork()

PetscErrorCode GelModule::Gel::OpJacobian::doWork ( int  row_side,
EntityType  row_type,
DataForcesAndSurcesCore::EntData row_data 
)
inline

Definition at line 1076 of file Gels.hpp.

1078  {
1079  PetscFunctionBegin;
1080 
1081 
1082 
1083  if(row_type != MBVERTEX) PetscFunctionReturn(0);
1084  nbGaussPts = row_data.getN().size1();
1085 
1086  Tag th_block_id;
1087  EntityHandle ent = getNumeredEntFiniteElementPtr()->getEnt();
1088  rval = getVolumeFE()->
1089  mField.get_moab().tag_get_handle("BLOCK_ID",th_block_id); CHKERRQ_MOAB(rval);
1090  rval = getVolumeFE()->
1091  mField.get_moab().tag_get_data(th_block_id,&ent,1,&(cE->iD)); CHKERRQ_MOAB(rval);
1092 
1093  try {
1094 
1095  if(recordOn) {
1096  ierr = recordStressTotal(); CHKERRQ(ierr);
1097  ierr = recordSolventFlux(); CHKERRQ(ierr);
1098  ierr = recordSolventConcentrationDot(); CHKERRQ(ierr);
1099  ierr = recordResidualStrainHat(); CHKERRQ(ierr);
1100  }
1101 
1102  ierr = calculateAtIntPtsStressTotal(); CHKERRQ(ierr);
1103  ierr = calculateAtIntPtsSolventFlux(); CHKERRQ(ierr);
1104  ierr = calculateAtIntPtsSolventDot(); CHKERRQ(ierr);
1106 
1107  } catch (const std::exception& ex) {
1108  ostringstream ss;
1109  ss << "throw in method: " << ex.what() << endl;
1110  SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
1111  }
1112 
1113  PetscFunctionReturn(0);
1114  }

◆ recordResidualStrainHat()

PetscErrorCode GelModule::Gel::OpJacobian::recordResidualStrainHat ( )
inline

Definition at line 719 of file Gels.hpp.

719  {
720  PetscFunctionBegin;
721 
722  if(tagS[RESIDUALSTRAINHAT]<0) {
723  PetscFunctionReturn(0);
724  }
725 
726 
727 
728  cE->F.resize(3,3,false);
729  cE->strainHat.resize(3,3,false);
730  cE->strainHatDot.resize(3,3,false);
734  trace_on(tagS[RESIDUALSTRAINHAT]);
735  {
736  // Activate gradient of defamation
738  for(int dd1 = 0;dd1<3;dd1++) {
739  for(int dd2 = 0;dd2<3;dd2++) {
740  cE->F(dd1,dd2) <<= F(dd1,dd2);
742  }
743  }
744  // Using vector notation to store hatStrain
745  // xx,yy,zz,2xy,2yz,2zy
746  cE->strainHat(0,0) <<= strain_hat[0];
747  cE->strainHat(1,1) <<= strain_hat[1];
748  cE->strainHat(2,2) <<= strain_hat[2];
749  cE->strainHat(0,1) <<= strain_hat[3];
750  cE->strainHat(1,2) <<= strain_hat[4];
751  cE->strainHat(0,2) <<= strain_hat[5];
753  cE->strainHat(1,0) = cE->strainHat(0,1);
754  cE->strainHat(2,1) = cE->strainHat(1,2);
755  cE->strainHat(2,0) = cE->strainHat(0,2);
756  // Activate strain hat dot
757  cE->strainHatDot(0,0) <<= strain_hat_dot[0];
758  cE->strainHatDot(1,1) <<= strain_hat_dot[1];
759  cE->strainHatDot(2,2) <<= strain_hat_dot[2];
760  cE->strainHatDot(0,1) <<= strain_hat_dot[3];
761  cE->strainHatDot(1,2) <<= strain_hat_dot[4];
762  cE->strainHatDot(0,2) <<= strain_hat_dot[5];
764  cE->strainHatDot(1,0) = cE->strainHatDot(0,1);
765  cE->strainHatDot(2,1) = cE->strainHatDot(1,2);
766  cE->strainHatDot(2,0) = cE->strainHatDot(0,2);
767  ierr = cE->calculateStrainTotal(); CHKERRQ(ierr);
768  ierr = cE->calculateStressBeta(); CHKERRQ(ierr);
769  ierr = cE->calculateStrainHatFlux(); CHKERRQ(ierr);
770  ierr = cE->calculateResidualStrainHat(); CHKERRQ(ierr);
773  commonData.residualStrainHat[0].resize(6,false);
774  cE->residualStrainHat(0,0) >>= commonData.residualStrainHat[0][nbActiveResults[tagS[RESIDUALSTRAINHAT]]++];
775  cE->residualStrainHat(1,1) >>= commonData.residualStrainHat[0][nbActiveResults[tagS[RESIDUALSTRAINHAT]]++];
776  cE->residualStrainHat(2,2) >>= commonData.residualStrainHat[0][nbActiveResults[tagS[RESIDUALSTRAINHAT]]++];
777  cE->residualStrainHat(0,1) >>= commonData.residualStrainHat[0][nbActiveResults[tagS[RESIDUALSTRAINHAT]]++];
778  cE->residualStrainHat(1,2) >>= commonData.residualStrainHat[0][nbActiveResults[tagS[RESIDUALSTRAINHAT]]++];
779  cE->residualStrainHat(0,2) >>= commonData.residualStrainHat[0][nbActiveResults[tagS[RESIDUALSTRAINHAT]]++];
780  }
781  trace_off();
782 
783  PetscFunctionReturn(0);
784  }

◆ recordSolventConcentrationDot()

PetscErrorCode GelModule::Gel::OpJacobian::recordSolventConcentrationDot ( )
inline

Definition at line 677 of file Gels.hpp.

677  {
678  PetscFunctionBegin;
679 
680  if(tagS[SOLVENTRATE]<0) {
681  PetscFunctionReturn(0);
682  }
683 
684 
685 
688 
689  trace_on(tagS[SOLVENTRATE]);
690  {
691  // Activate rate of gradient of defamation
693  cE->F.resize(3,3,false);
694  for(int dd1 = 0;dd1<3;dd1++) {
695  for(int dd2 = 0;dd2<3;dd2++) {
696  cE->F(dd1,dd2) <<= F(dd1,dd2);
698  }
699  }
700  cE->FDot.resize(3,3,false);
701  for(int dd1 = 0;dd1<3;dd1++) {
702  for(int dd2 = 0;dd2<3;dd2++) {
703  cE->FDot(dd1,dd2) <<= F_dot(dd1,dd2);
705  }
706  }
707  ierr = cE->calculateTraceStrainTotalDot(); CHKERRQ(ierr);
708  ierr = cE->calculateSolventConcentrationDot(); CHKERRQ(ierr);
711  cE->solventConcentrationDot >>= commonData.solventConcentrationDot[0];
713  }
714  trace_off();
715 
716  PetscFunctionReturn(0);
717  }

◆ recordSolventFlux()

PetscErrorCode GelModule::Gel::OpJacobian::recordSolventFlux ( )
inline

Definition at line 641 of file Gels.hpp.

641  {
642  PetscFunctionBegin;
643  try {
644  if(tagS[SOLVENTFLUX]<0) {
645  PetscFunctionReturn(0);
646  }
647 
648  cE->gradientMu.resize(3,false);
650  trace_on(tagS[SOLVENTFLUX]);
651  {
652  // Activate rate of gradient of defamation
654  for(int ii = 0;ii<3;ii++) {
655  cE->gradientMu[ii] <<= gradient_mu(0,ii);
657  }
658  ierr = cE->calculateSolventFlux(); CHKERRQ(ierr);
661  commonData.solventFlux[0].resize(3,false);
662  for(int d1 = 0;d1<3;d1++) {
663  cE->solventFlux[d1] >>= commonData.solventFlux[0][d1];
665  }
666  }
667  trace_off();
668  } catch (const std::exception& ex) {
669  ostringstream ss;
670  ss << "throw in method: " << ex.what() << endl;
671  SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
672  }
673 
674  PetscFunctionReturn(0);
675  }

◆ recordStressTotal()

PetscErrorCode GelModule::Gel::OpJacobian::recordStressTotal ( )
inline

Definition at line 577 of file Gels.hpp.

577  {
578 
579  PetscFunctionBegin;
580 
581  try {
582  if(tagS[STRESSTOTAL]<0) {
583  PetscFunctionReturn(0);
584  }
585  cE->F.resize(3,3,false);
586  cE->strainHat.resize(3,3,false);
590  trace_on(tagS[STRESSTOTAL]);
591  {
592  // Activate gradient of defamation
594  for(int dd1 = 0;dd1<3;dd1++) {
595  for(int dd2 = 0;dd2<3;dd2++) {
596  cE->F(dd1,dd2) <<= F(dd1,dd2);
598  }
599  }
600  // Using vector notation to store hatStrain
601  // xx,yy,zz,2xy,2yz,2zy
602  cE->strainHat(0,0) <<= strain_hat[0];
603  cE->strainHat(1,1) <<= strain_hat[1];
604  cE->strainHat(2,2) <<= strain_hat[2];
605  cE->strainHat(0,1) <<= strain_hat[3];
606  cE->strainHat(1,2) <<= strain_hat[4];
607  cE->strainHat(0,2) <<= strain_hat[5];
609  cE->strainHat(1,0) = cE->strainHat(0,1);
610  cE->strainHat(2,1) = cE->strainHat(1,2);
611  cE->strainHat(2,0) = cE->strainHat(0,2);
612  cE->mU <<= mu[0];
614  // Do calculations
615  ierr = cE->calculateStrainTotal(); CHKERRQ(ierr);
616  ierr = cE->calculateStressAlpha(); CHKERRQ(ierr);
617  ierr = cE->calculateStressBeta(); CHKERRQ(ierr);
618  ierr = cE->calculateStressBetaHat(); CHKERRQ(ierr);
619  // Finally calculate result
620  ierr = cE->calculateStressTotal(); CHKERRQ(ierr);
621  // Results
624  commonData.stressTotal[0].resize(3,3,false);
625  for(int d1 = 0;d1<3;d1++) {
626  for(int d2 = 0;d2<3;d2++) {
627  cE->stressTotal(d1,d2) >>= (commonData.stressTotal[0])(d1,d2);
629  }
630  }
631  }
632  trace_off();
633  } catch (const std::exception& ex) {
634  ostringstream ss;
635  ss << "throw in method: " << ex.what() << endl;
636  SETERRQ(PETSC_COMM_SELF,1,ss.str().c_str());
637  }
638  PetscFunctionReturn(0);
639  }

Member Data Documentation

◆ activeVariables

VectorDouble GelModule::Gel::OpJacobian::activeVariables

Definition at line 575 of file Gels.hpp.

◆ calculateJacobianBool

bool GelModule::Gel::OpJacobian::calculateJacobianBool

Definition at line 548 of file Gels.hpp.

◆ calculateResidualBool

bool GelModule::Gel::OpJacobian::calculateResidualBool

Definition at line 547 of file Gels.hpp.

◆ cE

boost::shared_ptr<Gel::ConstitutiveEquation<adouble> > GelModule::Gel::OpJacobian::cE

Definition at line 544 of file Gels.hpp.

◆ commonData

CommonData& GelModule::Gel::OpJacobian::commonData

Definition at line 545 of file Gels.hpp.

◆ nbActiveResults

map<int,int>& GelModule::Gel::OpJacobian::nbActiveResults

Definition at line 551 of file Gels.hpp.

◆ nbActiveVariables

map<int,int>& GelModule::Gel::OpJacobian::nbActiveVariables

Definition at line 550 of file Gels.hpp.

◆ nbGaussPts

int GelModule::Gel::OpJacobian::nbGaussPts

Definition at line 574 of file Gels.hpp.

◆ recordOn

bool& GelModule::Gel::OpJacobian::recordOn

Definition at line 549 of file Gels.hpp.

◆ tagS

vector<int> GelModule::Gel::OpJacobian::tagS

Definition at line 543 of file Gels.hpp.


The documentation for this struct was generated from the following file:
GelModule::Gel::OpJacobian::tagS
vector< int > tagS
Definition: Gels.hpp:543
GelModule::Gel::SOLVENTFLUX
@ SOLVENTFLUX
Definition: Gels.hpp:78
GelModule::Gel::CommonData::strainHatName
string strainHatName
Definition: Gels.hpp:349
GelModule::Gel::CommonData::strainHatNameDot
string strainHatNameDot
Definition: Gels.hpp:350
GelModule::Gel::OpJacobian::cE
boost::shared_ptr< Gel::ConstitutiveEquation< adouble > > cE
Definition: Gels.hpp:544
EntityHandle
CHKERRQ_MOAB
#define CHKERRQ_MOAB(a)
check error code of MoAB function
Definition: definitions.h:467
GelModule::Gel::OpJacobian::calculateJacobianBool
bool calculateJacobianBool
Definition: Gels.hpp:548
GelModule::Gel::CommonData::spatialPositionName
string spatialPositionName
Definition: Gels.hpp:347
GelModule::Gel::CommonData::jacStrainHat
vector< MatrixDouble > jacStrainHat
Definition: Gels.hpp:366
GelModule::Gel::SOLVENTRATE
@ SOLVENTRATE
Definition: Gels.hpp:79
MoFEM::Types::MatrixDouble
UBlasMatrix< double > MatrixDouble
Definition: Types.hpp:77
GelModule::Gel::CommonData::stressTotal
vector< MatrixDouble3by3 > stressTotal
Definition: Gels.hpp:357
GelModule::Gel::OpJacobian::activeVariables
VectorDouble activeVariables
Definition: Gels.hpp:575
GelModule::Gel::CommonData::gradAtGaussPts
map< string, vector< MatrixDouble > > gradAtGaussPts
Definition: Gels.hpp:355
GelModule::Gel::CommonData::jacSolventDot
vector< VectorDouble > jacSolventDot
Definition: Gels.hpp:365
GelModule::Gel::CommonData::spatialPositionNameDot
string spatialPositionNameDot
Definition: Gels.hpp:348
GelModule::Gel::STRESSTOTAL
@ STRESSTOTAL
Definition: Gels.hpp:77
GelModule::Gel::CommonData::solventConcentrationDot
vector< double > solventConcentrationDot
Definition: Gels.hpp:359
sdf.r
int r
Definition: sdf.py:8
GelModule::Gel::OpJacobian::calculateAtIntPtsSolventFlux
PetscErrorCode calculateAtIntPtsSolventFlux()
Definition: Gels.hpp:908
GelModule::Gel::CommonData::muName
string muName
Definition: Gels.hpp:351
GelModule::Gel::OpJacobian::commonData
CommonData & commonData
Definition: Gels.hpp:545
MoFEM::Exceptions::rval
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
Definition: Exceptions.hpp:74
GelModule::Gel::OpJacobian::recordResidualStrainHat
PetscErrorCode recordResidualStrainHat()
Definition: Gels.hpp:719
GelModule::Gel::OpJacobian::calculateAtIntPtsStressTotal
PetscErrorCode calculateAtIntPtsStressTotal()
Definition: Gels.hpp:833
GelModule::Gel::OpJacobian::calculateResidualBool
bool calculateResidualBool
Definition: Gels.hpp:547
GelModule::Gel::OpJacobian::nbActiveResults
map< int, int > & nbActiveResults
Definition: Gels.hpp:551
MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator
friend class UserDataOperator
Definition: VolumeElementForcesAndSourcesCore.hpp:105
MoFEM::ForcesAndSourcesCore::UserDataOperator::getNumeredEntFiniteElementPtr
boost::shared_ptr< const NumeredEntFiniteElement > getNumeredEntFiniteElementPtr() const
Return raw pointer to NumeredEntFiniteElement.
Definition: ForcesAndSourcesCore.hpp:1000
MOFEM_OPERATION_UNSUCCESSFUL
@ MOFEM_OPERATION_UNSUCCESSFUL
Definition: definitions.h:34
GelModule::Gel::OpJacobian::recordSolventFlux
PetscErrorCode recordSolventFlux()
Definition: Gels.hpp:641
GelModule::Gel::OpJacobian::calculateJacobian
PetscErrorCode calculateJacobian(TagEvaluate te)
Definition: Gels.hpp:808
GelModule::Gel::OpJacobian::calculateAtIntPtrsResidualStrainHat
PetscErrorCode calculateAtIntPtrsResidualStrainHat()
Definition: Gels.hpp:1006
GelModule::Gel::OpJacobian::calculateFunction
PetscErrorCode calculateFunction(TagEvaluate te, double *ptr)
Definition: Gels.hpp:786
GelModule::Gel::CommonData::dataAtGaussPts
map< string, vector< VectorDouble > > dataAtGaussPts
Definition: Gels.hpp:354
GelModule::Gel::CommonData::solventFlux
vector< VectorDouble3 > solventFlux
Definition: Gels.hpp:358
field_name
constexpr auto field_name
Definition: poisson_2d_homogeneous.cpp:13
GelModule::Gel::CommonData::jacSolventFlux
vector< MatrixDouble > jacSolventFlux
Definition: Gels.hpp:364
GelModule::Gel::RESIDUALSTRAINHAT
@ RESIDUALSTRAINHAT
Definition: Gels.hpp:80
GelModule::Gel::OpJacobian::recordStressTotal
PetscErrorCode recordStressTotal()
Definition: Gels.hpp:577
GelModule::Gel::OpJacobian::recordOn
bool & recordOn
Definition: Gels.hpp:549
FTensor::dd
const Tensor2_symmetric_Expr< const ddTensor0< T, Dim, i, j >, typename promote< T, double >::V, Dim, i, j > dd(const Tensor0< T * > &a, const Index< i, Dim > index1, const Index< j, Dim > index2, const Tensor1< int, Dim > &d_ijk, const Tensor1< double, Dim > &d_xyz)
Definition: ddTensor0.hpp:33
GelModule::Gel::CommonData::jacStressTotal
vector< MatrixDouble > jacStressTotal
Definition: Gels.hpp:363
GelModule::Gel::OpJacobian::recordSolventConcentrationDot
PetscErrorCode recordSolventConcentrationDot()
Definition: Gels.hpp:677
MoFEM::Exceptions::ierr
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Exceptions.hpp:76
mu
double mu
Definition: dynamic_first_order_con_law.cpp:98
GelModule::Gel::OpJacobian::calculateAtIntPtsSolventDot
PetscErrorCode calculateAtIntPtsSolventDot()
Definition: Gels.hpp:958
GelModule::Gel::CommonData::residualStrainHat
vector< VectorDouble9 > residualStrainHat
Definition: Gels.hpp:360
MoFEM::Types::VectorDouble
UBlasVector< double > VectorDouble
Definition: Types.hpp:68
GelModule::Gel::CommonData::jacRowPtr
vector< double * > jacRowPtr
Definition: Gels.hpp:362
GelModule::Gel::OpJacobian::nbGaussPts
int nbGaussPts
Definition: Gels.hpp:574
MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator::getVolumeFE
VolumeElementForcesAndSourcesCore * getVolumeFE() const
return pointer to Generic Volume Finite Element object
Definition: VolumeElementForcesAndSourcesCore.hpp:185
GelModule::Gel::OpJacobian::nbActiveVariables
map< int, int > & nbActiveVariables
Definition: Gels.hpp:550
F
@ F
Definition: free_surface.cpp:394
MoFEM::ForcesAndSourcesCore::UserDataOperator::OPROW
@ OPROW
operator doWork function is executed on FE rows
Definition: ForcesAndSourcesCore.hpp:567