11 #include <Teuchos_StandardParameterEntryValidators.hpp>
17 const std::string& paramName)
20 typedef Teuchos::StringToIntegralParameterEntryValidator<enum_type>
23 const std::string docString =
"Tpetra::CombineMode: rule for combining "
24 "entries that overlap across processes, when redistributing data via a "
25 "Tpetra::Import or Tpetra::Export";
26 const std::string defaultVal =
"ADD";
27 const bool caseSensitive =
false;
29 const Teuchos::Array<std::string>::size_type numParams = 6;
30 Teuchos::Array<std::string> strs (numParams);
31 Teuchos::Array<std::string> docs (numParams);
32 Teuchos::Array<enum_type> vals (numParams);
39 strs[5] =
"ADD_ASSIGN";
41 docs[0] =
"Sum new values";
42 docs[1] =
"Insert new values that don't currently exist";
43 docs[2] =
"Replace existing values with new values";
44 docs[3] =
"Replace old value with maximum of magnitudes of old and new values";
45 docs[4] =
"Replace old values with zero";
46 docs[5] =
"Do addition assignment (+=) of new values into existing value; "
47 "may not be supported by all classes";
56 plist.set (paramName, defaultVal, docString,
57 Teuchos::rcp (
new validator_type (strs (), docs (), vals (),
58 defaultVal, caseSensitive)));
63 std::string combineModeStr;
64 switch (combineMode) {
66 combineModeStr =
"ADD";
69 combineModeStr =
"REPLACE";
72 combineModeStr =
"ABSMAX";
75 combineModeStr =
"INSERT";
78 combineModeStr =
"ZERO";
81 combineModeStr =
"ADD_ASSIGN";
84 combineModeStr =
"INVALID";
86 return combineModeStr;
void setCombineModeParameter(Teuchos::ParameterList &plist, const std::string ¶mName)
Set CombineMode parameter in a Teuchos::ParameterList.
Insert new values that don't currently exist.
Declaration of Tpetra::CombineMode enum, and a function for setting a Tpetra::CombineMode parameter i...
CombineMode
Rule for combining data in an Import or Export.
Replace old value with maximum of magnitudes of old and new values.
Replace existing values with new values.
Replace old values with zero.
std::string combineModeToString(const CombineMode combineMode)
Human-readable string representation of the given CombineMode.
Accumulate new values into existing values (may not be supported in all classes)