v0.8.23
Public Member Functions | Public Attributes | List of all members
AnalyticalDirichletHelmholtzBC::DirichletBC_RhsOnly Struct Reference

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

Inheritance diagram for AnalyticalDirichletHelmholtzBC::DirichletBC_RhsOnly:
[legend]
Collaboration diagram for AnalyticalDirichletHelmholtzBC::DirichletBC_RhsOnly:
[legend]

Public Member Functions

 DirichletBC_RhsOnly (MoFEM::Interface &m_field, const string &field, Mat A, Vec X, Vec F)
 
 DirichletBC_RhsOnly (MoFEM::Interface &m_field, const string &field)
 
virtual PetscErrorCode preProcess ()
 
virtual PetscErrorCode postProcess ()
 
- Public Member Functions inherited from AnalyticalDirichletHelmholtzBC::DirichletBC
 DirichletBC (MoFEM::Interface &m_field, const string &field, Mat A, Vec X, Vec F)
 
 DirichletBC (MoFEM::Interface &m_field, const string &field)
 
PetscErrorCode iNitalize ()
 
PetscErrorCode iNitalize (Range &tris)
 

Public Attributes

Range * tRis_ptr
 
- Public Attributes inherited from AnalyticalDirichletHelmholtzBC::DirichletBC
Range * tRis_ptr
 

Detailed Description

Definition at line 205 of file AnalyticalDirichletHelmholtz.hpp.

Constructor & Destructor Documentation

◆ DirichletBC_RhsOnly() [1/2]

AnalyticalDirichletHelmholtzBC::DirichletBC_RhsOnly::DirichletBC_RhsOnly ( MoFEM::Interface m_field,
const string &  field,
Mat  A,
Vec  X,
Vec  F 
)

◆ DirichletBC_RhsOnly() [2/2]

AnalyticalDirichletHelmholtzBC::DirichletBC_RhsOnly::DirichletBC_RhsOnly ( MoFEM::Interface m_field,
const string &  field 
)

Member Function Documentation

◆ postProcess()

PetscErrorCode AnalyticalDirichletHelmholtzBC::DirichletBC_RhsOnly::postProcess ( )
virtual

Definition at line 325 of file AnalyticalDirichletHelmholtz.cpp.

325  {
326  PetscFunctionBegin;
327 
328  switch (ts_ctx) {
329  case CTX_TSSETIFUNCTION: {
330  snes_ctx = CTX_SNESSETFUNCTION;
331  snes_x = ts_u;
332  snes_f = ts_F;
333  break;
334  }
335  case CTX_TSSETIJACOBIAN: {
336  snes_ctx = CTX_SNESSETJACOBIAN;
337  snes_B = ts_B;
338  break;
339  }
340  default:
341  break;
342  }
343 
344  if(snes_ctx == CTX_SNESNONE && ts_ctx == CTX_TSNONE) {
345  ierr = VecAssemblyBegin(snes_f); CHKERRQ(ierr);
346  ierr = VecAssemblyEnd(snes_f); CHKERRQ(ierr);
347  // for(vector<int>::iterator vit = dofsIndices.begin();vit!=dofsIndices.end();vit++) {
348  // ierr = VecSetValue(snes_f,*vit,0,INSERT_VALUES); CHKERRQ(ierr);
349  // }
350  if(dofsIndices.size()>0) {
351  ierr = VecSetValues(snes_f,dofsIndices.size(),&dofsIndices[0],&dofsValues[0],INSERT_VALUES); CHKERRQ(ierr);
352  }
353  ierr = VecAssemblyBegin(snes_f); CHKERRQ(ierr);
354  ierr = VecAssemblyEnd(snes_f); CHKERRQ(ierr);
355  }
356 
357  PetscFunctionReturn(0);
358  }
CHKERRQ(ierr)
MoFEMErrorCode VecSetValues(Vec V, const DataForcesAndSourcesCore::EntData &data, const double *ptr, InsertMode iora)
Assemble PETSc vector.

◆ preProcess()

PetscErrorCode AnalyticalDirichletHelmholtzBC::DirichletBC_RhsOnly::preProcess ( )
virtual

Definition at line 293 of file AnalyticalDirichletHelmholtz.cpp.

293  {
294  PetscFunctionBegin;
295 
296  switch (ts_ctx) {
297  case CTX_TSSETIFUNCTION: {
298  snes_ctx = CTX_SNESSETFUNCTION;
299  snes_x = ts_u;
300  snes_f = ts_F;
301  break;
302  }
303  case CTX_TSSETIJACOBIAN: {
304  snes_ctx = CTX_SNESSETJACOBIAN;
305  snes_B = ts_B;
306  break;
307  }
308  default:
309  break;
310  }
311 
313 
314  if(snes_ctx == CTX_SNESNONE && ts_ctx == CTX_TSNONE) {
315  if(dofsIndices.size()>0) {
316  ierr = VecSetValues(snes_x,dofsIndices.size(),&dofsIndices[0],&dofsValues[0],INSERT_VALUES); CHKERRQ(ierr);
317  }
318  ierr = VecAssemblyBegin(snes_x); CHKERRQ(ierr);
319  ierr = VecAssemblyEnd(snes_x); CHKERRQ(ierr);
320  }
321 
322  PetscFunctionReturn(0);
323  }
CHKERRQ(ierr)
MoFEMErrorCode VecSetValues(Vec V, const DataForcesAndSourcesCore::EntData &data, const double *ptr, InsertMode iora)
Assemble PETSc vector.

Member Data Documentation

◆ tRis_ptr

Range* AnalyticalDirichletHelmholtzBC::DirichletBC_RhsOnly::tRis_ptr

Definition at line 215 of file AnalyticalDirichletHelmholtz.hpp.


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