[petsc-users] PCFIELDSPLIT prefix

Smith, Barry F. bsmith at mcs.anl.gov
Sun Apr 8 11:24:07 CDT 2018


   I don't understand your question but suspect that the issue is related to the order you are calling functions. You may need a 
KSPSetFromOptions() after the KSPSetOptionsPrefix() but before the PCFieldSplitSetIS() 

   Barry

Note that it is ok to have multiple calls to KSPSetFromOptions() for the same KSP but depending on where you set the options prefix they may have different results.



> On Apr 8, 2018, at 11:12 AM, Rossi, Simone <srossi at email.unc.edu> wrote:
> 
> Hello, 
> I’m trying to set a prefix for a ksp context (from the libMesh PetscLinearSolver) that solves a “bidomain” problem.
> 
> Currently I’m simply calling
> 
> KSPSetOptionsPrefix(ksp,"bidomain_");
> PCFieldSplitSetIS(ksp->pc,"v",is_v_local);
> PCFieldSplitSetIS(ksp->pc,"ve",is_ve_local); 
> 
> where is_v_local and is_ve_local are the local index sets of the 2 fields, v and ve.
> 
> In this way, I can use the -bidomain_pc_type option to set the preconditioner. But using the FIELDSPLIT preconditioner with:
> -bidomain_pc_type fieldsplit
> I actually get the error: 
> "Unhandled case, must have at least two fields, not 1”
> If I specify the block size
> -bidomain_pc_type fieldsplit  -bidomain_pc_fieldsplit_block_size 2
> The fields are not split using the provided index sets and the splitnames correspond to the number of the split, i.e.
> -bidomain_fieldsplit_0
> -bidomain_fieldsplit_1
> 
> 
> On the contrary using:
> -pc_type fieldsplit
> the preconditioner uses the index set provided in the code, and the splitnames are correct
> -bidomain_fieldsplit_v
> -bidomain_fieldsplit_ve
> 
> How can I call "-bidomain_pc_type fieldsplit" and get the splitting that uses the index sets provided in the code?
> 
> Thanks for the help,
> Simone
> 



More information about the petsc-users mailing list