/*!
 * Convenience function to register several variables with the same \a prefix, that have a file
 * as a value. Takes the prefix and registers variables like \c{prefix:FilePath} and
 * \c{prefix:Path}, with descriptions that start with the given \a heading.
 * For example \c{registerFileVariables("CurrentDocument", tr("Current Document"))} registers
 * variables such as \c{CurrentDocument:FilePath} with description
 * "Current Document: Full path including file name."
 *
 * \sa isFileVariable()
 * \sa fileVariableValue()
 */
void VariableManager::registerFileVariables(const QByteArray &prefix, const QString &heading)
{
    registerVariable(prefix + kFilePathPostfix, tr("%1: Full path including file name.").arg(heading));
    registerVariable(prefix + kPathPostfix, tr("%1: Full path excluding file name.").arg(heading));
    registerVariable(prefix + kFileNamePostfix, tr("%1: File name without path.").arg(heading));
    registerVariable(prefix + kFileBaseNamePostfix, tr("%1: File base name without path and suffix.").arg(heading));
}
Esempio n. 2
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
Esempio n. 3
0
FixationPoint::FixationPoint(const ParameterValueMap &parameters):
    RectangleStimulus(parameters),
    SquareRegionTrigger(registerVariable(parameters[X_POSITION]),
                        registerVariable(parameters[Y_POSITION]),
                        registerVariable(parameters[TRIGGER_WIDTH]),
                        VariablePtr(parameters[TRIGGER_WATCH_X]),
                        VariablePtr(parameters[TRIGGER_WATCH_Y]),
                        VariablePtr(parameters[TRIGGER_FLAG]))
{ }
Esempio n. 4
0
CircularFixationPoint::CircularFixationPoint(const ParameterValueMap &parameters):
    CircleStimulus(parameters),
    CircularRegionTrigger(registerVariable(parameters[X_POSITION]),
                          registerVariable(parameters[Y_POSITION]),
                          registerVariable(parameters[FixationPoint::TRIGGER_WIDTH]),
                          VariablePtr(parameters[FixationPoint::TRIGGER_WATCH_X]),
                          VariablePtr(parameters[FixationPoint::TRIGGER_WATCH_Y]),
                          VariablePtr(parameters[FixationPoint::TRIGGER_FLAG]))
{ }
Esempio n. 5
0
/*!
 * Makes the given integral-valued \a variable known to the variable manager,
 * together with a localized \a description.
 *
 * \sa registerVariable(), registerFileVariables()
 */
void VariableManager::registerIntVariable(const QByteArray &variable,
    const QString &description, const VariableManager::IntFunction &value)
{
    const VariableManager::IntFunction valuecopy = value; // do not capture a reference in a lambda
    registerVariable(variable, description,
        [valuecopy]() { return QString::number(valuecopy ? valuecopy() : 0); });
}
Esempio n. 6
0
void S_zeroAssignments(struct Node *t) {
  if (t == NULL)
    return;
  
  if (t->tag == TASSIGN) {
    char *name = t->children->iname;
    int zero = 0;
    if (t->children->next->tag == TNUM) {
      if (t->children->next->ival == 0.0) {
        zero = 1;
      }
    }
    registerVariable(name, TDOUBLE);
    registerZeroVar(name, zero);
  } else if (t->tag == TFOR) {
    struct Node *pntr = t->children->next;
    while (pntr != NULL) {
      S_zeroAssignments(pntr);
      pntr = pntr->next;
    }
  } else if (t->tag == TIF) {
    S_zeroAssignments(t->children->next);
  } else if (t->tag == TIFELSE) {
    S_zeroAssignments(t->children->next->next);
  } else if (t->tag == TCOMBINE) {
    struct Node *pntr = t->children;
    while (pntr != NULL) {
      S_zeroAssignments(pntr);
      pntr = pntr->next;
    }
  }
}
Esempio n. 7
0
/*!
 * Convenience function to register several variables with the same \a prefix, that have a file
 * as a value. Takes the prefix and registers variables like \c{prefix:FilePath} and
 * \c{prefix:Path}, with descriptions that start with the given \a heading.
 * For example \c{registerFileVariables("CurrentDocument", tr("Current Document"))} registers
 * variables such as \c{CurrentDocument:FilePath} with description
 * "Current Document: Full path including file name."
 */
