MdFeneSpring

SimulationBuilder > Shared > ParticleBuildingBlocks?

FENE springs are one type of spring that may be used to join MdBeads in Glotzilla simulations. FENE stands for Finitely Extensible Non-linear Elastic.

Synopsis

class SixtyFourBeadPolymer : public MdPolymer
{
        public:
                SixtyFourBeadPolymer()
                {
                        //declare a vector to save all beads (for connecting them later
                        std::vector <MdBead *> bead;
                        
                        //make beads in a loop
                        for(int i=0; i<4; i++)
                                for(int j=0; j<4; j++)
                                        for(int k=0; k<4; k++)
                                        {
                                                MdBead *b = new MdBead;
                                                b -> SetPosition(i, j, k);
                                                AddBead(b);
                                                bead.push_back(b);
                                        }
                        
                        //connect the beads using FENE springs
                        for(int i=0; i< bead.size() -1; i++)
                        {
                                MdFeneSpring *s = new MdFeneSpring;
                                s -> SetTargetExtent(10.0);
                                s -> Connect(bead[i], bead[i+1]);
                                AddSpring(s);
                        }
                }
};

FENE Spring, MATDL wiki