Esempio n. 1
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public Evolver(RunParams parms, VDelegate V, string outputDir)
        {
            m_gridSizeX            = parms.GridSize.Width;
            m_gridSizeY            = parms.GridSize.Height;
            m_latticeSpacing       = parms.LatticeSpacing;
            m_totalTime            = parms.TotalTime;
            m_deltaT               = parms.TimeStep;
            m_totalNumTimeSteps    = (int)Math.Round(parms.TotalTime / parms.TimeStep) + 1;
            m_currentTimeStepIndex = 0;

            m_mass1     = parms.Mass1;
            m_mass2     = parms.Mass2;
            m_potential = V;

            m_initialMomentum1 = new Vec2(parms.InitialWavePacketMomentum1);
            m_initialPosition1 = new Vec2(parms.InitialWavePacketCenter1);
            m_initialSize1     = new Vec2(parms.InitialWavePacketSize);

            m_initialPosition2 = new Vec2(parms.AtomCenter);
            m_sho_sigma        = parms.AtomSize;
            m_sho_N            = parms.Atom_N;
            m_sho_Lz           = parms.Atom_Lz;

            m_numFramesToSave = parms.NumFramesToSave;
            m_lastSavedFrame  = -1;
            m_outputDir       = outputDir;
            m_multiThread     = parms.MultiThread;

            m_visscherWf = null;
        }
Esempio n. 2
0
 public void FadeOut(FadeType type, VDelegate callback = null, float duration = 1.5f, GameObject screen_prefab = null)
 {
     this.m_FadeDuration = duration;
     Debug.Log(string.Concat(new string[]
     {
         "FadeSystem FadOut m_FadeIn = ",
         this.m_FadeIn.ToString(),
         " m_FadeOut = ",
         this.m_FadeOut.ToString(),
         " m_FadingIn ",
         this.m_FadingIn.ToString(),
         " m_FadingOut ",
         this.m_FadingOut.ToString()
     }));
     this.m_FadeType = type;
     this.m_FadeOut  = true;
     this.m_FadeIn   = false;
     this.m_FadingIn = false;
     this.m_Callback = callback;
     if (screen_prefab)
     {
         if (this.m_Screen)
         {
             UnityEngine.Object.Destroy(this.m_Screen);
             this.m_Screen = null;
         }
         GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(screen_prefab, Vector3.zero, Quaternion.identity);
         gameObject.name             = "FadeScreen";
         gameObject.transform.parent = base.transform;
         ((RectTransform)gameObject.transform).anchoredPosition = Vector3.zero;
         this.m_Screen = gameObject;
         this.m_ScreenAlphaController = gameObject.GetComponent <CanvasGroup>();
     }
     this.m_FadeOutTime = 0f;
 }
Esempio n. 3
0
 public void FadeIn(FadeType type, VDelegate callback = null, float duration = 1.5f)
 {
     this.m_FadeDuration = duration;
     Debug.Log(string.Concat(new string[]
     {
         "FadeSystem FadIn m_FadeIn = ",
         this.m_FadeIn.ToString(),
         " m_FadeOut = ",
         this.m_FadeOut.ToString(),
         " m_FadingIn ",
         this.m_FadingIn.ToString(),
         " m_FadingOut ",
         this.m_FadingOut.ToString()
     }));
     this.m_FadeType  = type;
     this.m_FadeIn    = true;
     this.m_FadeOut   = false;
     this.m_FadingOut = false;
     this.m_Callback  = callback;
     if (this.m_Screen)
     {
         this.m_ScreenFadingOut      = false;
         this.m_ScreenFadingIn       = true;
         this.m_StartScreenFadeAlpha = this.m_ScreenAlphaController.alpha;
         this.m_StartScreenFadeTime  = Time.time;
     }
     this.m_FadeInTime = 0f;
 }
Esempio n. 4
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public Evolver(RunParams parms, VDelegate V, string outputDir)
        {
            m_gridSizeX            = parms.GridSize.Width;
            m_gridSizeY            = parms.GridSize.Height;
            m_latticeSpacing       = parms.LatticeSpacing;
            m_totalTime            = parms.TotalTime;
            m_deltaT               = parms.TimeStep;
            m_totalNumTimeSteps    = (int)Math.Round(parms.TotalTime / parms.TimeStep) + 1;
            m_currentTimeStepIndex = 0;

            m_mass1       = parms.Mass1;
            m_mass2       = parms.Mass2;
            m_totalMass   = (parms.Mass1 + parms.Mass2);
            m_reducedMass = (parms.Mass1 * parms.Mass2) / m_totalMass;
            m_potential   = V;

            m_initialMomentum1 = new Vec2(parms.InitialWavePacketMomentum1);
            m_initialMomentum2 = new Vec2(parms.InitialWavePacketMomentum2);
            m_initialPosition1 = new Vec2(parms.InitialWavePacketCenter1);
            m_initialPosition2 = new Vec2(parms.InitialWavePacketCenter2);
            m_sigmaRel         = parms.InitialWavePacketSize * Math.Sqrt(m_totalMass / m_mass2);
            m_sigmaCm          = parms.InitialWavePacketSize * Math.Sqrt(m_mass1 / m_totalMass);

            m_dampingBorderWidth = parms.DampingBorderWidth;
            m_dampingFactor      = parms.DampingFactor;

            m_numFramesToSave = parms.NumFramesToSave;
            m_lastSavedFrame  = -1;
            m_outputDir       = outputDir;
            m_multiThread     = parms.MultiThread;

            m_visscherWf = null;
        }
Esempio n. 5
0
 /// <summary>
 /// Constructor.
 /// </summary>
 public Evolver(WaveFunction initialWf, float totalTime, float timeStep, VDelegate V, bool isVTimeDependent, float particleMass, int progressReportInterval,
                int dampingBorderWidth = 0, float dampingFactor = 0.0f, bool multiThread = true)
 {
     m_intialWf           = initialWf;
     m_totalTime          = totalTime;
     m_deltaT             = timeStep;
     m_totalNumTimeSteps  = (int)Math.Round(totalTime / timeStep) + 1;
     m_potential          = V;
     m_isTimeDependentV   = isVTimeDependent;
     m_particleMass       = particleMass;
     m_reportInterval     = progressReportInterval;
     m_dampingBorderWidth = dampingBorderWidth;
     m_dampingFactor      = dampingFactor;
     m_multiThread        = multiThread;
 }
Esempio n. 6
0
 public override void FadeIn(FadeType type, VDelegate callback = null, float duration = 1.5f)
 {
     duration = Mathf.Min(duration, 0.1f);
     base.FadeIn(type, callback, duration);
 }
Esempio n. 7
0
 public override void FadeOut(FadeType type, VDelegate callback = null, float duration = 1.5f, GameObject screen_prefab = null)
 {
     duration = Mathf.Min(duration, 0.1f);
     base.FadeOut(type, callback, duration, screen_prefab);
 }
Esempio n. 8
0
 public void RegisterVoid(VDelegate handler)
 {
     this.m_VDeleates.Add(handler.Method.Name, handler);
 }