Lines Matching refs:name

124 static PetscErrorCode PetscOptionsMonitor(PetscOptions options, const char name[], const char value…  in PetscOptionsMonitor()  argument
127 if (options->monitorFromOptions) PetscCall(PetscOptionsMonitorDefault(name, value, source, NULL)); in PetscOptionsMonitor()
128 …for (PetscInt i = 0; i < options->numbermonitors; i++) PetscCall((*options->monitor[i])(name, valu… in PetscOptionsMonitor()
787 static inline PetscErrorCode PetscOptionsSkipPrecedent(PetscOptions options, const char name[], Pet… in PetscOptionsSkipPrecedent() argument
794 if (!PetscOptNameCmp(precedentOptions[i], name)) { in PetscOptionsSkipPrecedent()
796 PetscCall(PetscOptionsFindPair(options, NULL, name, NULL, flg)); in PetscOptionsSkipPrecedent()
911 static PetscBool PetscCIOption(const char *name) in PetscCIOption() argument
917 …LF, PetscEListFind(PETSC_STATIC_ARRAY_LENGTH(PetscCIOptions), PetscCIOptions, name, &idx, &found)); in PetscCIOption()
1268 PetscErrorCode PetscOptionsSetValue(PetscOptions options, const char name[], const char value[]) in PetscOptionsSetValue() argument
1271 PetscCall(PetscOptionsSetValue_Private(options, name, value, NULL, PETSC_OPT_CODE)); in PetscOptionsSetValue()
1275 PetscErrorCode PetscOptionsSetValue_Private(PetscOptions options, const char name[], const char val… in PetscOptionsSetValue_Private() argument
1288 …PetscCheck(name[0] == '-', PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "name %s must start with '-'… in PetscOptionsSetValue_Private()
1290 PetscCall(PetscOptionsSkipPrecedent(options, name, &flg)); in PetscOptionsSetValue_Private()
1293 name++; /* skip starting dash */ in PetscOptionsSetValue_Private()
1298 strncat(fullname, name, sizeof(fullname) - strlen(fullname) - 1); in PetscOptionsSetValue_Private()
1300 name = fullname; in PetscOptionsSetValue_Private()
1305 int result = PetscOptNameCmp(options->aliases1[i], name); in PetscOptionsSetValue_Private()
1307 name = options->aliases2[i]; in PetscOptionsSetValue_Private()
1316 int result = PetscOptNameCmp(names[i], name); in PetscOptionsSetValue_Private()
1369 len = strlen(name); in PetscOptionsSetValue_Private()
1372 strcpy(options->names[n], name); in PetscOptionsSetValue_Private()
1389 if (!PetscOptNameCmp(name, "help")) { in PetscOptionsSetValue_Private()
1395 PetscCall(PetscOptionsMonitor(options, name, value ? value : "", source)); in PetscOptionsSetValue_Private()
1423 PetscErrorCode PetscOptionsClearValue(PetscOptions options, const char name[]) in PetscOptionsClearValue() argument
1430 …PetscCheck(name[0] == '-', PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "Name must begin with '-': Instea… in PetscOptionsClearValue()
1431 if (!PetscOptNameCmp(name, "-help")) options->help = options->help_intro = PETSC_FALSE; in PetscOptionsClearValue()
1433 name++; /* skip starting dash */ in PetscOptionsClearValue()
1439 int result = PetscOptNameCmp(names[i], name); in PetscOptionsClearValue()
1466 PetscCall(PetscOptionsMonitor(options, name, NULL, PETSC_OPT_CODE)); in PetscOptionsClearValue()
1491 PetscErrorCode PetscOptionsFindPair(PetscOptions options, const char pre[], const char name[], cons… in PetscOptionsFindPair() argument
1502 …PetscCheck(name[0] == '-', PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "Name must begin with '-': Instea… in PetscOptionsFindPair()
1504 name++; /* skip starting dash */ in PetscOptionsFindPair()
1509 if (name[0] == '-') { in PetscOptionsFindPair()
1511 name++; in PetscOptionsFindPair()
1514 PetscCall(PetscStrlcat(buf, name, sizeof(buf))); in PetscOptionsFindPair()
1515 name = buf; in PetscOptionsFindPair()
1521 PetscCall(PetscStrncpy(key + 1, name, sizeof(key) - 1)); in PetscOptionsFindPair()
1523 …_ARG_WRONG, "Invalid option '%s' obtained from pre='%s' and name='%s'", key, pre ? pre : "", name); in PetscOptionsFindPair()
1543 khiter_t it = kh_get(HO, ht, name); in PetscOptionsFindPair()
1560 for (i = 0; name[i]; i++) { in PetscOptionsFindPair()
1561 if (name[i] == '_') { in PetscOptionsFindPair()
1562 for (j = i + 1; name[j]; j++) { in PetscOptionsFindPair()
1563 if (name[j] >= '0' && name[j] <= '9') continue; in PetscOptionsFindPair()
1564 if (name[j] == '_' && j > i + 1) { /* found a number */ in PetscOptionsFindPair()
1576 PetscCall(PetscStrncpy(tmp, name, PetscMin((size_t)(locs[i] + 1), sizeof(tmp)))); in PetscOptionsFindPair()
1578 PetscCall(PetscStrlcat(opt, name + loce[i], sizeof(opt))); in PetscOptionsFindPair()
1592 …FindPairPrefix_Private(PetscOptions options, const char pre[], const char name[], const char *opti… in PetscOptionsFindPairPrefix_Private() argument
1600 …PetscCheck(name[0] == '-', PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "Name must begin with '-': Instea… in PetscOptionsFindPairPrefix_Private()
1602 name++; /* skip starting dash */ in PetscOptionsFindPairPrefix_Private()
1607 if (name[0] == '-') { in PetscOptionsFindPairPrefix_Private()
1609 name++; in PetscOptionsFindPairPrefix_Private()
1612 PetscCall(PetscStrlcat(buf, name, sizeof(buf))); in PetscOptionsFindPairPrefix_Private()
1613 name = buf; in PetscOptionsFindPairPrefix_Private()
1619 PetscCall(PetscStrncpy(key + 1, name, sizeof(key) - 1)); in PetscOptionsFindPairPrefix_Private()
1621 …_ARG_WRONG, "Invalid option '%s' obtained from pre='%s' and name='%s'", key, pre ? pre : "", name); in PetscOptionsFindPairPrefix_Private()
1627 for (i = 0; name[i]; i++) { in PetscOptionsFindPairPrefix_Private()
1628 if (name[i] == '_') { in PetscOptionsFindPairPrefix_Private()
1629 for (j = i + 1; name[j]; j++) { in PetscOptionsFindPairPrefix_Private()
1630 if (name[j] >= '0' && name[j] <= '9') continue; in PetscOptionsFindPairPrefix_Private()
1631 if (name[j] == '_' && j > i + 1) { /* found a number */ in PetscOptionsFindPairPrefix_Private()
1648 PetscCall(PetscStrncpy(opt, name, sizeof(opt))); in PetscOptionsFindPairPrefix_Private()
1650 PetscCall(PetscStrncpy(opt, name, PetscMin((size_t)(locs[c] + 1), sizeof(opt)))); in PetscOptionsFindPairPrefix_Private()
1651 PetscCall(PetscStrlcat(opt, name + loce[c], sizeof(opt) - 1)); in PetscOptionsFindPairPrefix_Private()
1692 PetscErrorCode PetscOptionsReject(PetscOptions options, const char pre[], const char name[], const … in PetscOptionsReject() argument
1697 PetscCall(PetscOptionsHasName(options, pre, name, &flag)); in PetscOptionsReject()
1699 …_ERR_ARG_OUTOFRANGE, "Program has disabled option: -%s%s with %s", pre ? pre : "", name + 1, mess); in PetscOptionsReject()
1700 …MM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Program has disabled option: -%s%s", pre ? pre : "", name + 1); in PetscOptionsReject()
1764 PetscErrorCode PetscOptionsHasName(PetscOptions options, const char pre[], const char name[], Petsc… in PetscOptionsHasName() argument
1770 PetscCall(PetscOptionsFindPair(options, pre, name, &value, &flag)); in PetscOptionsHasName()
1848 PetscErrorCode PetscOptionsUsed(PetscOptions options, const char *name, PetscBool *used) in PetscOptionsUsed() argument
1853 PetscAssertPointer(name, 2); in PetscOptionsUsed()
1858 PetscCall(PetscStrcasecmp(options->names[i], name, used)); in PetscOptionsUsed()
2063 PetscErrorCode PetscOptionsMonitorDefault(const char name[], const char value[], PetscOptionSource … in PetscOptionsMonitorDefault() argument
2066 if (PetscCIOption(name)) PetscFunctionReturn(PETSC_SUCCESS); in PetscOptionsMonitorDefault()
2071 PetscCall(PetscViewerASCIIPrintf(viewer, "Removing option: %s\n", name)); in PetscOptionsMonitorDefault()
2073 …PetscCall(PetscViewerASCIIPrintf(viewer, "Setting option: %s (no value) (source: %s)\n", name, Pet… in PetscOptionsMonitorDefault()
2075 …PetscCall(PetscViewerASCIIPrintf(viewer, "Setting option: %s = %s (source: %s)\n", name, value, Pe… in PetscOptionsMonitorDefault()
2080 PetscCall(PetscPrintf(comm, "Removing option: %s\n", name)); in PetscOptionsMonitorDefault()
2082 …PetscCall(PetscPrintf(comm, "Setting option: %s (no value) (source: %s)\n", name, PetscOptionSourc… in PetscOptionsMonitorDefault()
2084 …PetscCall(PetscPrintf(comm, "Setting option: %s = %s (source: %s)\n", name, value, PetscOptionSour… in PetscOptionsMonitorDefault()
2128 PetscErrorCode PetscOptionsMonitorSet(PetscErrorCode (*monitor)(const char name[], const char value… in PetscOptionsMonitorSet() argument
2203 PetscErrorCode PetscOptionsStringToInt(const char name[], PetscInt *a) in PetscOptionsStringToInt() argument
2209 PetscCall(PetscStrlen(name, &len)); in PetscOptionsStringToInt()
2212 PetscCall(PetscStrcasecmp(name, "PETSC_DEFAULT", &tdefault)); in PetscOptionsStringToInt()
2213 if (!tdefault) PetscCall(PetscStrcasecmp(name, "DEFAULT", &tdefault)); in PetscOptionsStringToInt()
2214 PetscCall(PetscStrcasecmp(name, "PETSC_DECIDE", &decide)); in PetscOptionsStringToInt()
2215 if (!decide) PetscCall(PetscStrcasecmp(name, "DECIDE", &decide)); in PetscOptionsStringToInt()
2216 if (!decide) PetscCall(PetscStrcasecmp(name, "PETSC_DETERMINE", &decide)); in PetscOptionsStringToInt()
2217 if (!decide) PetscCall(PetscStrcasecmp(name, "DETERMINE", &decide)); in PetscOptionsStringToInt()
2218 PetscCall(PetscStrcasecmp(name, "PETSC_UNLIMITED", &unlimited)); in PetscOptionsStringToInt()
2219 if (!unlimited) PetscCall(PetscStrcasecmp(name, "UNLIMITED", &unlimited)); in PetscOptionsStringToInt()
2220 PetscCall(PetscStrcasecmp(name, "mouse", &mouse)); in PetscOptionsStringToInt()
2230 strtolval = strtol(name, &endptr, 10); in PetscOptionsStringToInt()
2231 …_t)(endptr - name) == len, PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Input string %s has no inte… in PetscOptionsStringToInt()
2235 *a = atoll(name); in PetscOptionsStringToInt()
2238 *a = _atoi64(name); in PetscOptionsStringToInt()
2250 static PetscErrorCode PetscStrtod(const char name[], PetscReal *a, char **endptr) in PetscStrtod() argument
2254 *a = strtoflt128(name, endptr); in PetscStrtod()
2256 *a = (PetscReal)strtod(name, endptr); in PetscStrtod()
2261 static PetscErrorCode PetscStrtoz(const char name[], PetscScalar *a, char **endptr, PetscBool *isIm… in PetscStrtoz() argument
2268 PetscCall(PetscStrtod(name, &strtoval, &ptr)); in PetscStrtoz()
2269 if (ptr == name) { in PetscStrtoz()
2272 if (name[0] == 'i') { in PetscStrtoz()
2274 } else if (name[0] == '+' && name[1] == 'i') { in PetscStrtoz()
2276 } else if (name[0] == '-' && name[1] == 'i') { in PetscStrtoz()
2288 …, PETSC_ERR_ARG_OUTOFRANGE, "Input string %s contains imaginary but complex not supported ", name); in PetscStrtoz()
2301 PetscErrorCode PetscOptionsStringToReal(const char name[], PetscReal *a) in PetscOptionsStringToReal() argument
2308 PetscCall(PetscStrlen(name, &len)); in PetscOptionsStringToReal()
2311 PetscCall(PetscStrcasecmp(name, "PETSC_DEFAULT", &match)); in PetscOptionsStringToReal()
2312 if (!match) PetscCall(PetscStrcasecmp(name, "DEFAULT", &match)); in PetscOptionsStringToReal()
2318 PetscCall(PetscStrcasecmp(name, "PETSC_DECIDE", &match)); in PetscOptionsStringToReal()
2319 if (!match) PetscCall(PetscStrcasecmp(name, "DECIDE", &match)); in PetscOptionsStringToReal()
2325 PetscCall(PetscStrcasecmp(name, "PETSC_DETERMINE", &match)); in PetscOptionsStringToReal()
2326 if (!match) PetscCall(PetscStrcasecmp(name, "DETERMINE", &match)); in PetscOptionsStringToReal()
2332 PetscCall(PetscStrcasecmp(name, "PETSC_UNLIMITED", &match)); in PetscOptionsStringToReal()
2333 if (!match) PetscCall(PetscStrcasecmp(name, "UNLIMITED", &match)); in PetscOptionsStringToReal()
2339 PetscCall(PetscStrtod(name, a, &endptr)); in PetscOptionsStringToReal()
2340 …scCheck((size_t)(endptr - name) == len, PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Input string %… in PetscOptionsStringToReal()
2344 PetscErrorCode PetscOptionsStringToScalar(const char name[], PetscScalar *a) in PetscOptionsStringToScalar() argument
2352 PetscCall(PetscStrlen(name, &len)); in PetscOptionsStringToScalar()
2354 PetscCall(PetscStrtoz(name, &val, &ptr, &imag1)); in PetscOptionsStringToScalar()
2356 if ((size_t)(ptr - name) < len) { in PetscOptionsStringToScalar()
2361 …_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Input string %s: must specify imaginary component second", name); in PetscOptionsStringToScalar()
2365 …etscCheck((size_t)(ptr - name) == len, PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Input string %s… in PetscOptionsStringToScalar()
2404 PetscErrorCode PetscOptionsGetBool(PetscOptions options, const char pre[], const char name[], Petsc… in PetscOptionsGetBool() argument
2410 PetscAssertPointer(name, 3); in PetscOptionsGetBool()
2412 PetscCall(PetscOptionsFindPair(options, pre, name, &value, &flag)); in PetscOptionsGetBool()
2458 PetscErrorCode PetscOptionsGetBool3(PetscOptions options, const char pre[], const char name[], Pets… in PetscOptionsGetBool3() argument
2464 PetscAssertPointer(name, 3); in PetscOptionsGetBool3()
2466 PetscCall(PetscOptionsFindPair(options, pre, name, &value, &flag)); in PetscOptionsGetBool3()
2633 PetscErrorCode PetscOptionsGetInt(PetscOptions options, const char pre[], const char name[], PetscI… in PetscOptionsGetInt() argument
2639 PetscAssertPointer(name, 3); in PetscOptionsGetInt()
2641 PetscCall(PetscOptionsFindPair(options, pre, name, &value, &flag)); in PetscOptionsGetInt()
2687 PetscErrorCode PetscOptionsGetMPIInt(PetscOptions options, const char pre[], const char name[], Pet… in PetscOptionsGetMPIInt() argument
2693 PetscCall(PetscOptionsGetInt(options, pre, name, &value, &flag)); in PetscOptionsGetMPIInt()
2731 PetscErrorCode PetscOptionsGetReal(PetscOptions options, const char pre[], const char name[], Petsc… in PetscOptionsGetReal() argument
2737 PetscAssertPointer(name, 3); in PetscOptionsGetReal()
2739 PetscCall(PetscOptionsFindPair(options, pre, name, &value, &flag)); in PetscOptionsGetReal()
2784 PetscErrorCode PetscOptionsGetScalar(PetscOptions options, const char pre[], const char name[], Pet… in PetscOptionsGetScalar() argument
2790 PetscAssertPointer(name, 3); in PetscOptionsGetScalar()
2792 PetscCall(PetscOptionsFindPair(options, pre, name, &value, &flag)); in PetscOptionsGetScalar()
2851 PetscErrorCode PetscOptionsGetString(PetscOptions options, const char pre[], const char name[], cha… in PetscOptionsGetString() argument
2857 PetscAssertPointer(name, 3); in PetscOptionsGetString()
2859 PetscCall(PetscOptionsFindPair(options, pre, name, &value, &flag)); in PetscOptionsGetString()
2898 PetscErrorCode PetscOptionsGetBoolArray(PetscOptions options, const char pre[], const char name[], … in PetscOptionsGetBoolArray() argument
2907 PetscAssertPointer(name, 3); in PetscOptionsGetBoolArray()
2911 PetscCall(PetscOptionsFindPair(options, pre, name, &svalue, &flag)); in PetscOptionsGetBoolArray()
2961 PetscErrorCode PetscOptionsGetEnumArray(PetscOptions options, const char pre[], const char name[], … in PetscOptionsGetEnumArray() argument
2971 PetscAssertPointer(name, 3); in PetscOptionsGetEnumArray()
2976 PetscCall(PetscOptionsFindPair(options, pre, name, &svalue, &flag)); in PetscOptionsGetEnumArray()
2987 …_COMM_SELF, PETSC_ERR_USER, "Unknown enum value '%s' for -%s%s", svalue, pre ? pre : "", name + 1); in PetscOptionsGetEnumArray()
3029 PetscErrorCode PetscOptionsGetIntArray(PetscOptions options, const char pre[], const char name[], P… in PetscOptionsGetIntArray() argument
3039 PetscAssertPointer(name, 3); in PetscOptionsGetIntArray()
3043 PetscCall(PetscOptionsFindPair(options, pre, name, &svalue, &flag)); in PetscOptionsGetIntArray()
3129 PetscErrorCode PetscOptionsGetRealArray(PetscOptions options, const char pre[], const char name[], … in PetscOptionsGetRealArray() argument
3138 PetscAssertPointer(name, 3); in PetscOptionsGetRealArray()
3142 PetscCall(PetscOptionsFindPair(options, pre, name, &svalue, &flag)); in PetscOptionsGetRealArray()
3186 PetscErrorCode PetscOptionsGetScalarArray(PetscOptions options, const char pre[], const char name[]… in PetscOptionsGetScalarArray() argument
3195 PetscAssertPointer(name, 3); in PetscOptionsGetScalarArray()
3199 PetscCall(PetscOptionsFindPair(options, pre, name, &svalue, &flag)); in PetscOptionsGetScalarArray()
3252 PetscErrorCode PetscOptionsGetStringArray(PetscOptions options, const char pre[], const char name[]… in PetscOptionsGetStringArray() argument
3261 PetscAssertPointer(name, 3); in PetscOptionsGetStringArray()
3265 PetscCall(PetscOptionsFindPair(options, pre, name, &svalue, &flag)); in PetscOptionsGetStringArray()