Beispiel #1
0
        /// <summary>
        /// Zero the DM pool
        /// </summary>
        /// <param name="pool">Pool to zero</param>
        public static void ZeroDMPool(ref DM_Pool pool)
        {
            int pe;

            pool.DM = 0;
            for (pe = (int)TOMElement.n; pe <= (int)TOMElement.s; pe++)
            {
                pool.Nu[pe] = 0;
            }
            pool.AshAlk = 0;
        }
Beispiel #2
0
        /// <summary>
        /// Zero the DM pool
        /// </summary>
        /// <param name="Pool">Pool to zero</param>
        public static void ZeroDMPool(ref DM_Pool Pool)
        {
            int pe;

            Pool.DM = 0;
            for (pe = (int)TOMElement.N; pe <= (int)TOMElement.S; pe++)
            {
                Pool.Nu[pe] = 0;
            }
            Pool.AshAlk = 0;
        }
Beispiel #3
0
        /// <summary>
        /// Add dry matter pool to the total pool
        /// </summary>
        /// <param name="partPool">Part pool to add</param>
        /// <param name="totPool">Total pool</param>
        public static void AddDMPool(DM_Pool partPool, DM_Pool totPool)
        {
            int n = (int)GrazType.TOMElement.n;
            int p = (int)GrazType.TOMElement.p;
            int s = (int)GrazType.TOMElement.s;

            totPool.DM     = totPool.DM + partPool.DM;
            totPool.Nu[n]  = totPool.Nu[n] + partPool.Nu[n];
            totPool.Nu[p]  = totPool.Nu[p] + partPool.Nu[p];
            totPool.Nu[s]  = totPool.Nu[s] + partPool.Nu[s];
            totPool.AshAlk = totPool.AshAlk + partPool.AshAlk;
        }
Beispiel #4
0
        /// <summary>
        /// Add dry matter pool to the total pool
        /// </summary>
        /// <param name="PartPool"></param>
        /// <param name="TotPool"></param>
        static public void AddDMPool(DM_Pool PartPool, DM_Pool TotPool)
        {
            int N = (int)GrazType.TOMElement.N;
            int P = (int)GrazType.TOMElement.P;
            int S = (int)GrazType.TOMElement.S;

            TotPool.DM     = TotPool.DM + PartPool.DM;
            TotPool.Nu[N]  = TotPool.Nu[N] + PartPool.Nu[N];
            TotPool.Nu[P]  = TotPool.Nu[P] + PartPool.Nu[P];
            TotPool.Nu[S]  = TotPool.Nu[S] + PartPool.Nu[S];
            TotPool.AshAlk = TotPool.AshAlk + PartPool.AshAlk;
        }
Beispiel #5
0
        /// <summary>
        /// Multiply the DM pool
        /// </summary>
        /// <param name="aPool"></param>
        /// <param name="fScale"></param>
        /// <returns></returns>
        static public DM_Pool MultiplyDMPool(DM_Pool aPool, double fScale)
        {
            DM_Pool Result = new DM_Pool();

            Result.DM = fScale * aPool.DM;
            for (int Elem = (int)TOMElement.N; Elem <= (int)TOMElement.S; Elem++)
            {
                Result.Nu[Elem] = fScale * aPool.Nu[Elem];
            }
            Result.AshAlk = fScale * aPool.AshAlk;
            return(Result);
        }
Beispiel #6
0
        /// <summary>
        /// Multiply the DM pool
        /// </summary>
        /// <param name="pool">Dry matter pool</param>
        /// <param name="scale">Scale value</param>
        /// <returns>The scaled dry matter pool</returns>
        public static DM_Pool MultiplyDMPool(DM_Pool pool, double scale)
        {
            DM_Pool result = new DM_Pool();

            result.DM = scale * pool.DM;
            for (int elem = (int)TOMElement.n; elem <= (int)TOMElement.s; elem++)
            {
                result.Nu[elem] = scale * pool.Nu[elem];
            }
            result.AshAlk = scale * pool.AshAlk;

            return(result);
        }
Beispiel #7
0
 /// <summary>
 /// Rescale the DM pool
 /// </summary>
 /// <param name="aPool">The pool to scale</param>
 /// <param name="proportion">The proportion amount</param>
 /// <returns></returns>
 public static DM_Pool PoolFraction(DM_Pool aPool, double proportion)
 {
     return(MultiplyDMPool(aPool, proportion));
 }
Beispiel #8
0
 /// <summary>
 /// Rescale the DM pool
 /// </summary>
 /// <param name="aPool"></param>
 /// <param name="fPropn"></param>
 /// <returns></returns>
 static public DM_Pool PoolFraction(DM_Pool aPool, double fPropn)
 {
     return(MultiplyDMPool(aPool, fPropn));
 }