예제 #1
0
 public void Initialize()
 {
     // The order in which the next initializations happen is very important.
     rve.ApplyBoundaryConditions();
     model.ConnectDataStructures();
     solver.OrderDofs(true);
     foreach (ILinearSystem linearSystem in linearSystems.Values)
     {
         linearSystem.Reset(); // Necessary to define the linear system's size
     }
 }
예제 #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);
        }