Esempio n. 1
0
 public GmresSolver(IAsymmetricModel model, GmresAlgorithm gmresAlgorithm,
                    IPreconditionerFactory preconditionerFactory, AsymmetricDofOrderer dofRowOrderer, IDofOrderer dofColOrderer)
     : base(model, dofRowOrderer, dofColOrderer, new CsrNonSymmetricAssembler(true), "GmresSolver")
 {
     this.gmresAlgorithm        = new GmresAlgorithm.Builder().Build();
     this.preconditionerFactory = preconditionerFactory;
 }
Esempio n. 2
0
        public IGlobalFreeDofOrdering OrderFreeDofs(IAsymmetricModel model)
        {
            var subdomain = model.Subdomains.First();

            (int numSubdomainFreeRowDofs, DofTable subdomainFreeRowDofs) = _rowOrderingStrategy.OrderSubdomainDofs(subdomain);
            ISubdomainFreeDofOrdering subdomainRowOrdering = new SubdomainFreeRowDofOrderingGeneral(numSubdomainFreeRowDofs, subdomainFreeRowDofs);

            return(new GlobalFreeDofOrderingSingle((ISubdomain)subdomain, subdomainRowOrdering));
        }
Esempio n. 3
0
 public ModelOverlappingDecomposition2D(IAxisOverlappingDecomposition ksiDecomposition,
                                        IAxisOverlappingDecomposition hetaDecomposition, int numberOfCpHeta, List <IWeightedPoint> patchControlPoints,
                                        IAsymmetricModel model, ICoarseSpaceNodeSelection coarseSpaceNodeSelection, ISubdomain patch)
 {
     _ksiDecomposition         = ksiDecomposition;
     _hetaDecomposition        = hetaDecomposition;
     _numberOfCpHeta           = numberOfCpHeta;
     _patchControlPoints       = patchControlPoints;
     _coarseSpaceNodeSelection = coarseSpaceNodeSelection;
     _model = model;
     _patch = patch;
 }
        public OverlappingAdditiveSchwarzPreconditioner(IMatrixView matrix, ICoarseProblemFactory coarseProblemFactory,
                                                        LocalProblemsFactory localProblemsFactory, IModelOverlappingDecomposition modelOverlappingDecomposition,
                                                        IAsymmetricModel model)
        {
            modelOverlappingDecomposition.DecomposeMatrix();
            coarseProblemFactory.GenerateMatrices(matrix, modelOverlappingDecomposition);
            localProblemsFactory.GenerateMatrices(matrix, modelOverlappingDecomposition);
            var coarseProblemContribution = coarseProblemFactory.RetrievePreconditionerContribution();
            var localProblemsContribution = localProblemsFactory.RetrievePreconditionerContribution();

            var freeSubdomainDofs = model.GlobalRowDofOrdering.MapFreeDofsSubdomainToGlobal(model.Subdomains[0]);

            _preconditioner = coarseProblemContribution.Add(localProblemsContribution).GetSubmatrix(freeSubdomainDofs, freeSubdomainDofs);
            Order           = _preconditioner.NumRows;
        }
Esempio n. 5
0
        protected SingleSubdomainNonSymmetricSolverBase(IAsymmetricModel model, IAsymmetricDofOrderer dofRowOrderer,
                                                        IDofOrderer dofColOrderer, IGlobalMatrixRectangularAssembler <TMatrix> assembler, string name)
        {
            if (model.Subdomains.Count != 1)
            {
                throw new InvalidSolverException(
                          $"{name} can be used if there is only 1 subdomain");
            }
            this.model    = model;
            subdomain     = model.Subdomains[0];
            linearSystem  = new SingleSubdomainSystem <TMatrix>(subdomain);
            LinearSystems = new Dictionary <int, ILinearSystem>()
            {
                { subdomain.ID, linearSystem }
            };
            linearSystem.MatrixObservers.Add(this);

            this.dofRowOrderer = dofRowOrderer;
            this.dofColOrderer = dofColOrderer;
            this.assembler     = assembler;
            this.Logger        = new SolverLogger(name);
        }
 public Factory(IModelOverlappingDecomposition modelOverlappingDecomposition,
                IAsymmetricModel model)
 {
     _model = model;
     _modelOverlappingDecomposition = modelOverlappingDecomposition;
 }
Esempio n. 7
0
 public (int numGlobalFreeDofs, DofTable globalFreeDofs) OrderGlobalDofs(IAsymmetricModel model)
 => OrderFreeDofsOfElementSet(model.Elements, model.Constraints);