Example #1
0
    virtual void setup_potential(){
        auto compot = new pele::CombinedPotential();
        compot->add_potential(std::make_shared<pele::LJCutAtomList>(c6, c12, rcut, atomsA));
        compot->add_potential(std::make_shared<pele::LJCutAtomList>(c6, c12, rcut, atomsA, atomsB));
        compot->add_potential(std::make_shared<pele::LJCutAtomList>(c6, c12, rcut, atomsB));

        pot = std::shared_ptr<pele::BasePotential> (compot);

    }
Example #2
0
void apot_init(void)
{
  int   i;

  add_pot(lj, 2);
  add_pot(eopp, 6);
  add_pot(morse, 3);
#ifdef COULOMB
  add_potential("ms", 3, &ms_shift);
  add_potential("buck", 3, &buck_shift);
#else
  add_potential("ms", 3, &ms_value);
  add_potential("buck", 3, &buck_value);
#endif /* COULOMB */
  add_pot(softshell, 2);
  add_pot(eopp_exp, 6);
  add_pot(meopp, 7);
  add_pot(power, 2);
  add_pot(power_decay, 2);
  add_pot(exp_decay, 2);
  add_pot(bjs, 3);
  add_pot(parabola, 3);
  add_pot(csw, 4);
  add_pot(universal, 4);
  add_pot(const, 1);
  add_pot(sqrt, 2);
  add_pot(mexp_decay, 3);
  add_pot(strmm, 5);
  add_pot(double_morse, 7);
  add_pot(double_exp, 5);
  add_pot(poly_5, 5);
  add_pot(kawamura, 9);
  add_pot(kawamura_mix, 12);
  add_pot(exp_plus, 3);
  add_pot(mishin, 6);
  add_pot(gen_lj, 5);
  add_pot(gljm, 12);
  add_pot(vas, 2);
  add_pot(vpair, 7);
  add_pot(csw2, 4);
  add_pot(sheng_phi1, 5);
  add_pot(sheng_phi2, 4);
  add_pot(sheng_rho, 5);
  add_pot(sheng_F, 4);

#ifdef STIWEB
  add_pot(stiweb_2, 6);
  add_pot(stiweb_3, 2);
  add_pot(lambda, (int)(0.5 * ntypes * ntypes * (ntypes + 1)));
#endif /* STIWEB */

#ifdef TERSOFF
  add_pot(tersoff_pot, 11);
  add_pot(tersoff_mix, 2);
#endif /* TERSOFF */

  reg_for_free(function_table.name, "function_table.name");
  reg_for_free(function_table.n_par, "function_table.n_par");
  reg_for_free(function_table.fvalue, "function_table.fvalue");
  for (i = 0; i < n_functions; i++)
    reg_for_free(function_table.name[i], "function_table.name[i]");

  return;
}
Example #3
0
std::shared_ptr<Model> Deserno2005ModelFactory::create() const {
    auto model = std::make_shared<Model>(num_lipid * 3);

    std::shared_ptr<FENEBondPotential> head_tail_bond(
        new FENEBondPotential(
            /* r0= */1.5*sigma,
            /* k = */30*epsilon/sigma/sigma,
            /* b = */0.95*sigma,
            /* e = */epsilon));
    for (std::size_t i(0); i < num_lipid; ++i)
        head_tail_bond->add_bond(std::make_pair(i*3, i*3+1));
    model->add_potential(head_tail_bond);

    std::shared_ptr<FENEBondPotential> tail_tail_bond(
        new FENEBondPotential(
            /* r0= */1.5*sigma,
            /* k = */30*epsilon/sigma/sigma,
            /* b = */sigma,
            /* e = */epsilon));
    for (std::size_t i(0); i < num_lipid; ++i)
        tail_tail_bond->add_bond(std::make_pair(i*3+1, i*3+2));
    model->add_potential(tail_tail_bond);

    std::shared_ptr<LowestOrderHarmonicBendPotential> bend(
        new LowestOrderHarmonicBendPotential(
            /* r0= */4*sigma,
            /* k = */10*epsilon/sigma/sigma));
    for (std::size_t i(0); i < num_lipid; ++i)
        bend->add_pair(std::make_pair(i*3, i*3+2));
    model->add_potential(bend);

    std::shared_ptr<WeeksChandlerAndersonPotential> head_head_replusion(
        new WeeksChandlerAndersonPotential(
            /* s= */0.95*sigma,
            /* e= */epsilon));
    head_head_replusion->set_pair("LH", "LH");
    model->add_potential(head_head_replusion);

    std::shared_ptr<WeeksChandlerAndersonPotential> head_tail_replusion(
        new WeeksChandlerAndersonPotential(
            /* s= */0.95*sigma,
            /* e= */epsilon));
    head_tail_replusion->set_pair("LH", "LT");
    model->add_potential(head_tail_replusion);

    std::shared_ptr<WeeksChandlerAndersonPotential> tail_tail_replusion(
        new WeeksChandlerAndersonPotential(
            /* s= */sigma,
            /* e= */epsilon));
    tail_tail_replusion->set_pair("LT", "LT");
    model->add_potential(tail_tail_replusion);

    std::shared_ptr<TailsAttractionPotential> tails_attraction(
        new TailsAttractionPotential(
            /* r_c= */pow(2,1.0/6.0)*sigma,
            /* w_c= */w_c,
            /* e =  */epsilon));
    tails_attraction->set_pair("LT", "LT");
    model->add_potential(tails_attraction);

    return model;
}