de.jtem.jpetsc
Class PETSc

java.lang.Object
  extended by de.jtem.jpetsc.PrimitivNative
      extended by de.jtem.jpetsc.PETSc

public final class PETSc
extends PrimitivNative


Nested Class Summary
static class PETSc.OptionsGetEListResult
          Result class for optionsGetEList(java.lang.String, java.lang.String, int)
static class PETSc.OptionsGetIntResult
          Result class for optionsGetInt(java.lang.String, java.lang.String)
static class PETSc.OptionsGetRealResult
          Result class for optionsGetReal(java.lang.String, java.lang.String)
static class PETSc.OptionsGetScalarResult
          Result class for optionsGetScalar(java.lang.String, java.lang.String)
static class PETSc.OptionsGetTruthResult
          Result class for optionsGetTruth(java.lang.String, java.lang.String)
 
Field Summary
static int PETSC_COMM_SELF
           
static int PETSC_DECIDE
           
static int PETSC_DEFAULT
           
static int PETSC_DETERMINE
           
static int PETSC_FALSE
           
static int PETSC_IGNORE
           
static int PETSC_NO
           
static int PETSC_NULL
           
static int PETSC_TRUE
           
static int PETSC_YES
           
 
Fields inherited from class de.jtem.jpetsc.PrimitivNative
destroyNative
 
Constructor Summary
PETSc()
           
 
Method Summary
static void Finalize()
           
static void Initialize()
           
static void Initialize(java.lang.String programName, java.lang.String[] args, boolean mpi)
           
static int optionsAllUsed()
          Returns a count of the number of options in the
database that have never been selected.
static void optionsClearValue(java.lang.String name)
          Clears an option name-value pair in the options
database, overriding whatever is already present.
static PETSc.OptionsGetEListResult optionsGetEList(java.lang.String pre, java.lang.String opt, int ntext)
          Puts a list of option values that a single one may be selected from
Not Collective
static PETSc.OptionsGetIntResult optionsGetInt(java.lang.String pre, java.lang.String name)
          Gets the integer value for a particular option in the database.
static boolean optionsGetIntArray(java.lang.String pre, java.lang.String name, int[] dvalue, int[] nmax)
          Gets an array of integer values for a particular
option in the database.
static PETSc.OptionsGetRealResult optionsGetReal(java.lang.String pre, java.lang.String name)
          Gets the double precision value for a particular
option in the database.
static boolean optionsGetRealArray(java.lang.String pre, java.lang.String name, double[] dvalue, int[] nmax)
          Gets an array of double precision values for a
particular option in the database.
static PETSc.OptionsGetScalarResult optionsGetScalar(java.lang.String pre, java.lang.String name)
          Gets the scalar value for a particular
option in the database.
static PETSc.OptionsGetTruthResult optionsGetTruth(java.lang.String pre, java.lang.String name)
          Gets the Logical (true or false) value for a particular
option in the database.
static boolean optionsHasName(java.lang.String pre, java.lang.String name)
          Determines whether a certain option is given in the database.
static void optionsInsertFile(java.lang.String file)
          Inserts options into the database from a file.
static void optionsInsertString(java.lang.String in_str)
          Inserts options into the database from a string
static void optionsLeft()
          Prints to screen any options that were set and never used.
static void optionsMonitorCancel()
          Clears all monitors for a PetscOptions object.
static void optionsReject(java.lang.String name, java.lang.String mess)
          Generates an error if a certain option is given.
static void optionsSetFromOptions()
          Sets various SNES and KSP parameters from user options.
static void optionsSetValue(java.lang.String name, boolean value)
           
static void optionsSetValue(java.lang.String name, java.lang.String value)
          Sets an option name-value pair in the options
database, overriding whatever is already present.
 int testError(java.lang.String message)
           
 
Methods inherited from class de.jtem.jpetsc.PrimitivNative
finalize, getNativeObjectToString, load, toString
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PETSC_FALSE

public static final int PETSC_FALSE
See Also:
Constant Field Values

PETSC_TRUE

public static final int PETSC_TRUE
See Also:
Constant Field Values

PETSC_YES

public static final int PETSC_YES
See Also:
Constant Field Values

PETSC_NO

public static final int PETSC_NO
See Also:
Constant Field Values

