Example #1
0
 public SimulationBase(MoleculeList ms, LabelingPositionList lps, DistanceList ds)
 {
     this.Molecules         = ms;
     this.LabelingPositions = lps;
     this.Distances         = ds;
     InitRnd();
 }
Example #2
0
        private void AVinterface_Load(object sender, EventArgs e)
        {
            rmptextBox.Text = "Ready";
            moleculescomboBox.Items.Clear();
            if (_standalone)
            {
                _molecules = new MoleculeList(20);
            }
            for (Int32 i = 0; i < _molecules.Count; i++)
            {
                moleculescomboBox.Items.Add(_molecules[i].Name);
            }
            if (moleculescomboBox.Items.Count > 0)
            {
                moleculescomboBox.SelectedIndex = 0;
            }
            calculatebutton.Enabled = (_molecules.Count > 0);

            // load default dye parameters
            dyescomboBox.Items.AddRange(LinkerData.LinkerList);
            dyescomboBox.SelectedIndex = 0;

            simcombobox.SelectedIndex = 0;

            _labelpos          = new LabelingPositionList();
            savebutton.Enabled = false;
            addbutton.Enabled  = false;
        }
Example #3
0
        /// <summary>
        /// Combines units into one "molecule" (mainly to be able to redo AV). Only a few properties are copied
        /// </summary>
        /// <param name="sr">Structure</param>
        public Molecule(SimulationResult sr)
        {
            MoleculeList units = sr.Molecules;

            Prepared     = false;
            Name         = "Structure " + sr.InternalNumber.ToString();
            FullFileName = "";
            Error        = "";

            NAtoms = 0;
            for (int i = 0; i < units.Count; i++)
            {
                NAtoms += units[i].NAtoms;
            }

            AtomMass = new double[NAtoms];
            vdWR     = new double[NAtoms];

            OriginalAtomID = new int[NAtoms];
            Atoms          = new string[NAtoms];
            AtomsStandard  = new string[NAtoms];
            Mass           = 0.0;
            CM             = new Vector3();
            Molecule m, m0 = units[0];
            int      n = 0;
            Vector3  r;

            // local coordinates
            XLocal = new double[NAtoms];
            YLocal = new double[NAtoms];
            ZLocal = new double[NAtoms];

            for (int i = 0; i < units.Count; i++)
            {
                m = units[i];
                for (int j = 0; j < m.NAtoms; j++)
                {
                    r = sr.Rotation[i] * (new Vector3(m.XLocal[j], m.YLocal[j], m.ZLocal[j]))
                        - m0.CM + m.CM + sr.Translation[i];
                    XLocal[n]         = r.X;
                    YLocal[n]         = r.Y;
                    ZLocal[n]         = r.Z;
                    AtomMass[n]       = m.AtomMass[j];
                    vdWR[n]           = m.vdWR[j];
                    OriginalAtomID[n] = m.OriginalAtomID[j];
                    Atoms[n]          = m.Atoms[j];
                    AtomsStandard[n]  = m.AtomsStandard[j];
                    n++;
                }
            }
        }
Example #4
0
 public SpringEngine(MoleculeList ms, LabelingPositionList ls, DistanceList ds) : base(ms, ls, ds)
 {
     this.Nmolecules = ms.Count;
     translation     = new Vector3[Nmolecules];
     rotation        = new Matrix3[Nmolecules];
     translationm1   = new Vector3[Nmolecules];
     rotationm1      = new Matrix3[Nmolecules];
     translationm2   = new Vector3[Nmolecules];
     rotationm2      = new Matrix3[Nmolecules];
     for (int i = 0; i < Nmolecules; i++)
     {
         rotation[i]   = Matrix3.E;
         rotationm1[i] = Matrix3.E;
     }
     force  = new Vector3[Nmolecules];
     torque = new Vector3[Nmolecules];
 }
Example #5
0
 public ErrorEstimation(MoleculeList ms, LabelingPositionList ls, DistanceList ds) : base(ms, ls, ds)
 {
 }
Example #6
0
 public Refinement(MoleculeList ms, LabelingPositionList ls, DistanceList ds) : base(ms, ls, ds)
 {
 }
Example #7
0
        private double Elast; // energy after last iteration

        public MetropolisSampler(MoleculeList ms, LabelingPositionList ls, DistanceList ds) : base(ms, ls, ds)
        {
            this.IsContinuous = true;
        }
Example #8
0
 public AVinterface(MoleculeList ms)
 {
     _molecules  = ms;
     _standalone = false;
     InitializeComponent();
 }