Beispiel #1
0
        public IMatrix DampingMatrix(IElement element)
        {
            IMatrix damping = BuildStiffnessMatrix();

            damping.ScaleIntoThis(dynamicProperties.RayleighCoeffStiffness);
            damping.AxpyIntoThis(MassMatrix(element), dynamicProperties.RayleighCoeffMass);
            return(damping);
        }
Beispiel #2
0
        private IMatrixView CalculateEffectiveMatrixInternal(ImplicitIntegrationCoefficients coefficients, ISubdomain subdomain)
        {
            int     id     = subdomain.ID;
            IMatrix matrix = this.Ks[id];

            matrix.LinearCombinationIntoThis(coefficients.Stiffness, Ms[id], coefficients.Mass);
            matrix.AxpyIntoThis(Cs[id], coefficients.Damping);
            return(matrix);
        }
Beispiel #3
0
        public virtual IMatrix DampingMatrix(IElement element)
        {
            IMatrix damping = StiffnessMatrix(element);

            damping.ScaleIntoThis(dynamicProperties.RayleighCoeffStiffness);
            damping.AxpyIntoThis(MassMatrix(element), dynamicProperties.RayleighCoeffMass);
            //IMatrix damping = null;
            return(damping);
        }
Beispiel #4
0
        public IMatrixView LinearCombinationOfMatricesIntoStiffness(ImplicitIntegrationCoefficients coefficients,
                                                                    ISubdomain subdomain)
        {
            //TODO: 1) Why do we want Ks to be built only if it has not been factorized?
            //      2) When calling Ks[id], the matrix will be built anyway, due to the annoying side effects of the property.
            //         Therefore, if the matrix was indeed factorized it would be built twice!
            //      3) The provider should be decoupled from solver logic, such as knowing if the matrix is factorized. Knowledge
            //         that the matrix has been altered by the solver could be implemented by observers, if necessary.
            //      4) The analyzer should decide when global matrices need to be rebuilt, not the provider.
            //      5) The need to rebuild the system matrix if the solver has modified it might be avoidable if the analyzer
            //         uses the appropriate order of operations. However, that may not always be possible. Such a feature
            //         (rebuild or store) is nice to have. Whow would be responsible, the solver, provider or assembler?
            //      6) If the analyzer needs the system matrix, then it can call solver.PreventFromOverwritingMatrix(). E.g.
            //          explicit dynamic analyzers would need to do that.
            //if (linearSystem.IsMatrixOverwrittenBySolver) BuildKs();

            int     id     = subdomain.ID;
            IMatrix matrix = this.StiffnessFreeFree[id];

            matrix.LinearCombinationIntoThis(coefficients.Stiffness, Mass[id], coefficients.Mass);
            matrix.AxpyIntoThis(Damping[id], coefficients.Damping);
            return(matrix);
        }
 /// <summary>
 /// Performs the operation:
 /// <paramref name="matrix1"/>[i, j] = <paramref name="matrix1"/>[i, j] + <paramref name="matrix2"/>[i, j],
 /// for 0 &lt;= i &lt; <see cref="IIndexable2D.NumRows"/>, 0 &lt;= j &lt; <see cref="IIndexable2D.NumColumns"/>.
 /// The resulting matrix overwrites the entries of <paramref name="matrix1"/>.
 /// </summary>
 /// <param name="matrix1">The first <see cref="IMatrix"/> operand. It must have as many rows and columns as
 ///     <paramref name="matrix2"/>.</param>
 /// <param name="matrix2">The second <see cref="IMatrixView"/> operand. It must have as many rows and columns as
 ///     <paramref name="matrix1"/>.</param>
 /// <exception cref="NonMatchingDimensionsException">Thrown if <paramref name="matrix1"/> and <paramref name="matrix2"/>
 ///     have a different number of <see cref="IIndexable2D.NumRows"/> or
 ///     <see cref="IIndexable2D.NumColumns"/>.</exception>
 /// <exception cref="PatternModifiedException">Thrown if an <paramref name="matrix1"/>[i, j] needs to be
 ///     overwritten, but that is not permitted by the matrix storage format.</exception>
 public static void AddIntoThis(this IMatrix matrix1, IMatrixView matrix2) => matrix1.AxpyIntoThis(matrix2, 1.0);