IBAMR
An adaptive and distributed-memory parallel implementation of the immersed boundary (IB) method
|
#include </home/runner/work/IBAMR/IBAMR/ibtk/include/ibtk/MarkerPatchHierarchy.h>
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 MarkerPatch & | getMarkerPatch (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 |
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.
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.
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
.
u_new_idx
has up-to-date ghost values with sufficient width for kernel
. See LEInteractor for kernel names. std::pair< EigenAlignedVector< IBTK::Point >, EigenAlignedVector< IBTK::Vector > > IBTK::MarkerPatchHierarchy::collectAllMarkers | ( | ) | const |
Collect all markers on all processors in a single array.
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
.
u_new_idx
has up-to-date ghost values with sufficient width for kernel
. See LEInteractor for kernel names.
|
virtual |
Load the marker points from a database.
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.
std::size_t IBTK::MarkerPatchHierarchy::getNumberOfMarkers | ( | ) | const |
Get the total number of marker points stored across all processors.
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.
u_half_idx
and u_new_idx
have up-to-date ghost values with sufficient width for kernel
. See LEInteractor for kernel names.
|
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.
|
overridevirtual |
Save the present state of the object (i.e., the marker point data) to a SAMRAI database.
Implements SAMRAI::tbox::Serializable.
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
.
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.
u_new_idx
has up-to-date ghost values with sufficient width for kernel
. See LEInteractor for kernel names. 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'.