43 #include <Teuchos_StandardParameterEntryValidators.hpp>
49 const std::string& paramName)
52 typedef Teuchos::StringToIntegralParameterEntryValidator<enum_type>
55 const std::string docString =
"Tpetra::CombineMode: rule for combining "
56 "entries that overlap across processes, when redistributing data via a "
57 "Tpetra::Import or Tpetra::Export";
58 const std::string defaultVal =
"ADD";
59 const bool caseSensitive =
false;
61 const Teuchos::Array<std::string>::size_type numParams = 5;
62 Teuchos::Array<std::string> strs (numParams);
63 Teuchos::Array<std::string> docs (numParams);
64 Teuchos::Array<enum_type> vals (numParams);
72 docs[0] =
"Sum new values into existing values";
73 docs[1] =
"Insert new values that don't currently exist";
74 docs[2] =
"Replace existing values with new values";
75 docs[3] =
"Replace old value with maximum of magnitudes of old and new values";
76 docs[4] =
"Replace old values with zero";
84 plist.set (paramName, defaultVal, docString,
85 Teuchos::rcp (
new validator_type (strs (), docs (), vals (),
86 defaultVal, caseSensitive)));
91 std::string combineModeStr;
92 switch (combineMode) {
94 combineModeStr =
"ADD";
97 combineModeStr =
"REPLACE";
100 combineModeStr =
"ABSMAX";
103 combineModeStr =
"INSERT";
106 combineModeStr =
"ZERO";
109 combineModeStr =
"INVALID";
111 return combineModeStr;