private static IVectorView[] SolveModels(Model[] models)
        {
            SkylineSolver[] solvers = new SkylineSolver[models.Length];
            IImplicitIntegrationProvider[] providers = new IImplicitIntegrationProvider[models.Length];
            IChildAnalyzer[] childAnalyzers          = new IChildAnalyzer[models.Length];
            for (int i = 0; i < models.Length; i++)
            {
                //var builder = new DenseMatrixSolver.Builder();
                solvers[i]        = builder.BuildSolver(models[i]);
                providers[i]      = new ProblemStructural(models[i], solvers[i]);
                childAnalyzers[i] = new LinearAnalyzer(models[i], solvers[i], providers[i]);
            }

            var parentAnalyzer = new NewmarkDynamicAnalyzerMultiModel(UpdateModels, models, solvers, providers, childAnalyzers, 0.28, 3.36, .25, .5);

            parentAnalyzer.Initialize();
            parentAnalyzer.Solve();

            return(solvers.Select(x => x.LinearSystems[subdomainID].Solution).ToArray());
        }
        private static IVectorView[] SolveModelsWithNewmark(Model[] models, IModelReader[] modelReaders)
        {
            Vector[] initialValues = new Vector[models.Length];
            var      value0        = new Dictionary <int, double[]>();

            for (int i = 0; i < models.Length; i++)
            {
                double[] v0 = new double[models[i].Nodes.Count];
                value0.Add(i, v0);
            }
            foreach (Node node in models[0].Nodes)
            {
                value0[0][node.ID] = 0; /* 0.96733;*/
            }
            foreach (Node node in models[1].Nodes)
            {
                value0[1][node.ID] = 0.96;
            }

            foreach (Node node in models[1].Nodes)
            {
                value0[2][node.ID] = 1;
            }

            SkylineSolver[] solvers = new SkylineSolver[models.Length];
            //DenseMatrixSolver[] solvers = new DenseMatrixSolver[models.Length];
            IConvectionDiffusionIntegrationProvider[] providers = new IConvectionDiffusionIntegrationProvider[models.Length];
            IChildAnalyzer[] childAnalyzers = new IChildAnalyzer[models.Length];
            for (int i = 0; i < models.Length; i++)
            {
                initialValues[i] = Vector.CreateFromArray(value0[i]);
                //var builder = new DenseMatrixSolver.Builder();
                //builder.IsMatrixPositiveDefinite = false;
                solvers[i]        = builder.BuildSolver(models[i]);
                providers[i]      = new ProblemConvectionDiffusion2(models[i], solvers[i]);
                childAnalyzers[i] = new LinearAnalyzer(models[i], solvers[i], providers[i]);
            }

            const double timestep       = .005;
            const double time           = 30;
            var          parentAnalyzer = new ConvectionDiffusionImplicitDynamicAnalyzerMultiModel(UpdateModels, models, solvers,
                                                                                                   providers, childAnalyzers, timestep, time, initialTemperature: initialValues);

            parentAnalyzer.Initialize();
            double[]           muLame           = new double[] { 6e4, 2.1e4 };
            double[]           poissonV         = new double[] { .45, .2 };
            IDynamicMaterial[] dynamicMaterials = new DynamicMaterial[] { new DynamicMaterial(.001, 0, 0, true), new DynamicMaterial(.001, 0, 0, true) };
            var structuralModel    = CreateStructuralModel(muLame, poissonV, dynamicMaterials, 0, new double[] { 0, 0, 0 }, lgElement).Item1; // new Model();
            var structuralSolver   = structuralBuilder.BuildSolver(structuralModel);
            var structuralProvider = new ProblemStructural(structuralModel, structuralSolver);
            //var structuralChildAnalyzer = new LinearAnalyzer(structuralModel, structuralSolver, structuralProvider);
            var increments = 2;
            var structuralChildAnalyzerBuilder = new LoadControlAnalyzer.Builder(structuralModel, structuralSolver, structuralProvider, increments);

            structuralChildAnalyzerBuilder.ResidualTolerance             = 1E-6;
            structuralChildAnalyzerBuilder.MaxIterationsPerIncrement     = 50;
            structuralChildAnalyzerBuilder.NumIterationsForMatrixRebuild = 1;
            //childAnalyzerBuilder.SubdomainUpdaters = new[] { new NonLinearSubdomainUpdater(model.SubdomainsDictionary[subdomainID]) }; // This is the default
            LoadControlAnalyzer structuralChildAnalyzer = structuralChildAnalyzerBuilder.Build();
            var structuralParentAnalyzer = new NewmarkDynamicAnalyzer(UpdateNewmarkModel, structuralModel, structuralSolver,
                                                                      structuralProvider, structuralChildAnalyzer, timestep, time, 0.25, 0.5);

            structuralParentAnalyzer.Initialize();

            for (int i = 0; i < time / timestep; i++)
            {
                parentAnalyzer.SolveTimestep(i);
                structuralParentAnalyzer.SolveTimestep(i);
            }

            return(solvers.Select(x => x.LinearSystems[subdomainID].Solution).ToArray());
        }