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

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

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

Public Member Functions

 OpRVEBCsPeriodicRhs (const string field_name, const string lagrang_field_name, vector< Vec > &f, 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

vector< Vec > & F
 
VectorDouble appliedStrain
 
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 597 of file BCs_RVELagrange_Periodic.hpp.

Constructor & Destructor Documentation

◆ OpRVEBCsPeriodicRhs()

BCs_RVELagrange_Periodic::OpRVEBCsPeriodicRhs::OpRVEBCsPeriodicRhs ( const string  field_name,
const string  lagrang_field_name,
vector< Vec > &  f,
RVEBC_Data_Periodic data,
CommonDataPeriodic common_data_periodic,
CommonFunctionsPeriodic common_functions_periodic,
bool  ho_geometry = false 
)
inline

Definition at line 601 of file BCs_RVELagrange_Periodic.hpp.

609  :
610  OpDmatRhs(
611  field_name,lagrang_field_name,data,common_data_periodic,common_functions_periodic,ho_geometry
612  ),
613  F(f) {
614  }

Member Function Documentation

◆ doWork()

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

Definition at line 619 of file BCs_RVELagrange_Periodic.hpp.

619  {
620  PetscFunctionBegin;
621  if(data.getIndices().size()==0) PetscFunctionReturn(0);
622  if(type == MBEDGE && side >= 3) PetscFunctionReturn(0); //ignore second triangel edges (cananical number 6 to 8)
623  if(type == MBTRI && side == 4) PetscFunctionReturn(0); //ignore second triangel face (cananical number 4)
624 
625 
626  ierr = calculateDmat(side,type,data); CHKERRQ(ierr);
627 
628 // if(type == MBVERTEX) {
629 // cout<<"\n\nNew element "<<endl;
630 // }
631 // cout<<"type "<<type << " side "<< side <<endl;
632 // cout<< "commonDataPeriodic.D_mat[0] "<<commonDataPeriodic.D_mat[0]<<endl;
633 // cout<< "commonDataPeriodic.D_mat[1] "<<commonDataPeriodic.D_mat[1]<<endl<<endl;
634 // string aaa;
635 // cin >> aaa;
636 
637 
638  ublas::vector<int> rowvec;
639  if(type == MBVERTEX) {
640  int nb=data.getIndices().size()/2; //for one face
641  rowvec.resize(nb);
642  for(int ii=0; ii<nb; ii++){
643  rowvec[ii]=data.getIndices()[ii];
644  }
645  } else{
646  rowvec=data.getIndices();
647  }
648 
649  appliedStrain.resize(commonDataPeriodic.D_mat[0].size2(),false);
650 
651  int rank = data.getFieldDofs()[0]->getNbOfCoeffs();
652  int size = (rank == 3) ? 6 : 3;
653  for(int ii = 0;ii<size;ii++) {
654  appliedStrain.clear();
655  appliedStrain[ii] = 1.0;
657  ierr = VecSetValues(F[ii],rowvec.size(),&rowvec[0],&nF[0],ADD_VALUES); CHKERRQ(ierr);
659  ierr = VecSetValues(F[ii],rowvec.size(),&rowvec[0],&nF[0],ADD_VALUES); CHKERRQ(ierr);
660  }
661 
662  PetscFunctionReturn(0);
663  }

Member Data Documentation

◆ appliedStrain

VectorDouble BCs_RVELagrange_Periodic::OpRVEBCsPeriodicRhs::appliedStrain

Definition at line 616 of file BCs_RVELagrange_Periodic.hpp.

◆ F

vector<Vec>& BCs_RVELagrange_Periodic::OpRVEBCsPeriodicRhs::F

Definition at line 599 of file BCs_RVELagrange_Periodic.hpp.

◆ nF

VectorDouble BCs_RVELagrange_Periodic::OpRVEBCsPeriodicRhs::nF

Definition at line 617 of file BCs_RVELagrange_Periodic.hpp.


The documentation for this struct was generated from the following file:
BCs_RVELagrange_Periodic::OpRVEBCsPeriodicRhs::F
vector< Vec > & F
Definition: BCs_RVELagrange_Periodic.hpp:599
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:1589
BCs_RVELagrange_Periodic::OpRVEBCsPeriodicRhs::nF
VectorDouble nF
Definition: BCs_RVELagrange_Periodic.hpp:617
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
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
BCs_RVELagrange_Periodic::CommonDataPeriodic::D_mat
ublas::vector< MatrixDouble > D_mat
Definition: BCs_RVELagrange_Periodic.hpp:140
BCs_RVELagrange_Periodic::OpRVEBCsPeriodicRhs::appliedStrain
VectorDouble appliedStrain
Definition: BCs_RVELagrange_Periodic.hpp:616