PetIBM 0.5.4
Toolbox and applications of the immersed-boundary method for distributed-memory architectures
Solution holders

Simple structures to hold flow field solutions. More...

Collaboration diagram for Solution holders:

Namespaces

namespace  petibm::solution
 Collection of classes and functions regarding solution holders.
 

Classes

class  petibm::solution::SolutionBase
 Base (abstract) class for different solution holders. More...
 
class  petibm::solution::SolutionSimple
 Class to hold the velocity vector field and pressure scalar field. More...
 

Typedefs

typedef std::shared_ptr< solution::SolutionBasepetibm::type::Solution
 Type definition of solution object. More...
 

Functions

PetscErrorCode petibm::solution::createSolution (const type::Mesh &mesh, type::Solution &solution)
 Factory function to create a petibm::solution::Solution object. More...
 

Detailed Description

Simple structures to hold flow field solutions.

Objects hold the solution of the pressure scalar field and the velocity vector field. These flow fields are stored in distributed PETSc Vec objects. Objects also handles I/O of the flow field solutions.

petibm::solution::SolutionSimple is currently the only adaptation of the abstract class petibm::solution::SolutionBase. API users should use the type definition petibm::solution::Solution to create a solution object through the factory function petibm::solution::createSolution. Flow solvers implemented in PetIBM currently do not need other functionalities than those available in the abstract class and its only adaptation. We use an abstract class for the potential of expanding this category in the future.

See also
petibm::type::Solution, petibm::solution::createSolution

Typedef Documentation

◆ Solution

Type definition of solution object.

Users should use the function petibm::solution::createSolution to create a petibm::solution::Solution object.

Example usage:

PetscErrorCode ierr;
YAML::Node config;
// get the simulation settings into YAML node config
// create Mesh with petibm::mesh::createMesh
// create a Solution instance
ierr = petibm::solution::createSolution(mesh, solution); CHKERRQ(ierr);
// set initial conditions
ierr = solution->setInitialConditions(config); CHKERRQ(ierr);
// write the flow field solutions into a file test.h5
ierr = solution->write("./test.h5"); CHKERRQ(ierr);
std::shared_ptr< mesh::MeshBase > Mesh
Type definition of Mesh.
Definition: mesh.h:348
std::shared_ptr< solution::SolutionBase > Solution
Type definition of solution object.
Definition: solution.h:210
PetscErrorCode createSolution(const type::Mesh &mesh, type::Solution &solution)
Factory function to create a petibm::solution::Solution object.
Definition: solution.cpp:65
See also
Solution holders, petibm::solution::SolutionBase, petibm::solution::createSolution

Definition at line 210 of file solution.h.

Function Documentation

◆ createSolution()

PetscErrorCode petibm::solution::createSolution ( const type::Mesh mesh,
type::Solution solution 
)

Factory function to create a petibm::solution::Solution object.

The function create a solution object based on the provided underlying Cartesian mesh.

Parameters
mesh[in] Cartesian mesh object.
solution[out] Solution object.
Returns
PetscErrorCode.
See also
Solution holders, petibm::type::Solution

Definition at line 65 of file solution.cpp.