PETSC_NULL

public static final int PETSC_NULL
See Also:
Constant Field Values

PETSC_DECIDE

public static final int PETSC_DECIDE
See Also:
Constant Field Values

PETSC_DEFAULT

public static final int PETSC_DEFAULT
See Also:
Constant Field Values

PETSC_IGNORE

public static final int PETSC_IGNORE
See Also:
Constant Field Values

PETSC_DETERMINE

public static final int PETSC_DETERMINE
See Also:
Constant Field Values

PETSC_COMM_SELF

public static final int PETSC_COMM_SELF
See Also:
Constant Field Values
Constructor Detail

PETSc

public PETSc()
Method Detail

Finalize

public static void Finalize()

Initialize

public static void Initialize()

Initialize

public static void Initialize(java.lang.String programName,
                              java.lang.String[] args,
                              boolean mpi)

testError

public int testError(java.lang.String message)

optionsSetValue

public static void optionsSetValue(java.lang.String name,
                                   boolean value)

optionsInsertString

public static void optionsInsertString(java.lang.String in_str)
Inserts options into the database from a string

Parameters:
in_str - string that contains options separated by blanks
See Also:
optionsSetValue(java.lang.String, boolean), #optionsPrint, optionsHasName(java.lang.String, java.lang.String), optionsGetInt(java.lang.String, java.lang.String), optionsGetReal(java.lang.String, java.lang.String), #optionsGetString, optionsGetIntArray(java.lang.String, java.lang.String, int[], int[]), #optionsTruth, #optionsName, #optionsBegin, #optionsEnd, #optionsHead, #optionsStringArray, #optionsRealArray, #optionsScalar, #optionsTruthGroupBegin, #optionsTruthGroup, #optionsTruthGroupEnd, #optionsList, #optionsEList, optionsInsertFile(java.lang.String)

optionsInsertFile

public static void optionsInsertFile(java.lang.String file)
Inserts options into the database from a file.

Parameters:
file - name of file
See Also:
optionsSetValue(java.lang.String, boolean), #optionsPrint, optionsHasName(java.lang.String, java.lang.String), optionsGetInt(java.lang.String, java.lang.String), optionsGetReal(java.lang.String, java.lang.String), #optionsGetString, optionsGetIntArray(java.lang.String, java.lang.String, int[], int[]), #optionsTruth, #optionsName, #optionsBegin, #optionsEnd, #optionsHead, #optionsStringArray, #optionsRealArray, #optionsScalar, #optionsTruthGroupBegin, #optionsTruthGroup, #optionsTruthGroupEnd, #optionsList, #optionsEList

optionsSetValue

public static void optionsSetValue(java.lang.String name,
                                   java.lang.String value)
Sets an option name-value pair in the options
database, overriding whatever is already present.
Not collective, but setting values on certain processors could cause problems
for parallel objects looking for options.

Parameters:
name - name of option, this SHOULD have the - prepended
value - the option value (not used for all options)
See Also:
#optionsInsert

optionsClearValue

public static void optionsClearValue(java.lang.String name)
Clears an option name-value pair in the options
database, overriding whatever is already present.
Not Collective, but setting values on certain processors could cause problems
for parallel objects looking for options.

Parameters:
name - name of option, this SHOULD have the - prepended
See Also:
#optionsInsert

optionsReject

public static void optionsReject(java.lang.String name,
                                 java.lang.String mess)
Generates an error if a certain option is given.
Not Collective, but setting values on certain processors could cause problems
for parallel objects looking for options.

Parameters:
name - the option one is seeking
mess - error message (may be PETSC_NULL)
See Also:
optionsGetInt(java.lang.String, java.lang.String), optionsGetReal(java.lang.String, java.lang.String), #OptionsHasName, #optionsGetString, optionsGetIntArray(java.lang.String, java.lang.String, int[], int[]), optionsGetRealArray(java.lang.String, java.lang.String, double[], int[]), #optionsTruth, #optionsName, #optionsBegin, #optionsEnd, #optionsHead, #optionsStringArray, #optionsRealArray, #optionsScalar, #optionsTruthGroupBegin, #optionsTruthGroup, #optionsTruthGroupEnd, #optionsList, #optionsEList

optionsHasName