void VariableManager::registerFileVariables(const QByteArray &prefix,
    const QString &heading, const StringFunction &base)
{
    registerVariable(prefix + kFilePathPostfix,
         QCoreApplication::translate("Core::VariableManager", "%1: Full path including file name.").arg(heading),
         [base]() { return QFileInfo(base()).filePath(); });

    registerVariable(prefix + kPathPostfix,
         QCoreApplication::translate("Core::VariableManager", "%1: Full path excluding file name.").arg(heading),
         [base]() { return QFileInfo(base()).path(); });

    registerVariable(prefix + kFileNamePostfix,
         QCoreApplication::translate("Core::VariableManager", "%1: File name without path.").arg(heading),
         [base]() { return QFileInfo(base()).fileName(); });

    registerVariable(prefix + kFileBaseNamePostfix,
         QCoreApplication::translate("Core::VariableManager", "%1: File base name without path and suffix.").arg(heading),
         [base]() { return QFileInfo(base()).baseName(); });
}
DriftingGratingStimulus::DriftingGratingStimulus(const ParameterValueMap &parameters) :
    StandardDynamicStimulus(parameters),
    xoffset(registerVariable(parameters[BasicTransformStimulus::X_POSITION])),
    yoffset(registerVariable(parameters[BasicTransformStimulus::Y_POSITION])),
    width(registerVariable(parameters[BasicTransformStimulus::X_SIZE])),
    height(registerVariable(parameters[BasicTransformStimulus::Y_SIZE])),
    rotation(registerVariable(parameters[BasicTransformStimulus::ROTATION])),
    alpha_multiplier(registerVariable(parameters[BasicTransformStimulus::ALPHA_MULTIPLIER])),
    spatial_frequency(registerVariable(parameters[FREQUENCY])),
    speed(registerVariable(parameters[SPEED])),
    starting_phase(registerVariable(parameters[STARTING_PHASE])),
    direction_in_degrees(registerVariable(parameters[DIRECTION]))
{
    const std::string &grating_type = parameters[GRATING_TYPE].str();
    shared_ptr<Variable> grating_sample_rate(parameters[GRATING_SAMPLE_RATE]);

	if (grating_type == "sinusoid") {
		grating = shared_ptr<SinusoidGratingData>(new SinusoidGratingData(grating_sample_rate));
	} else if (grating_type == "square") {
		grating = shared_ptr<SquareGratingData>(new SquareGratingData(grating_sample_rate));
	} else if (grating_type == "triangle") {
		grating = shared_ptr<TriangleGratingData>(new TriangleGratingData(grating_sample_rate));
	} else if (grating_type == "sawtooth") {
		grating = shared_ptr<SawtoothGratingData>(new SawtoothGratingData(grating_sample_rate, parameters[INVERTED]));
	} else {
		throw SimpleException("illegal grating type", grating_type);		
	}

    const std::string &mask_type = parameters[MASK].str();
	shared_ptr<Variable> mask_size(new ConstantVariable(128L));

	if (mask_type == "rectangle") {
		mask = shared_ptr<Mask>(new RectangleMask(mask_size));
	} else if (mask_type == "ellipse") {
		mask = shared_ptr<Mask>(new EllipseMask(mask_size));
	} else if (mask_type == "gaussian") {
		mask = shared_ptr<Mask>(new GaussianMask(mask_size, parameters[MEAN], parameters[STD_DEV]));
	} else {
		throw SimpleException("illegal mask", mask_type);				
	}
}
Esempio n. 9
0
BaseFrameListStimulus::BaseFrameListStimulus(const ParameterValueMap &parameters) :
    StandardDynamicStimulus(parameters),
    loop(registerVariable(parameters[LOOP])),
    repeats(registerVariable(parameters[REPEATS])),
    lastFrameDrawn(-1),
    didSetEnding(false),
    didSetEnded(false)
{
    // We need to use find() because "stimulus_group" isn't a valid parameter for all
    // BaseFrameListStimulus subclasses, meaning it won't always have a default value
    if ((parameters.find(STIMULUS_GROUP) != parameters.end()) && !(parameters[STIMULUS_GROUP].empty())) {
        stimulusGroup = StimulusGroupPtr(parameters[STIMULUS_GROUP]);
    }
    
    // Ditto for "ending"
    if ((parameters.find(ENDING) != parameters.end()) && !(parameters[ENDING].empty())) {
        ending = VariablePtr(parameters[ENDING]);
    }
    
    if (!(parameters[ENDED].empty())) {
        ended = VariablePtr(parameters[ENDED]);
    }
}
Esempio n. 10
0
void IBHierarchyIntegrator::registerLoadBalancer(Pointer<LoadBalancer<NDIM> > load_balancer)
{
#if !defined(NDEBUG)
    TBOX_ASSERT(load_balancer);
#endif
    d_load_balancer = load_balancer;
    if (d_workload_idx == -1)
    {
        d_workload_var = new CellVariable<NDIM, double>(d_object_name + "::workload");
        registerVariable(d_workload_idx, d_workload_var, 0, getCurrentContext());
    }
    d_ib_method_ops->registerLoadBalancer(load_balancer, d_workload_idx);
    return;
} // registerLoadBalancer
Esempio n. 11
0
MovingDots::MovingDots(const ParameterValueMap &parameters) :
    StandardDynamicStimulus(parameters),
    fieldRadius(registerVariable(parameters[FIELD_RADIUS])),
    fieldCenterX(registerVariable(parameters[FIELD_CENTER_X])),
    fieldCenterY(registerVariable(parameters[FIELD_CENTER_Y])),
    dotDensity(registerVariable(parameters[DOT_DENSITY])),
    dotSize(registerVariable(parameters[DOT_SIZE])),
    alpha(registerVariable(parameters[ALPHA_MULTIPLIER])),
    direction(registerVariable(parameters[DIRECTION])),
    speed(registerVariable(parameters[SPEED])),
    coherence(registerVariable(parameters[COHERENCE])),
    lifetime(registerVariable(parameters[LIFETIME])),
    announceDots(parameters[ANNOUNCE_DOTS]),
    previousFieldRadius(1.0f),
    currentFieldRadius(1.0f),
    previousNumDots(0),
    currentNumDots(0),
    previousSpeed(0.0f),
    currentSpeed(0.0f),
    previousCoherence(1.0f),
    currentCoherence(1.0f),
    previousLifetime(0.0f),
    currentLifetime(0.0f),
    dotSizeToPixels(0.0f),
    previousTime(-1),
    currentTime(-1)
{
    ParsedColorTrio color(parameters[COLOR]);
    red = registerVariable(color.getR());
    green = registerVariable(color.getG());
    blue = registerVariable(color.getB());
    
    if (parameters[RAND_SEED].empty()) {
        randSeed = Clock::instance()->getSystemTimeNS();
    } else {
        randSeed = MWTime(parameters[RAND_SEED]);
    }
    randGen.seed(randSeed);
}
void
AdvDiffPredictorCorrectorHierarchyIntegrator::initializeHierarchyIntegrator(
    Pointer<PatchHierarchy<NDIM> > hierarchy,
    Pointer<GriddingAlgorithm<NDIM> > gridding_alg)
{
    if (d_integrator_is_initialized) return;

    d_hierarchy = hierarchy;
    d_gridding_alg = gridding_alg;
    Pointer<CartesianGridGeometry<NDIM> > grid_geom = d_hierarchy->getGridGeometry();

    // Initialize the HyperbolicPatchStrategy and HyperbolicLevelIntegrator
    // objects that provide numerical routines for explicitly integrating the
    // advective terms.
    d_hyp_patch_ops = new AdvDiffPredictorCorrectorHyperbolicPatchOps(
        d_object_name+"::AdvDiffPredictorCorrectorHyperbolicPatchOps",
        d_hyp_patch_ops_db,
        d_explicit_predictor,
        grid_geom,
        d_registered_for_restart);
    d_hyp_level_integrator = new HyperbolicLevelIntegrator<NDIM>(
        d_object_name+"::HyperbolicLevelIntegrator",
        d_hyp_level_integrator_db,
        d_hyp_patch_ops,
        d_registered_for_restart,
        /*using_time_refinement*/ false);

    // Setup variable contexts.
    d_current_context = d_hyp_level_integrator->getCurrentContext();
    d_new_context     = d_hyp_level_integrator->getNewContext();

    // Register the VisIt data writer with the patch strategy object, which is
    // the object that actually registers variables for plotting.
    if (d_visit_writer)
    {
        d_hyp_patch_ops->registerVisItDataWriter(d_visit_writer);
    }

    // Register variables with the hyperbolic level integrator.
    for (std::vector<Pointer<FaceVariable<NDIM,double> > >::const_iterator cit = d_u_var.begin(); cit != d_u_var.end(); ++cit)
    {
        Pointer<FaceVariable<NDIM,double> > u_var = *cit;
        d_hyp_patch_ops->registerAdvectionVelocity(u_var);
        d_hyp_patch_ops->setAdvectionVelocityIsDivergenceFree(u_var,d_u_is_div_free[u_var]);
        if (d_u_fcn[u_var]) d_hyp_patch_ops->setAdvectionVelocityFunction(u_var,d_u_fcn[u_var]);
    }

    const IntVector<NDIM> cell_ghosts = CELLG;
    for (std::vector<Pointer<CellVariable<NDIM,double> > >::const_iterator cit = d_F_var.begin(); cit != d_F_var.end(); ++cit)
    {
        Pointer<CellVariable<NDIM,double> > F_var = *cit;
        d_hyp_level_integrator->registerVariable(
            F_var, cell_ghosts,
            HyperbolicLevelIntegrator<NDIM>::TIME_DEP,
            d_hierarchy->getGridGeometry(),
            "CONSERVATIVE_COARSEN",
            "CONSERVATIVE_LINEAR_REFINE");
    }

    for (std::vector<Pointer<SideVariable<NDIM,double> > >::const_iterator cit = d_diffusion_coef_var.begin(); cit != d_diffusion_coef_var.end(); ++cit)
    {
        Pointer<SideVariable<NDIM,double> > D_var = *cit;
        d_hyp_level_integrator->registerVariable(
            D_var, cell_ghosts,
            HyperbolicLevelIntegrator<NDIM>::TIME_DEP,
            d_hierarchy->getGridGeometry(),
            "CONSERVATIVE_COARSEN",
            "CONSERVATIVE_LINEAR_REFINE");
        int D_scratch_idx;
        registerVariable(D_scratch_idx, D_var, cell_ghosts, getScratchContext());
    }

    for (std::vector<Pointer<SideVariable<NDIM,double> > >::const_iterator cit = d_diffusion_coef_rhs_var.begin(); cit != d_diffusion_coef_rhs_var.end(); ++cit)
    {
        Pointer<SideVariable<NDIM,double> > D_rhs_var = *cit;
        int D_rhs_scratch_idx;
        registerVariable(D_rhs_scratch_idx, D_rhs_var, cell_ghosts, getScratchContext());
    }

    for (std::vector<Pointer<CellVariable<NDIM,double> > >::const_iterator cit = d_Q_rhs_var.begin(); cit != d_Q_rhs_var.end(); ++cit)
    {
        Pointer<CellVariable<NDIM,double> > Q_rhs_var = *cit;
        int Q_rhs_scratch_idx;
        registerVariable(Q_rhs_scratch_idx, Q_rhs_var, cell_ghosts, getScratchContext());
        d_hyp_patch_ops->registerSourceTerm(Q_rhs_var);
    }

    for (std::vector<Pointer<CellVariable<NDIM,double> > >::const_iterator cit = d_Q_var.begin(); cit != d_Q_var.end(); ++cit)
    {
        Pointer<CellVariable<NDIM,double> > Q_var = *cit;
        int Q_scratch_idx;
        registerVariable(Q_scratch_idx, Q_var, cell_ghosts, getScratchContext());
        d_hyp_patch_ops->registerTransportedQuantity(Q_var);
        if (d_Q_u_map[Q_var]) d_hyp_patch_ops->setAdvectionVelocity(Q_var,d_Q_u_map[Q_var]);
        d_hyp_patch_ops->setSourceTerm(Q_var,d_Q_Q_rhs_map[Q_var]);
        d_hyp_patch_ops->setConvectiveDifferencingType(Q_var,d_Q_difference_form[Q_var]);
        if (d_Q_init[Q_var]) d_hyp_patch_ops->setInitialConditions(Q_var,d_Q_init[Q_var]);
        if (!d_Q_bc_coef[Q_var].empty()) d_hyp_patch_ops->setPhysicalBcCoefs(Q_var,d_Q_bc_coef[Q_var]);
    }

    // Initialize the HyperbolicLevelIntegrator.
    //
    // WARNING: This must be done AFTER all variables have been registered with
    // the level integrator.
    d_hyp_level_integrator->initializeLevelIntegrator(d_gridding_alg);

    // Perform hierarchy initialization operations common to all implementations
    // of AdvDiffHierarchyIntegrator.
    AdvDiffHierarchyIntegrator::initializeHierarchyIntegrator(hierarchy, gridding_alg);

    // Indicate that the integrator has been initialized.
    d_integrator_is_initialized = true;
    return;
}// initializeHierarchyIntegrator
Esempio n. 13
0
void IBHierarchyIntegrator::initializeHierarchyIntegrator(
    Pointer<PatchHierarchy<NDIM> > hierarchy,
    Pointer<GriddingAlgorithm<NDIM> > gridding_alg)
{
    if (d_integrator_is_initialized) return;

    d_hierarchy = hierarchy;
    d_gridding_alg = gridding_alg;

    // Obtain the Hierarchy data operations objects.
    HierarchyDataOpsManager<NDIM>* hier_ops_manager =
        HierarchyDataOpsManager<NDIM>::getManager();
    d_hier_velocity_data_ops = hier_ops_manager->getOperationsDouble(d_u_var, hierarchy, true);
    d_hier_pressure_data_ops = hier_ops_manager->getOperationsDouble(d_p_var, hierarchy, true);
    d_hier_cc_data_ops = hier_ops_manager->getOperationsDouble(
        new CellVariable<NDIM, double>("cc_var"), hierarchy, true);

    // Initialize all variables.
    VariableDatabase<NDIM>* var_db = VariableDatabase<NDIM>::getDatabase();

    const IntVector<NDIM> ib_ghosts = d_ib_method_ops->getMinimumGhostCellWidth();
    const IntVector<NDIM> ghosts = 1;

    d_u_idx = var_db->registerVariableAndContext(d_u_var, d_ib_context, ib_ghosts);
    d_f_idx = var_db->registerVariableAndContext(d_f_var, d_ib_context, ghosts);
    if (d_time_stepping_type == TRAPEZOIDAL_RULE)
    {
        d_f_current_idx = var_db->registerClonedPatchDataIndex(d_f_var, d_f_idx);
    }
    else
    {
        d_f_current_idx = -1;
    }

    if (d_ib_method_ops->hasFluidSources())
    {
        d_p_idx = var_db->registerVariableAndContext(d_p_var, d_ib_context, ib_ghosts);
        d_q_idx = var_db->registerVariableAndContext(d_q_var, d_ib_context, ghosts);
    }
    else
    {
        d_q_var = NULL;
        d_q_idx = -1;
    }

    if (!d_mark_file_name.empty())
    {
        d_mark_var = new LMarkerSetVariable(d_object_name + "::markers");
        registerVariable(
            d_mark_current_idx, d_mark_new_idx, d_mark_scratch_idx, d_mark_var, ghosts);
    }

    // Initialize the fluid solver.
    if (d_ib_method_ops->hasFluidSources())
    {
        d_ins_hier_integrator->registerFluidSourceFunction(new IBEulerianSourceFunction(this));
    }
    d_ins_hier_integrator->initializeHierarchyIntegrator(hierarchy, gridding_alg);

    // Have the IB method ops object register any additional Eulerian variables
    // and communications algorithms that it requires.
    d_ib_method_ops->registerEulerianVariables();
    d_ib_method_ops->registerEulerianCommunicationAlgorithms();

    // Create several communications algorithms, used in filling ghost cell data
    // and synchronizing data on the patch hierarchy.
    Pointer<Geometry<NDIM> > grid_geom = d_hierarchy->getGridGeometry();

    const int u_new_idx = var_db->mapVariableAndContextToIndex(d_u_var, getNewContext());
    const int u_scratch_idx =
        var_db->mapVariableAndContextToIndex(d_u_var, getScratchContext());
    const int p_new_idx = var_db->mapVariableAndContextToIndex(d_p_var, getNewContext());
    const int p_scratch_idx =
        var_db->mapVariableAndContextToIndex(d_p_var, getScratchContext());

    Pointer<CellVariable<NDIM, double> > u_cc_var = d_u_var;
    Pointer<SideVariable<NDIM, double> > u_sc_var = d_u_var;
    if (u_cc_var)
    {
        d_u_phys_bdry_op =
            new CartCellRobinPhysBdryOp(u_scratch_idx,
                                        d_ins_hier_integrator->getVelocityBoundaryConditions(),
                                        /*homogeneous_bc*/ false);
    }
    else if (u_sc_var)
    {
        d_u_phys_bdry_op =
            new CartSideRobinPhysBdryOp(u_scratch_idx,
                                        d_ins_hier_integrator->getVelocityBoundaryConditions(),
                                        /*homogeneous_bc*/ false);
    }
    else
    {
        TBOX_ERROR(
            "IBHierarchyIntegrator::initializeHierarchy(): unsupported velocity data "
            "centering\n");
    }

    d_u_ghostfill_alg = new RefineAlgorithm<NDIM>();
    d_u_ghostfill_op = NULL;
    d_u_ghostfill_alg->registerRefine(d_u_idx, d_u_idx, d_u_idx, d_u_ghostfill_op);
    registerGhostfillRefineAlgorithm(
        d_object_name + "::u", d_u_ghostfill_alg, d_u_phys_bdry_op);

    d_u_coarsen_alg = new CoarsenAlgorithm<NDIM>();
    d_u_coarsen_op = grid_geom->lookupCoarsenOperator(d_u_var, "CONSERVATIVE_COARSEN");
    d_u_coarsen_alg->registerCoarsen(d_u_idx, d_u_idx, d_u_coarsen_op);
    registerCoarsenAlgorithm(d_object_name + "::u::CONSERVATIVE_COARSEN", d_u_coarsen_alg);

    d_f_prolong_alg = new RefineAlgorithm<NDIM>();
    d_f_prolong_op = grid_geom->lookupRefineOperator(d_f_var, "CONSERVATIVE_LINEAR_REFINE");
    d_f_prolong_alg->registerRefine(d_f_idx, d_f_idx, d_f_idx, d_f_prolong_op);
    registerProlongRefineAlgorithm(d_object_name + "::f", d_f_prolong_alg);

    if (d_ib_method_ops->hasFluidSources())
    {
        Pointer<CellVariable<NDIM, double> > p_cc_var = d_p_var;
        if (p_cc_var)
        {
            d_p_phys_bdry_op = new CartCellRobinPhysBdryOp(
                p_scratch_idx,
                d_ins_hier_integrator->getPressureBoundaryConditions(),
                /*homogeneous_bc*/ false);
        }
        else
        {
            TBOX_ERROR(
                "IBHierarchyIntegrator::initializeHierarchy(): unsupported pressure data "
                "centering\n");
        }

        d_p_ghostfill_alg = new RefineAlgorithm<NDIM>();
        d_p_ghostfill_op = NULL;
        d_p_ghostfill_alg->registerRefine(d_p_idx, d_p_idx, d_p_idx, d_p_ghostfill_op);
        registerGhostfillRefineAlgorithm(
            d_object_name + "::p", d_p_ghostfill_alg, d_p_phys_bdry_op);

        d_p_coarsen_alg = new CoarsenAlgorithm<NDIM>();
        d_p_coarsen_op = grid_geom->lookupCoarsenOperator(d_p_var, "CONSERVATIVE_COARSEN");
        d_p_coarsen_alg->registerCoarsen(d_p_idx, d_p_idx, d_p_coarsen_op);
        registerCoarsenAlgorithm(d_object_name + "::p::CONSERVATIVE_COARSEN", d_p_coarsen_alg);

        d_q_prolong_alg = new RefineAlgorithm<NDIM>();
        d_q_prolong_op =
            grid_geom->lookupRefineOperator(d_q_var, "CONSERVATIVE_LINEAR_REFINE");
        d_q_prolong_alg->registerRefine(d_q_idx, d_q_idx, d_q_idx, d_q_prolong_op);
        registerProlongRefineAlgorithm(d_object_name + "::q", d_q_prolong_alg);
    }

    Pointer<RefineAlgorithm<NDIM> > refine_alg = new RefineAlgorithm<NDIM>();
    Pointer<RefineOperator<NDIM> > refine_op;
    refine_op = grid_geom->lookupRefineOperator(d_u_var, "CONSERVATIVE_LINEAR_REFINE");
    refine_alg->registerRefine(u_scratch_idx, u_new_idx, u_scratch_idx, refine_op);
    refine_op = grid_geom->lookupRefineOperator(d_p_var, "LINEAR_REFINE");
    refine_alg->registerRefine(p_scratch_idx, p_new_idx, p_scratch_idx, refine_op);
    ComponentSelector instrumentation_data_fill_bc_idxs;
    instrumentation_data_fill_bc_idxs.setFlag(u_scratch_idx);
    instrumentation_data_fill_bc_idxs.setFlag(p_scratch_idx);
    RefinePatchStrategy<NDIM>* refine_patch_bdry_op =
        new CartExtrapPhysBdryOp(instrumentation_data_fill_bc_idxs, "LINEAR");
    registerGhostfillRefineAlgorithm(
        d_object_name + "::INSTRUMENTATION_DATA_FILL", refine_alg, refine_patch_bdry_op);

    // Read in initial marker positions.
    if (!d_mark_file_name.empty())
    {
        LMarkerUtilities::readMarkerPositions(
            d_mark_init_posns, d_mark_file_name, hierarchy->getGridGeometry());
    }

    // Setup the tag buffer.
    const int finest_hier_ln = gridding_alg->getMaxLevels() - 1;
    const int tsize = d_tag_buffer.size();
    d_tag_buffer.resizeArray(finest_hier_ln);
    for (int i = tsize; i < finest_hier_ln; ++i) d_tag_buffer[i] = 0;
    for (int i = std::max(tsize, 1); i < d_tag_buffer.size(); ++i)
    {
        d_tag_buffer[i] = d_tag_buffer[i - 1];
    }
    d_ib_method_ops->setupTagBuffer(d_tag_buffer, d_gridding_alg);

    // Indicate that the integrator has been initialized.
    d_integrator_is_initialized = true;
    return;
} // initializeHierarchyIntegrator
VariablePtr FreezableCollection::registerVariable(const ParameterValue &param, bool check_for_duplicates) {
    return registerVariable(VariablePtr(param), check_for_duplicates);
}