Esempio n. 1
0
        public IDictionary <int, IVector> GetRhsFromHistoryLoad(int timeStep)
        {
            foreach (ISubdomain subdomain in model.Subdomains)
            {
                subdomain.Forces.Clear();                                                //TODO: this is also done by model.AssignLoads()
            }
            model.AssignLoads(solver.DistributeNodalLoads);
            model.AssignMassAccelerationHistoryLoads(timeStep);

            var rhsVectors = new Dictionary <int, IVector>();

            foreach (ISubdomain subdomain in model.Subdomains)
            {
                rhsVectors.Add(subdomain.ID, subdomain.Forces);
            }
            return(rhsVectors);
        }
Esempio n. 2
0
        public void Initialize(bool isFirstAnalysis = true)
        {
            if (isFirstAnalysis)
            {
                // The order in which the next initializations happen is very important.
                model.ConnectDataStructures();
                solver.OrderDofs(false);
                foreach (ILinearSystem linearSystem in linearSystems.Values)
                {
                    linearSystem.Reset(); // Necessary to define the linear system's size
                    linearSystem.Subdomain.Forces = Vector.CreateZero(linearSystem.Size);
                }
            }
            else
            {
                foreach (ILinearSystem linearSystem in linearSystems.Values)
                {
                    //TODO: Perhaps these shouldn't be done if an analysis has already been executed. The model will not be
                    //      modified. Why should the linear system be?
                    linearSystem.Reset();
                }
            }

            //TODO: Perhaps this should be called by the child analyzer
            BuildMatrices();

            // Loads must be created after building the matrices.
            //TODO: Some loads may not have to be recalculated each time the stiffness changes.
            model.AssignLoads(solver.DistributeNodalLoads);
            foreach (ILinearSystem linearSystem in linearSystems.Values)
            {
                linearSystem.RhsVector = linearSystem.Subdomain.Forces;
            }

            //InitializeCoefficients();
            InitializeInternalVectors();
            //InitializeMatrices();
            InitializeRhs();

            if (ChildAnalyzer == null)
            {
                throw new InvalidOperationException("Dynamic analyzer must contain an embedded analyzer.");
            }
            ChildAnalyzer.Initialize(isFirstAnalysis);
        }