v0.9.0
Public Member Functions | Public Attributes | List of all members
MoFEM::HelmholtzElement::OpHelmholtzFlux Struct Reference

operator for calculate Impedance flux and assemble to right hand side \infroup mofem_helmholtz_elem More...

#include <users_modules/helmholtz/src/HelmholtzElementObsolete.hpp>

Inherits UserDataOperator.

Collaboration diagram for MoFEM::HelmholtzElement::OpHelmholtzFlux:
[legend]

Public Member Functions

 OpHelmholtzFlux (const string re_field_name, const string im_field_name, BlockData &DATA, FluxData &data, bool _ho_geometry=false)
 
 OpHelmholtzFlux (const string re_field_name, const string im_field_name, Vec _F, BlockData &DATA, FluxData &data, bool _ho_geometry=false)
 
PetscErrorCode doWork (int side, EntityType type, DataForcesAndSurcesCore::EntData &data)
 calculate Impedance flux More...
 

Public Attributes

BlockDatadatA
 
FluxDatadAta
 
bool ho_geometry
 
bool useTsF
 
Vec F
 
VectorDouble Nf
 

Detailed Description

operator for calculate Impedance flux and assemble to right hand side \infroup mofem_helmholtz_elem

Definition at line 1065 of file HelmholtzElementObsolete.hpp.

Constructor & Destructor Documentation

◆ OpHelmholtzFlux() [1/2]

MoFEM::HelmholtzElement::OpHelmholtzFlux::OpHelmholtzFlux ( const string  re_field_name,
const string  im_field_name,
BlockData DATA,
FluxData data,
bool  _ho_geometry = false 
)

◆ OpHelmholtzFlux() [2/2]

MoFEM::HelmholtzElement::OpHelmholtzFlux::OpHelmholtzFlux ( const string  re_field_name,
const string  im_field_name,
Vec  _F,
BlockData DATA,
FluxData data,
bool  _ho_geometry = false 
)

Member Function Documentation

◆ doWork()

PetscErrorCode MoFEM::HelmholtzElement::OpHelmholtzFlux::doWork ( int  side,
EntityType  type,
DataForcesAndSurcesCore::EntData data 
)

calculate Impedance flux

F = int_S N^T * g dS

Definition at line 1088 of file HelmholtzElementObsolete.hpp.

1089  {
1090  PetscFunctionBegin;
1091 
1092  if(data.getIndices().size()==0) PetscFunctionReturn(0);
1093  if(dAta.tRis.find(getMoFEMFEPtr()->get_ent())==dAta.tRis.end()) PetscFunctionReturn(0);
1094 
1095  PetscErrorCode ierr;
1096 
1097  const FENumeredDofMoFEMEntity *dof_ptr;
1098  ierr = getMoFEMFEPtr()->get_row_dofs_by_petsc_gloabl_dof_idx(data.getIndices()[0],&dof_ptr); CHKERRQ(ierr);
1099  int rank = dof_ptr->get_max_rank();
1100 
1101  int nb_dofs = data.getIndices().size()/rank;
1102 
1103  Nf.resize(data.getIndices().size());
1104  fill(Nf.begin(),Nf.end(),0);
1105 
1106  //cerr << getNormal() << endl;
1107  //cerr << getNormals_at_GaussPt() << endl;
1108 
1109  for(unsigned int gg = 0;gg<data.getN().size1();gg++) {
1110 
1111  double val = getGaussPts()(2,gg);
1112  double flux;
1113  cout << "\n flux occurs \n" << endl;
1114 
1115  if(ho_geometry) {
1116  double area = norm_2(getNormals_at_GaussPt(gg)); //cblas_dnrm2(3,&getNormals_at_GaussPt()(gg,0),1);
1117  flux = dAta.dAta.data.value1*area; //FluxData.HeatfluxCubitBcData.data.value1 * area
1118  } else {
1119  flux = dAta.dAta.data.value1*getArea();
1120  }
1121  //cblas_daxpy(nb_row_dofs,val*flux,&data.getN()(gg,0),1,&*Nf.data().begin(),1);
1122  ublas::noalias(Nf) += val*flux*data.getN(gg,nb_dofs);
1123 
1124  }
1125 
1126  if(useTsF) {
1127  ierr = VecSetValues(getFEMethod()->ts_F,data.getIndices().size(),
1128  &data.getIndices()[0],&Nf[0],ADD_VALUES); CHKERRQ(ierr);
1129  } else {
1130  ierr = VecSetValues(F,data.getIndices().size(),
1131  &data.getIndices()[0],&Nf[0],ADD_VALUES); CHKERRQ(ierr);
1132  }
1133 
1134  PetscFunctionReturn(0);
1135  }
Range tRis
suraface triangles where hate flux is applied
CHKERRQ(ierr)
MoFEMErrorCode VecSetValues(Vec V, const DataForcesAndSourcesCore::EntData &data, const double *ptr, InsertMode iora)
Assemble PETSc vector.
HeatfluxCubitBcData dAta
for more details look to BCMultiIndices.hpp to see details of HeatfluxCubitBcData

Member Data Documentation

◆ datA

BlockData& MoFEM::HelmholtzElement::OpHelmholtzFlux::datA

Definition at line 1067 of file HelmholtzElementObsolete.hpp.

◆ dAta

FluxData& MoFEM::HelmholtzElement::OpHelmholtzFlux::dAta

Definition at line 1068 of file HelmholtzElementObsolete.hpp.

◆ F

Vec MoFEM::HelmholtzElement::OpHelmholtzFlux::F

Definition at line 1075 of file HelmholtzElementObsolete.hpp.

◆ ho_geometry

bool MoFEM::HelmholtzElement::OpHelmholtzFlux::ho_geometry

Definition at line 1069 of file HelmholtzElementObsolete.hpp.

◆ Nf

VectorDouble MoFEM::HelmholtzElement::OpHelmholtzFlux::Nf

Definition at line 1081 of file HelmholtzElementObsolete.hpp.

◆ useTsF

bool MoFEM::HelmholtzElement::OpHelmholtzFlux::useTsF

Definition at line 1070 of file HelmholtzElementObsolete.hpp.


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