IBAMR
An adaptive and distributed-memory parallel implementation of the immersed boundary (IB) method
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
IBTK::MarkerPatchHierarchy Class Reference

#include </home/runner/work/IBAMR/IBAMR/ibtk/include/ibtk/MarkerPatchHierarchy.h>

Inheritance diagram for IBTK::MarkerPatchHierarchy:
Inheritance graph
[legend]

Public Member Functions

 MarkerPatchHierarchy (const std::string &name, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > patch_hierarchy, const EigenAlignedVector< IBTK::Point > &positions, const EigenAlignedVector< IBTK::Point > &velocities, const bool register_for_restart=true)
 
void reinit (const EigenAlignedVector< IBTK::Point > &positions, const EigenAlignedVector< IBTK::Point > &velocities)
 
void putToDatabase (SAMRAI::tbox::Pointer< SAMRAI::tbox::Database > db) override
 
void writeH5Part (const std::string &filename, const int time_step, const double simulation_time, const bool write_velocities=true) const
 
virtual void getFromDatabase (SAMRAI::tbox::Pointer< SAMRAI::tbox::Database > db)
 
const MarkerPatchgetMarkerPatch (const int ln, const int local_patch_num) const
 
std::size_t getNumberOfMarkers () const
 
std::pair< EigenAlignedVector< IBTK::Point >, EigenAlignedVector< IBTK::Vector > > collectAllMarkers () const
 
void setVelocities (const int u_idx, const std::string &kernel)
 
void forwardEulerStep (const double dt, const int u_new_idx, const std::string &kernel)
 
void backwardEulerStep (const double dt, const int u_new_idx, const std::string &kernel)
 
void midpointStep (const double dt, const int u_half_idx, const int u_new_idx, const std::string &kernel)
 
void trapezoidalStep (const double dt, const int u_new_idx, const std::string &kernel)
 

Protected Member Functions

void pruneAndRedistribute ()
 

Protected Attributes

std::string d_object_name
 
bool d_register_for_restart
 
std::size_t d_num_markers
 
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > d_hierarchy
 
std::vector< std::deque< MarkerPatch > > d_marker_patches
 
MarkerPatch d_markers_outside_domain
 

Detailed Description

Implementation of marker points, also sometimes called particles. These points are akin to IB points except they are simply advected by the fluid and do not apply any force upon it.

Constructor & Destructor Documentation

◆ MarkerPatchHierarchy()

IBTK::MarkerPatchHierarchy::MarkerPatchHierarchy ( const std::string name,
SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > >  patch_hierarchy,
const EigenAlignedVector< IBTK::Point > &  positions,
const EigenAlignedVector< IBTK::Point > &  velocities,
const bool  register_for_restart = true 
)

Constructor.

positions and velocities should be the positions and velocities of the markers. These vectors should contain the complete (i.e., the same on each processor) list of markers and are implicitly numbered by their array index.

Member Function Documentation

◆ backwardEulerStep()

void IBTK::MarkerPatchHierarchy::backwardEulerStep ( const double  dt,
const int  u_new_idx,
const std::string kernel 
)

Advect the markers with their present velocity values with the explicit backward Euler method (i.e., a forward Euler prediction step followed by a backward Euler correction step). After the markers are moved their velocities are reset to values interpolated from u_new_idx via the IB kernel kernel.

Note
This function assumes that u_new_idx has up-to-date ghost values with sufficient width for kernel. See LEInteractor for kernel names.

◆ collectAllMarkers()

std::pair< EigenAlignedVector< IBTK::Point >, EigenAlignedVector< IBTK::Vector > > IBTK::MarkerPatchHierarchy::collectAllMarkers ( ) const

Collect all markers on all processors in a single array.

◆ forwardEulerStep()

void IBTK::MarkerPatchHierarchy::forwardEulerStep ( const double  dt,
const int  u_new_idx,
const std::string kernel 
)

Advect the markers with their present velocity values with the forward Euler method. After the markers are moved their velocities are reset to values interpolated from u_new_idx via the IB kernel kernel.

Note
This function assumes that u_new_idx has up-to-date ghost values with sufficient width for kernel. See LEInteractor for kernel names.

◆ getFromDatabase()

void IBTK::MarkerPatchHierarchy::getFromDatabase ( SAMRAI::tbox::Pointer< SAMRAI::tbox::Database db)
virtual

Load the marker points from a database.

◆ getMarkerPatch()

const MarkerPatch & IBTK::MarkerPatchHierarchy::getMarkerPatch ( const int  ln,
const int  local_patch_num 
) const

Get the MarkerPatch associated with the present level and local patch number.

◆ getNumberOfMarkers()

std::size_t IBTK::MarkerPatchHierarchy::getNumberOfMarkers ( ) const

Get the total number of marker points stored across all processors.

◆ midpointStep()

void IBTK::MarkerPatchHierarchy::midpointStep ( const double  dt,
const int  u_half_idx,
const int  u_new_idx,
const std::string kernel 
)

Advect the markers by some given velocity field at half and new times and the interaction kernel kernel.

This time integrator is the 'explicit midpoint' method, which uses the present velocity to predict a midpoint position and then uses the midpoint velocity to compute the new position.

Note
This function assumes that u_half_idx and u_new_idx have up-to-date ghost values with sufficient width for kernel. See LEInteractor for kernel names.

◆ pruneAndRedistribute()

void IBTK::MarkerPatchHierarchy::pruneAndRedistribute ( )
protected

Redistribute any particles which may have moved outside of their patches, taking into account physical boundaries (markers are not allowed to escape) and periodicity.

◆ putToDatabase()

void IBTK::MarkerPatchHierarchy::putToDatabase ( SAMRAI::tbox::Pointer< SAMRAI::tbox::Database db)
overridevirtual

Save the present state of the object (i.e., the marker point data) to a SAMRAI database.

Note
Since the constructor requires a pointer to the PatchHierarchy this function relies on the constructor to set up all geometric and index space data and only saves the markers themselves.

Implements SAMRAI::tbox::Serializable.

◆ setVelocities()

void IBTK::MarkerPatchHierarchy::setVelocities ( const int  u_idx,
const std::string kernel 
)

Set marker velocities with some given velocity field u_idx and interaction kernel kernel.

◆ trapezoidalStep()

void IBTK::MarkerPatchHierarchy::trapezoidalStep ( const double  dt,
const int  u_new_idx,
const std::string kernel 
)

Advect the markers by some given velocity field at the end of a timestep and the interaction kernel kernel.

This time integrator is the 'explicit trapezoid' method, which uses the present velocity to predict a new position and then uses the trapezoid rule to correct that position.

Note
This function assumes that u_new_idx has up-to-date ghost values with sufficient width for kernel. See LEInteractor for kernel names.

◆ writeH5Part()

void IBTK::MarkerPatchHierarchy::writeH5Part ( const std::string filename,
const int  time_step,
const double  simulation_time,
const bool  write_velocities = true 
) const

Write the particles to a single H5Part file.

H5Part is a simple HDF5 schema for particles which VisIt understands. You should either use the file suffix .h5part or use the VisIt H5Part reader explicitly. To visualize, select 'Mesh -> particles'.


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