v0.14.0
Public Member Functions | Public Attributes | List of all members
BCs_RVELagrange_Periodic::OpRVEBCsPeriodicRhs_givenStrain Struct Reference

#include <users_modules/homogenisation/src/BCs_RVELagrange_Periodic.hpp>

Inheritance diagram for BCs_RVELagrange_Periodic::OpRVEBCsPeriodicRhs_givenStrain:
[legend]
Collaboration diagram for BCs_RVELagrange_Periodic::OpRVEBCsPeriodicRhs_givenStrain:
[legend]

Public Member Functions

 OpRVEBCsPeriodicRhs_givenStrain (const string field_name, const string lagrang_field_name, Vec f, VectorDouble given_strain, boost::ptr_vector< MethodForForceScaling > &methods_op, RVEBC_Data_Periodic &data, CommonDataPeriodic &common_data_periodic, CommonFunctionsPeriodic &common_functions_periodic, bool ho_geometry=false)
 
PetscErrorCode doWork (int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
 
- Public Member Functions inherited from BCs_RVELagrange_Periodic::OpDmatRhs
 OpDmatRhs (const string field_name, const string lagrang_field_name, RVEBC_Data_Periodic &data, CommonDataPeriodic &common_data_periodic, CommonFunctionsPeriodic &common_functions_periodic, bool ho_geometry=false)
 
PetscErrorCode calculateDmat (int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
 

Public Attributes

Vec F
 
VectorDouble givenStrain
 
boost::ptr_vector< MethodForForceScaling > & methodsOp
 
VectorDouble nF
 
- Public Attributes inherited from BCs_RVELagrange_Periodic::OpDmatRhs
RVEBC_Data_PeriodicdAta
 
bool hoGeometry
 
CommonDataPeriodiccommonDataPeriodic
 
CommonFunctionsPeriodiccommonFunctionsPeriodic
 
ublas::vector< MatrixDouble > X_mat
 
MatrixDouble N_mat
 

Detailed Description

Definition at line 669 of file BCs_RVELagrange_Periodic.hpp.

Constructor & Destructor Documentation

◆ OpRVEBCsPeriodicRhs_givenStrain()

BCs_RVELagrange_Periodic::OpRVEBCsPeriodicRhs_givenStrain::OpRVEBCsPeriodicRhs_givenStrain ( const string  field_name,
const string  lagrang_field_name,
Vec  f,
VectorDouble  given_strain,
boost::ptr_vector< MethodForForceScaling > &  methods_op,
RVEBC_Data_Periodic data,
CommonDataPeriodic common_data_periodic,
CommonFunctionsPeriodic common_functions_periodic,
bool  ho_geometry = false 
)
inline

Definition at line 675 of file BCs_RVELagrange_Periodic.hpp.

685  :
686  OpDmatRhs(
687  field_name,lagrang_field_name,data,common_data_periodic,common_functions_periodic,ho_geometry
688  ),
689  F(f), givenStrain(given_strain),methodsOp(methods_op){
690  }

Member Function Documentation

◆ doWork()

PetscErrorCode BCs_RVELagrange_Periodic::OpRVEBCsPeriodicRhs_givenStrain::doWork ( int  side,
EntityType  type,
DataForcesAndSourcesCore::EntData data 
)
inline

Definition at line 694 of file BCs_RVELagrange_Periodic.hpp.

694  {
695  PetscFunctionBegin;
696  if(data.getIndices().size()==0) PetscFunctionReturn(0);
697  if(type == MBEDGE && side >= 3) PetscFunctionReturn(0); //ignore second triangel edges (cananical number 6 to 8)
698  if(type == MBTRI && side == 4) PetscFunctionReturn(0); //ignore second triangel face (cananical number 4)
699 
700 
701  ierr = calculateDmat(side,type,data); CHKERRQ(ierr);
702 
703  ublas::vector<int> rowvec;
704  if(type == MBVERTEX) {
705  int nb=data.getIndices().size()/2; //for one face
706  rowvec.resize(nb);
707  for(int ii=0; ii<nb; ii++){
708  rowvec[ii]=data.getIndices()[ii];
709  }
710  } else{
711  rowvec=data.getIndices();
712  }
713 
714  //This is to scale givenStrain vector to apply the strian in steps
715  VectorDouble scaled_given_strain;
716  scaled_given_strain.resize(6);
717  scaled_given_strain=givenStrain;
718 // cout <<"givenStrain Before = "<<scaled_given_strain<<endl;
719  ierr = MethodForForceScaling::applyScale(getFEMethod(),methodsOp,scaled_given_strain); CHKERRQ(ierr);
720 // cout <<"givenStrain After = "<<scaled_given_strain<<endl;
721 
722 // SNES snes = getFEMethod()->snes;
723 // int iter;
724 // SNESGetIterationNumber(snes,&iter);
725 // if(iter>0) PetscFunctionReturn(0);
726 
727  nF = prod(commonDataPeriodic.D_mat[0], scaled_given_strain);
728  nF*=-1;
729  ierr = VecSetValues(F,rowvec.size(),&rowvec[0],&nF[0],ADD_VALUES); CHKERRQ(ierr);
730 
731  nF = prod(commonDataPeriodic.D_mat[1], scaled_given_strain);
732  nF*=-1;
733  ierr = VecSetValues(F,rowvec.size(),&rowvec[0],&nF[0],ADD_VALUES); CHKERRQ(ierr);
734 
735  PetscFunctionReturn(0);
736  }

Member Data Documentation

◆ F

Vec BCs_RVELagrange_Periodic::OpRVEBCsPeriodicRhs_givenStrain::F

Definition at line 671 of file BCs_RVELagrange_Periodic.hpp.

◆ givenStrain

VectorDouble BCs_RVELagrange_Periodic::OpRVEBCsPeriodicRhs_givenStrain::givenStrain

Definition at line 672 of file BCs_RVELagrange_Periodic.hpp.

◆ methodsOp

boost::ptr_vector<MethodForForceScaling>& BCs_RVELagrange_Periodic::OpRVEBCsPeriodicRhs_givenStrain::methodsOp

Definition at line 673 of file BCs_RVELagrange_Periodic.hpp.

◆ nF

VectorDouble BCs_RVELagrange_Periodic::OpRVEBCsPeriodicRhs_givenStrain::nF

Definition at line 692 of file BCs_RVELagrange_Periodic.hpp.


The documentation for this struct was generated from the following file:
BCs_RVELagrange_Periodic::OpDmatRhs::OpDmatRhs
OpDmatRhs(const string field_name, const string lagrang_field_name, RVEBC_Data_Periodic &data, CommonDataPeriodic &common_data_periodic, CommonFunctionsPeriodic &common_functions_periodic, bool ho_geometry=false)
Definition: BCs_RVELagrange_Periodic.hpp:500
BCs_RVELagrange_Periodic::OpDmatRhs::commonDataPeriodic
CommonDataPeriodic & commonDataPeriodic
Definition: BCs_RVELagrange_Periodic.hpp:497
MoFEM::VecSetValues
MoFEMErrorCode VecSetValues(Vec V, const EntitiesFieldData::EntData &data, const double *ptr, InsertMode iora)
Assemble PETSc vector.
Definition: EntitiesFieldData.hpp:1576
BCs_RVELagrange_Periodic::OpRVEBCsPeriodicRhs_givenStrain::methodsOp
boost::ptr_vector< MethodForForceScaling > & methodsOp
Definition: BCs_RVELagrange_Periodic.hpp:673
BCs_RVELagrange_Periodic::OpDmatRhs::calculateDmat
PetscErrorCode calculateDmat(int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
Definition: BCs_RVELagrange_Periodic.hpp:520
convert.type
type
Definition: convert.py:64
BCs_RVELagrange_Periodic::OpRVEBCsPeriodicRhs_givenStrain::F
Vec F
Definition: BCs_RVELagrange_Periodic.hpp:671
BCs_RVELagrange_Periodic::OpRVEBCsPeriodicRhs_givenStrain::givenStrain
VectorDouble givenStrain
Definition: BCs_RVELagrange_Periodic.hpp:672
field_name
constexpr auto field_name
Definition: poisson_2d_homogeneous.cpp:13
HenckyOps::f
auto f
Definition: HenckyOps.hpp:15
MoFEM::Exceptions::ierr
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Exceptions.hpp:76
MoFEM::Types::VectorDouble
UBlasVector< double > VectorDouble
Definition: Types.hpp:68
BCs_RVELagrange_Periodic::OpRVEBCsPeriodicRhs_givenStrain::nF
VectorDouble nF
Definition: BCs_RVELagrange_Periodic.hpp:692
BCs_RVELagrange_Periodic::CommonDataPeriodic::D_mat
ublas::vector< MatrixDouble > D_mat
Definition: BCs_RVELagrange_Periodic.hpp:140
MethodForForceScaling::applyScale
static MoFEMErrorCode applyScale(const FEMethod *fe, boost::ptr_vector< MethodForForceScaling > &methods_op, VectorDouble &nf)
Definition: MethodForForceScaling.hpp:21