/*! \brief * Creates a static base for position calculation. * * \param pc Data structure to copy. * \returns Pointer to a newly allocated base for \p pc. * * Creates and returns a deep copy of \p pc, but clears the * \ref POS_DYNAMIC and \ref POS_MASKONLY flags. * The newly created structure is set as the base (\c gmx_ana_poscalc_t::sbase) * of \p pc and inserted in the collection before \p pc. */ static gmx_ana_poscalc_t * create_simple_base(gmx_ana_poscalc_t *pc) { gmx_ana_poscalc_t *base; int flags; flags = pc->flags & ~(POS_DYNAMIC | POS_MASKONLY); base = pc->coll->createCalculation(pc->type, flags); set_poscalc_maxindex(base, &pc->gmax, true); snew(base->p, 1); pc->sbase = base; pc->coll->removeCalculation(base); pc->coll->insertCalculation(base, pc); return base; }
/*! \brief * Creates a static base for position calculation. * * \param pc Data structure to copy. * \returns Pointer to a newly allocated base for \p pc. * * Creates and returns a deep copy of \p pc, but clears the * \ref POS_DYNAMIC and \ref POS_MASKONLY flags. * The newly created structure is set as the base (\c gmx_ana_poscalc_t::sbase) * of \p pc and inserted in the collection before \p pc. */ static gmx_ana_poscalc_t * create_simple_base(gmx_ana_poscalc_t *pc) { gmx_ana_poscalc_t *base; int flags; int rc; flags = pc->flags & ~(POS_DYNAMIC | POS_MASKONLY); rc = gmx_ana_poscalc_create(&base, pc->coll, pc->type, flags); if (rc != 0) { gmx_fatal(FARGS, "position calculation base creation failed"); } set_poscalc_maxindex(base, &pc->gmax, TRUE); snew(base->p, 1); pc->sbase = base; remove_poscalc(base); insert_poscalc(base, pc); return base; }
/*! * \param[in,out] pc Position calculation data structure. * \param[in] g Maximum index group for the calculation. * * Subsequent calls to gmx_ana_poscalc_update() should use only subsets of * \p g for evaluation. * * The topology should have been set for the collection of which \p pc is * a member. */ void gmx_ana_poscalc_set_maxindex(gmx_ana_poscalc_t *pc, gmx_ana_index_t *g) { set_poscalc_maxindex(pc, g, FALSE); setup_base(pc); }