public static boolean optionsHasName(java.lang.String pre,
                                     java.lang.String name)
Determines whether a certain option is given in the database.
Not Collective

Parameters:
pre - string to prepend to the name or PETSC_NULL
name - the option one is seeking
Returns:
PETSC_TRUE if found else PETSC_FALSE.
See Also:
optionsGetInt(java.lang.String, java.lang.String), optionsGetReal(java.lang.String, java.lang.String), #optionsGetString, optionsGetIntArray(java.lang.String, java.lang.String, int[], int[]), optionsGetRealArray(java.lang.String, java.lang.String, double[], int[]), #optionsTruth, #optionsName, #optionsBegin, #optionsEnd, #optionsHead, #optionsStringArray, #optionsRealArray, #optionsScalar, #optionsTruthGroupBegin, #optionsTruthGroup, #optionsTruthGroupEnd, #optionsList, #optionsEList

optionsGetInt

public static PETSc.OptionsGetIntResult optionsGetInt(java.lang.String pre,
                                                      java.lang.String name)
Gets the integer value for a particular option in the database.
Not Collective

Parameters:
pre - the string to prepend to the name or PETSC_NULL
name - the option one is seeking
Returns:
PETSc.OptionsGetIntResult
See Also:
optionsGetReal(java.lang.String, java.lang.String), optionsHasName(java.lang.String, java.lang.String), #optionsGetString, optionsGetIntArray(java.lang.String, java.lang.String, int[], int[]), optionsGetRealArray(java.lang.String, java.lang.String, double[], int[]), #optionsTruth, #optionsInt, #optionsString, #optionsReal, #optionsTruth, #optionsName, #optionsBegin, #optionsEnd, #optionsHead, #optionsStringArray, #optionsRealArray, #optionsScalar, #optionsTruthGroupBegin, #optionsTruthGroup, #optionsTruthGroupEnd, #optionsList, #optionsEList

optionsGetEList

public static PETSc.OptionsGetEListResult optionsGetEList(java.lang.String pre,
                                                          java.lang.String opt,
                                                          int ntext)
Puts a list of option values that a single one may be selected from
Not Collective

Parameters:
pre - the string to prepend to the name or PETSC_NULL
opt - option name
ntext - number of choices
Returns:
PETSc.OptionsGetEListResult
See Also:
optionsGetInt(java.lang.String, java.lang.String), optionsGetReal(java.lang.String, java.lang.String), optionsHasName(java.lang.String, java.lang.String), optionsGetIntArray(java.lang.String, java.lang.String, int[], int[]), optionsGetRealArray(java.lang.String, java.lang.String, double[], int[]), #optionsTruth, #optionsName, #optionsBegin, #optionsEnd, #optionsHead, #optionsStringArray, #optionsRealArray, #optionsScalar, #optionsTruthGroupBegin, #optionsTruthGroup, #optionsTruthGroupEnd, #optionsList, #optionsEList

optionsGetTruth

public static PETSc.OptionsGetTruthResult optionsGetTruth(java.lang.String pre,
                                                          java.lang.String name)
Gets the Logical (true or false) value for a particular
option in the database.
Not Collective

Parameters:
pre - the string to prepend to the name or PETSC_NULL
name - the option one is seeking
Returns:
PETSc.OptionsGetTruthResult
See Also:
optionsGetReal(java.lang.String, java.lang.String), optionsHasName(java.lang.String, java.lang.String), #optionsGetString, optionsGetIntArray(java.lang.String, java.lang.String, int[], int[]), optionsGetRealArray(java.lang.String, java.lang.String, double[], int[]), optionsGetInt(java.lang.String, java.lang.String), #optionsTruth, #optionsName, #optionsBegin, #optionsEnd, #optionsHead, #optionsStringArray, #optionsRealArray, #optionsScalar, #optionsTruthGroupBegin, #optionsTruthGroup, #optionsTruthGroupEnd, #optionsList, #optionsEList

optionsGetReal

public static PETSc.OptionsGetRealResult optionsGetReal(java.lang.String pre,
                                                        java.lang.String name)
Gets the double precision value for a particular
option in the database.
Not Collective

