v0.16.3
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
schrod_eig::OpSquare Struct Reference

[Calculate square of wave function] More...

#include "tutorials/scl-13_schrodinger_equation/src/schrod_eig.hpp"

Inheritance diagram for schrod_eig::OpSquare:
[legend]
Collaboration diagram for schrod_eig::OpSquare:
[legend]

Public Member Functions

 OpSquare (boost::shared_ptr< VectorDouble > squareField, boost::shared_ptr< VectorDouble > field)
 
MoFEMErrorCode doWork (int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
 

Private Attributes

boost::shared_ptr< VectorDouble > squareField
 
boost::shared_ptr< VectorDouble > field
 

Detailed Description

[Calculate square of wave function]

Definition at line 17 of file schrod_eig.hpp.

Constructor & Destructor Documentation

◆ OpSquare()

schrod_eig::OpSquare::OpSquare ( boost::shared_ptr< VectorDouble >  squareField,
boost::shared_ptr< VectorDouble >  field 
)
inline

Definition at line 18 of file schrod_eig.hpp.

20 : ForcesAndSourcesCore::UserDataOperator(NOSPACE, OPLAST),
@ NOSPACE
Definition definitions.h:83
boost::shared_ptr< VectorDouble > field
boost::shared_ptr< VectorDouble > squareField

Member Function Documentation

◆ doWork()

MoFEMErrorCode schrod_eig::OpSquare::doWork ( int  side,
EntityType  type,
DataForcesAndSourcesCore::EntData &  data 
)
inline

Definition at line 23 of file schrod_eig.hpp.

24 {
26
27 const size_t nb_gauss_pts = getGaussPts().size2();
28 squareField->resize(nb_gauss_pts, 0);
29
30 auto t_squareField = getFTensor0FromVec(*squareField);
31
32 auto t_field = getFTensor0FromVec(*field);
33
34 for (int gg = 0; gg != nb_gauss_pts; gg++) {
35 t_squareField = t_field * t_field;
36 ++t_field;
37 ++t_squareField;
38 }
39
41 }
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
static auto getFTensor0FromVec(V &data)
Get tensor rank 0 (scalar) form data vector.

Member Data Documentation

◆ field

boost::shared_ptr<VectorDouble> schrod_eig::OpSquare::field
private

Definition at line 45 of file schrod_eig.hpp.

◆ squareField

boost::shared_ptr<VectorDouble> schrod_eig::OpSquare::squareField
private

Definition at line 44 of file schrod_eig.hpp.


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