Example #1
0
void GeneralizedIBMethod::registerEulerianVariables()
{
    IBMethod::registerEulerianVariables();

    const IntVector<NDIM> ib_ghosts = getMinimumGhostCellWidth();
    const IntVector<NDIM> ghosts = 1;
    const IntVector<NDIM> no_ghosts = 0;

    Pointer<Variable<NDIM> > u_var = d_ib_solver->getVelocityVariable();
    Pointer<CellVariable<NDIM, double> > u_cc_var = u_var;
    Pointer<SideVariable<NDIM, double> > u_sc_var = u_var;
    if (u_cc_var)
    {
        d_f_var = new CellVariable<NDIM, double>(d_object_name + "::f", NDIM);
        d_w_var = new CellVariable<NDIM, double>(d_object_name + "::w", NDIM);
        d_n_var = new CellVariable<NDIM, double>(d_object_name + "::n", NDIM);
    }
    else if (u_sc_var)
    {
        d_f_var = new SideVariable<NDIM, double>(d_object_name + "::f");
        d_w_var = new SideVariable<NDIM, double>(d_object_name + "::w");
        d_n_var = new SideVariable<NDIM, double>(d_object_name + "::n");
    }
    else
    {
        TBOX_ERROR(d_object_name << "::registerEulerianVariables():\n"
                                 << "  unsupported velocity data centering" << std::endl);
    }
    registerVariable(d_f_idx, d_f_var, no_ghosts, d_ib_solver->getScratchContext());
    registerVariable(d_w_idx, d_w_var, ib_ghosts, d_ib_solver->getScratchContext());
    registerVariable(d_n_idx, d_n_var, ghosts, d_ib_solver->getScratchContext());
    return;
} // registerEulerianVariables
Example #2
0
void
IBStrategy::setupTagBuffer(Array<int>& tag_buffer, Pointer<GriddingAlgorithm<NDIM> > gridding_alg) const
{
    const int finest_hier_ln = gridding_alg->getMaxLevels() - 1;
    const int tsize = tag_buffer.size();
    tag_buffer.resizeArray(finest_hier_ln);
    for (int i = tsize; i < finest_hier_ln; ++i) tag_buffer[i] = 0;
    const int gcw = getMinimumGhostCellWidth().max();
    for (int i = 0; i < tag_buffer.size(); ++i)
    {
        tag_buffer[i] = std::max(tag_buffer[i], gcw);
    }
    return;
} // setupTagBuffer