Parameters:
pre - string to prepend to each name or PETSC_NULL
name - the option one is seeking
Returns:
PETSc.OptionsGetRealResult
See Also:
optionsGetInt(java.lang.String, java.lang.String), optionsHasName(java.lang.String, java.lang.String), #optionsGetString, optionsGetIntArray(java.lang.String, java.lang.String, int[], int[]), optionsGetRealArray(java.lang.String, java.lang.String, double[], int[]), #optionsTruth, #optionsName, #optionsBegin, #optionsEnd, #optionsHead, #optionsStringArray, #optionsRealArray, #optionsScalar, #optionsTruthGroupBegin, #optionsTruthGroup, #optionsTruthGroupEnd, #optionsList, #optionsEList

optionsGetScalar

public static PETSc.OptionsGetScalarResult optionsGetScalar(java.lang.String pre,
                                                            java.lang.String name)
Gets the scalar value for a particular
option in the database.
Not Collective

Parameters:
pre - string to prepend to each name or PETSC_NULL
name - the option one is seeking
Returns:
PETSc.OptionsGetScalarResult
See Also:
optionsGetInt(java.lang.String, java.lang.String), optionsHasName(java.lang.String, java.lang.String), #optionsGetString, optionsGetIntArray(java.lang.String, java.lang.String, int[], int[]), optionsGetRealArray(java.lang.String, java.lang.String, double[], int[]), #optionsTruth, #optionsName, #optionsBegin, #optionsEnd, #optionsHead, #optionsStringArray, #optionsRealArray, #optionsScalar, #optionsTruthGroupBegin, #optionsTruthGroup, #optionsTruthGroupEnd, #optionsList, #optionsEList

optionsGetRealArray

public static boolean optionsGetRealArray(java.lang.String pre,
                                          java.lang.String name,
                                          double[] dvalue,
                                          int[] nmax)
Gets an array of double precision values for a
particular option in the database. The values must be separated with
commas with no intervening spaces.
Not Collective

Parameters:
pre - string to prepend to each name or PETSC_NULL
name - the option one is seeking
dvalue -
nmax - maximum number of values to retrieve
Returns:
PETSC_TRUE if found, else PETSC_FALSE
See Also:
optionsGetInt(java.lang.String, java.lang.String), optionsHasName(java.lang.String, java.lang.String), #optionsGetString, optionsGetIntArray(java.lang.String, java.lang.String, int[], int[]), #optionsTruth, #optionsName, #optionsBegin, #optionsEnd, #optionsHead, #optionsStringArray, #optionsRealArray, #optionsScalar, #optionsTruthGroupBegin, #optionsTruthGroup, #optionsTruthGroupEnd, #optionsList, #optionsEList

optionsGetIntArray

public static boolean optionsGetIntArray(java.lang.String pre,
                                         java.lang.String name,
                                         int[] dvalue,
                                         int[] nmax)
Gets an array of integer values for a particular
option in the database. The values must be separated with commas with
no intervening spaces.
Not Collective

Parameters:
pre - string to prepend to each name or PETSC_NULL
name - the option one is seeking
dvalue -
nmax - maximum number of values to retrieve
Returns:
PETSC_TRUE if found, else PETSC_FALSE
See Also:
optionsGetInt(java.lang.String, java.lang.String), optionsHasName(java.lang.String, java.lang.String), #optionsGetString, optionsGetRealArray(java.lang.String, java.lang.String, double[], int[]), #optionsTruth, #optionsName, #optionsBegin, #optionsEnd, #optionsHead, #optionsStringArray, #optionsRealArray, #optionsScalar, #optionsTruthGroupBegin, #optionsTruthGroup, #optionsTruthGroupEnd, #optionsList, #optionsEList

optionsAllUsed

public static int optionsAllUsed()
Returns a count of the number of options in the
database that have never been selected.
Not Collective

Returns:
count of options not used
See Also:
#optionsPrint

optionsLeft

public static void optionsLeft()
Prints to screen any options that were set and never used.
Not collective

See Also:
optionsAllUsed()

optionsSetFromOptions

public static void optionsSetFromOptions()
Sets various SNES and KSP parameters from user options.


optionsMonitorCancel

public static void optionsMonitorCancel()
Clears all monitors for a PetscOptions object.

See Also:
#optionsMonitorDefault, #optionsMonitorSet