Esempio n. 1
0
HYPRE_Int
hypre_SchwarzSetNonSymm( void *data, HYPRE_Int value )
{

   hypre_SchwarzData  *schwarz_data = data;
 
   hypre_SchwarzDataUseNonSymm(schwarz_data) = value;

   return hypre_error_flag;

}
Esempio n. 2
0
HYPRE_Int
hypre_SchwarzSolve(void               *schwarz_vdata,
                   hypre_ParCSRMatrix *A,
                   hypre_ParVector    *f,
                   hypre_ParVector    *u         )
{
   hypre_SchwarzData   *schwarz_data = schwarz_vdata;

   hypre_CSRMatrix *domain_structure = 
		hypre_SchwarzDataDomainStructure(schwarz_data);
   hypre_CSRMatrix *A_boundary = hypre_SchwarzDataABoundary(schwarz_data);
   double *scale = hypre_SchwarzDataScale(schwarz_data);
   hypre_ParVector *Vtemp = hypre_SchwarzDataVtemp(schwarz_data);
   HYPRE_Int variant = hypre_SchwarzDataVariant(schwarz_data);
   double relax_wt = hypre_SchwarzDataRelaxWeight(schwarz_data);
   HYPRE_Int use_nonsymm = hypre_SchwarzDataUseNonSymm(schwarz_data);
   
   HYPRE_Int *pivots = hypre_SchwarzDataPivots(schwarz_data);

   if (variant == 2)
   {
      hypre_ParAdSchwarzSolve(A, f, domain_structure, scale, u, Vtemp, pivots, use_nonsymm);
   }
   else if (variant == 3)
   {
      hypre_ParMPSchwarzSolve(A, A_boundary, f, domain_structure, u,
                              relax_wt, scale, Vtemp, pivots, use_nonsymm); 
   }
   else if (variant == 1)
   {
      hypre_AdSchwarzSolve(A, f, domain_structure, scale, u, Vtemp, pivots, use_nonsymm);
   }
   else if (variant == 4)
   {
      hypre_MPSchwarzFWSolve(A, hypre_ParVectorLocalVector(f), 
				domain_structure, u, relax_wt, 
                             hypre_ParVectorLocalVector(Vtemp), pivots, use_nonsymm);
   }
   else 
   {
      hypre_MPSchwarzSolve(A, hypre_ParVectorLocalVector(f), 
                                  domain_structure, u, relax_wt, 
                                  hypre_ParVectorLocalVector(Vtemp), pivots, use_nonsymm);
   }
      
   return hypre_error_flag;
}
Esempio n. 3
0
HYPRE_Int
hypre_SchwarzCFSolve(void               *schwarz_vdata,
                     hypre_ParCSRMatrix *A,
                     hypre_ParVector    *f,
                     hypre_ParVector    *u,
                     HYPRE_Int *CF_marker,
                     HYPRE_Int rlx_pt)
{
   hypre_SchwarzData   *schwarz_data = (hypre_SchwarzData*) schwarz_vdata;

   hypre_CSRMatrix *domain_structure = 
		hypre_SchwarzDataDomainStructure(schwarz_data);
   HYPRE_Real *scale = hypre_SchwarzDataScale(schwarz_data);
   hypre_ParVector *Vtemp = hypre_SchwarzDataVtemp(schwarz_data);
   HYPRE_Int variant = hypre_SchwarzDataVariant(schwarz_data);
   HYPRE_Real relax_wt = hypre_SchwarzDataRelaxWeight(schwarz_data);

   HYPRE_Int use_nonsymm = hypre_SchwarzDataUseNonSymm(schwarz_data);
   
   HYPRE_Int *pivots = hypre_SchwarzDataPivots(schwarz_data);

   if (variant == 1)
   {
       hypre_AdSchwarzCFSolve(A, f, domain_structure, scale, u, Vtemp,
				CF_marker, rlx_pt, pivots, use_nonsymm);
   }
   else if (variant == 4)
   {
      hypre_MPSchwarzCFFWSolve(A, hypre_ParVectorLocalVector(f), 
				domain_structure, u, relax_wt, 
				hypre_ParVectorLocalVector(Vtemp),
				CF_marker, rlx_pt, pivots, use_nonsymm);
   }
   else 
   {
      hypre_MPSchwarzCFSolve(A, hypre_ParVectorLocalVector(f), 
				domain_structure, u, relax_wt, 
				hypre_ParVectorLocalVector(Vtemp),
				CF_marker, rlx_pt, pivots, use_nonsymm);
   }
      
   return hypre_error_flag;
}
Esempio n. 4
0
HYPRE_Int
hypre_SchwarzSetup(void               *schwarz_vdata,
                   hypre_ParCSRMatrix *A,
                   hypre_ParVector    *f,
                   hypre_ParVector    *u         )
{

   hypre_SchwarzData   *schwarz_data = schwarz_vdata;
   HYPRE_Int *dof_func;
   double *scale;
   hypre_CSRMatrix *domain_structure;
   hypre_CSRMatrix *A_boundary;
   hypre_ParVector *Vtemp;

   HYPRE_Int *pivots = NULL;

   HYPRE_Int variant = hypre_SchwarzDataVariant(schwarz_data);
   HYPRE_Int domain_type = hypre_SchwarzDataDomainType(schwarz_data);
   HYPRE_Int overlap = hypre_SchwarzDataOverlap(schwarz_data);
   HYPRE_Int num_functions = hypre_SchwarzDataNumFunctions(schwarz_data);
   double relax_weight = hypre_SchwarzDataRelaxWeight(schwarz_data);
   HYPRE_Int use_nonsymm = hypre_SchwarzDataUseNonSymm(schwarz_data);
   

   dof_func = hypre_SchwarzDataDofFunc(schwarz_data);

   Vtemp = hypre_ParVectorCreate(hypre_ParCSRMatrixComm(A),
			hypre_ParCSRMatrixGlobalNumRows(A),
			hypre_ParCSRMatrixRowStarts(A));
   hypre_ParVectorSetPartitioningOwner(Vtemp,0);
   hypre_ParVectorInitialize(Vtemp);
   hypre_SchwarzDataVtemp(schwarz_data) = Vtemp;

   if (variant > 1)
   {
      hypre_ParAMGCreateDomainDof(A,
                                  domain_type, overlap,
                                  num_functions, dof_func,
                                  &domain_structure, &pivots, use_nonsymm);

      if (variant == 2)
      {
         hypre_ParGenerateScale(A, domain_structure, relax_weight,
		&scale);
         hypre_SchwarzDataScale(schwarz_data) = scale;
      }
      else
      {
         hypre_ParGenerateHybridScale(A, domain_structure, &A_boundary, &scale);
         hypre_SchwarzDataScale(schwarz_data) = scale;
         if (hypre_CSRMatrixNumCols(hypre_ParCSRMatrixOffd(A)))
            hypre_SchwarzDataABoundary(schwarz_data) = A_boundary;
         else
            hypre_SchwarzDataABoundary(schwarz_data) = NULL;
      }
   }
   else
   {
      hypre_AMGCreateDomainDof (hypre_ParCSRMatrixDiag(A),
                                domain_type, overlap,
                                num_functions, dof_func,
                                &domain_structure, &pivots, use_nonsymm);
      if (variant == 1)
      {
         hypre_GenerateScale(domain_structure, 
		hypre_CSRMatrixNumRows(hypre_ParCSRMatrixDiag(A)),
		relax_weight, &scale);
         hypre_SchwarzDataScale(schwarz_data) = scale;
      }
   }

   hypre_SchwarzDataDomainStructure(schwarz_data) = domain_structure;
   hypre_SchwarzDataPivots(schwarz_data) = pivots;

   return hypre_error_flag;

}