PetIBM 0.5.4
Toolbox and applications of the immersed-boundary method for distributed-memory architectures
petibm::misc::ProbeBase Class Referenceabstract

Abstract Base Class of a probe. More...

#include <probes.h>

Inheritance diagram for petibm::misc::ProbeBase:
[legend]

Public Member Functions

 ProbeBase ()=default
 Default constructor. More...
 
 ProbeBase (const MPI_Comm &comm, const YAML::Node &node, const type::Mesh &mesh)
 Constructor. Initialize the probe. More...
 
virtual ~ProbeBase ()
 Destructor. More...
 
virtual PetscErrorCode destroy ()
 Manually destroy data in the object. More...
 
PetscErrorCode monitor (const type::Solution &solution, const type::Mesh &mesh, const PetscInt &n, const PetscReal &t)
 Monitor the field solution and output data to file. More...
 

Protected Member Functions

virtual PetscErrorCode init (const MPI_Comm &comm, const YAML::Node &node, const type::Mesh &mesh)=0
 Initialize the probe. More...
 
virtual PetscErrorCode monitorVec (const DM &da, const Vec &fvec, const PetscInt &n, const PetscReal &t)=0
 Monitor a sub-region of a vector and possibly output data to file. More...
 

Protected Attributes

std::string name
 Name of the probe as a string. More...
 
std::string path
 Path of the file to output the solution. More...
 
type::Field field
 Type of the field to monitor. More...
 
PetscInt n_monitor
 Frequency of monitoring the solution (number of time steps). More...
 
PetscReal t_start
 Monitoring starting time. More...
 
PetscReal t_end
 Monitoring ending time. More...
 
PetscViewer viewer
 PETSc viewer to output the solution. More...
 
PetscViewerType viewerType
 Type of the PETSc viewer to use. More...
 
MPI_Comm comm
 MPI communicator. More...
 
PetscMPIInt commSize
 Number of processes in the MPI communicator. More...
 
PetscMPIInt commRank
 Rank of the local process in the MPI communicator. More...
 

Detailed Description

Abstract Base Class of a probe.

See also
Miscellaneous functions, petibm::type::Probe, petibm::misc::createProbe

Definition at line 30 of file probes.h.

Constructor & Destructor Documentation

◆ ProbeBase() [1/2]

petibm::misc::ProbeBase::ProbeBase ( )
default

Default constructor.

◆ ProbeBase() [2/2]

petibm::misc::ProbeBase::ProbeBase ( const MPI_Comm &  comm,
const YAML::Node &  node,
const type::Mesh mesh 
)

Constructor. Initialize the probe.

Parameters
comm[in] MPI communicator
node[in] YAML configuration node

◆ ~ProbeBase()

petibm::misc::ProbeBase::~ProbeBase ( )
virtual

Destructor.

Definition at line 84 of file probes.cpp.

Member Function Documentation

◆ destroy()

PetscErrorCode petibm::misc::ProbeBase::destroy ( )
virtual

Manually destroy data in the object.

Reimplemented in petibm::misc::ProbeVolume, and petibm::misc::ProbePoint.

Definition at line 98 of file probes.cpp.

◆ init()

PetscErrorCode petibm::misc::ProbeBase::init ( const MPI_Comm &  comm,
const YAML::Node &  node,
const type::Mesh mesh 
)
protectedpure virtual

Initialize the probe.

Parameters
comm[in] MPI communicator
node[in] YAML configuration node
Returns
PetscErrorCode

Implemented in petibm::misc::ProbeVolume, and petibm::misc::ProbePoint.

Definition at line 57 of file probes.cpp.

◆ monitor()

PetscErrorCode petibm::misc::ProbeBase::monitor ( const type::Solution solution,
const type::Mesh mesh,
const PetscInt &  n,
const PetscReal &  t 
)

Monitor the field solution and output data to file.

Parameters
solution[in] Data object with the field solutions
mesh[in] Cartesian mesh object
n[in] Time-step index
t[in] Time
Returns
PetscErrorCode

Definition at line 114 of file probes.cpp.

◆ monitorVec()

virtual PetscErrorCode petibm::misc::ProbeBase::monitorVec ( const DM &  da,
const Vec &  fvec,
const PetscInt &  n,
const PetscReal &  t 
)
protectedpure virtual

Monitor a sub-region of a vector and possibly output data to file.

Parameters
da[in] Parallel layout of the full-domain vector
fvec[in] Full-domain PETSc Vec object to monitor
n[in] Time-step index
t[in] Time

Implemented in petibm::misc::ProbeVolume, and petibm::misc::ProbePoint.

Member Data Documentation

◆ comm

MPI_Comm petibm::misc::ProbeBase::comm
protected

MPI communicator.

Definition at line 90 of file probes.h.

◆ commRank

PetscMPIInt petibm::misc::ProbeBase::commRank
protected

Rank of the local process in the MPI communicator.

Definition at line 96 of file probes.h.

◆ commSize

PetscMPIInt petibm::misc::ProbeBase::commSize
protected

Number of processes in the MPI communicator.

Definition at line 93 of file probes.h.

◆ field

type::Field petibm::misc::ProbeBase::field
protected

Type of the field to monitor.

Definition at line 72 of file probes.h.

◆ n_monitor

PetscInt petibm::misc::ProbeBase::n_monitor
protected

Frequency of monitoring the solution (number of time steps).

Definition at line 75 of file probes.h.

◆ name

std::string petibm::misc::ProbeBase::name
protected

Name of the probe as a string.

Definition at line 66 of file probes.h.

◆ path

std::string petibm::misc::ProbeBase::path
protected

Path of the file to output the solution.

Definition at line 69 of file probes.h.

◆ t_end

PetscReal petibm::misc::ProbeBase::t_end
protected

Monitoring ending time.

Definition at line 81 of file probes.h.

◆ t_start

PetscReal petibm::misc::ProbeBase::t_start
protected

Monitoring starting time.

Definition at line 78 of file probes.h.

◆ viewer

PetscViewer petibm::misc::ProbeBase::viewer
protected

PETSc viewer to output the solution.

Definition at line 84 of file probes.h.

◆ viewerType

PetscViewerType petibm::misc::ProbeBase::viewerType
protected

Type of the PETSc viewer to use.

Definition at line 87 of file probes.h.


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