IBAMR  IBAMR version 0.19.
Namespaces | Macros | Typedefs | Functions | Variables
ibtk_utilities.h File Reference
#include <ibtk/config.h>
#include "PatchHierarchy.h"
#include "SAMRAIVectorReal.h"
#include "tbox/MathUtilities.h"
#include "tbox/PIO.h"
#include "tbox/Pointer.h"
#include "tbox/Utilities.h"
#include "Eigen/Core"
#include "Eigen/StdVector"
#include <algorithm>
#include <array>
#include <utility>

Namespaces

 IBTK
 

Macros

#define IBTK_BIT_SET(bitfield, b)   ((bitfield) |= (1 << (b)))
 
#define IBTK_BIT_CLEAR(bitfield, b)   ((bitfield) &= ~(1 << (b)))
 
#define IBTK_BIT_TOGGLE(bitfield, b)   ((bitfield) ^= (1 << (b)))
 
#define IBTK_BIT_CHECK(bitfield, b)   ((bitfield) & (1 << (b)))
 
#define IBTK_DO_ONCE(task)
 
#define IBTK_DEPRECATED(msg)
 
#define IBTK_TIMER_START(timer)
 
#define IBTK_TIMER_STOP(timer)
 

Typedefs

template<typename T >
using IBTK::EigenAlignedVector = std::vector< T >
 
using IBTK::Matrix2d = Eigen::Matrix< double, 2, 2 >
 
using IBTK::Vector2d = Eigen::Matrix< double, 2, 1 >
 
using IBTK::ColumnVector2d = Eigen::Matrix< double, 2, 1 >
 
using IBTK::RowVector2d = Eigen::Matrix< double, 1, 2 >
 
using IBTK::Matrix3d = Eigen::Matrix< double, 3, 3 >
 
using IBTK::Vector3d = Eigen::Matrix< double, 3, 1 >
 
using IBTK::ColumnVector3d = Eigen::Matrix< double, 3, 1 >
 
using IBTK::RowVector3d = Eigen::Matrix< double, 1, 3 >
 
using IBTK::MatrixNd = Eigen::Matrix< double, NDIM, NDIM >
 
using IBTK::VectorNd = Eigen::Matrix< double, NDIM, 1 >
 
using IBTK::ColumnVectorNd = Eigen::Matrix< double, NDIM, 1 >
 
using IBTK::RowVectorNd = Eigen::Matrix< double, 1, NDIM >
 
using IBTK::MatrixXd = Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic >
 
using IBTK::VectorXd = Eigen::Matrix< double, Eigen::Dynamic, 1 >
 
using IBTK::ColumnVectorXd = Eigen::Matrix< double, Eigen::Dynamic, 1 >
 
using IBTK::RowVectorXd = Eigen::Matrix< double, 1, Eigen::Dynamic >
 
using IBTK::Matrix = MatrixNd
 
using IBTK::Point = VectorNd
 
using IBTK::Vector = VectorNd
 
using IBTK::RigidDOFVector = Eigen::Matrix< double, s_max_free_dofs, 1 >
 
using IBTK::FreeRigidDOFVector = Eigen::Matrix< int, s_max_free_dofs, 1 >
 
using IBTK::RDV = RigidDOFVector
 
using IBTK::FRDV = FreeRigidDOFVector
 

Functions

bool IBTK::rel_equal_eps (double a, double b, double eps=std::sqrt(std::numeric_limits< double >::epsilon()))
 
bool IBTK::abs_equal_eps (double a, double b, double eps=std::sqrt(std::numeric_limits< double >::epsilon()))
 Check whether the absolute difference between a and b are within the threshold eps. More...
 
std::string IBTK::get_data_time_str (const double data_time, const double current_time, const double new_time)
 
double IBTK::get_min_patch_dx (const SAMRAI::hier::PatchLevel< NDIM > &patch_level)
 
template<class T , unsigned N>
std::array< T, N > IBTK::array_constant (const T &v)
 
template<class T , unsigned N>
std::array< T, N > IBTK::array_one ()
 
template<class T , unsigned N>
std::array< T, N > IBTK::array_zero ()
 
bool IBTK::level_can_be_refined (int level_number, int max_levels)
 
std::pair< int, intIBTK::voigt_to_tensor_idx (const int k)
 
int IBTK::tensor_idx_to_voigt (const std::pair< int, int > &idx)
 
double IBTK::smooth_heaviside (const double &phi, const double &alpha)
 
double IBTK::smooth_delta (const double &phi, const double &alpha)
 
double IBTK::discontinuous_heaviside (const double &phi)
 
void IBTK::deallocate_vector_data (SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &x, int coarsest_ln=invalid_level_number, int finest_ln=invalid_level_number)
 
void IBTK::free_vector_components (SAMRAI::solv::SAMRAIVectorReal< NDIM, double > &x, int coarsest_ln=invalid_level_number, int finest_ln=invalid_level_number)
 
template<class T >
const T & IBTK::checked_dereference (const SAMRAI::tbox::Pointer< T > &p)
 
template<class T >
T & IBTK::checked_dereference (SAMRAI::tbox::Pointer< T > &p)
 

Variables

static const bool IBTK::ENABLE_TIMERS = true
 
static const int IBTK::s_max_free_dofs = NDIM * (NDIM + 1) / 2
 
static const int IBTK::invalid_level_number = -1
 
static const int IBTK::invalid_index = -1
 

Macro Definition Documentation

◆ IBTK_BIT_SET

#define IBTK_BIT_SET (   bitfield,
 
)    ((bitfield) |= (1 << (b)))

◆ IBTK_BIT_CLEAR

#define IBTK_BIT_CLEAR (   bitfield,
 
)    ((bitfield) &= ~(1 << (b)))

◆ IBTK_BIT_TOGGLE

#define IBTK_BIT_TOGGLE (   bitfield,
 
)    ((bitfield) ^= (1 << (b)))

◆ IBTK_BIT_CHECK

#define IBTK_BIT_CHECK (   bitfield,
 
)    ((bitfield) & (1 << (b)))

◆ IBTK_DO_ONCE

#define IBTK_DO_ONCE (   task)
Value:
do \
{ \
static bool done = false; \
if (done == false) \
{ \
task; \
done = true; \
} \
} while (0);

◆ IBTK_DEPRECATED

#define IBTK_DEPRECATED (   msg)

Define the deprecation macro when the compiler specifies it is available

◆ IBTK_TIMER_START

#define IBTK_TIMER_START (   timer)
Value:
do \
{ \
if (IBTK::ENABLE_TIMERS) timer->start(); \
} while (0);

◆ IBTK_TIMER_STOP

#define IBTK_TIMER_STOP (   timer)
Value:
do \
{ \
if (IBTK::ENABLE_TIMERS) timer->stop(); \
} while (0);
IBTK::ENABLE_TIMERS
static const bool ENABLE_TIMERS
Definition: ibtk_utilities.h:72