103 const ParameterList& pL = GetParameterList();
105 std::string variableName =
"";
106 if (pL.isParameter(
"Variable"))
107 variableName = pL.get<std::string>(
"Variable");
109 std::string variableType =
"";
110 if(pL.isParameter(
"Variable type"))
111 variableType = pL.get<std::string>(
"Variable type");
113 std::string factoryName =
"NoFactory";
115 factoryName =
"Fine level factory";
117 factoryName =
"Coarse level factory";
119 RCP<const FactoryBase> fact = GetFactory(factoryName);
121 GetOStream(
Debug) <<
"Use " << variableName <<
" of type " << variableType <<
" from " << factoryName <<
"(" << fact.get() <<
")" << std::endl;
125 if (variableType ==
"int") {
126 int data = currentLevel.
Get<
int>(variableName, fact.get());
127 Set(currentLevel, variableName, data);
128 }
else if (variableType ==
"double") {
129 double data = currentLevel.
Get<
double>(variableName, fact.get());
130 Set(currentLevel, variableName, data);
131 }
else if (variableType ==
"string") {
132 std::string data = currentLevel.
Get<std::string>(variableName, fact.get());
133 Set(currentLevel, variableName, data);
135 size_t npos = std::string::npos;
137 if (variableType.find(
"Aggregates") != npos) {
138 RCP<Aggregates> data = currentLevel.
Get<RCP<Aggregates> >(variableName, fact.get());
139 Set(currentLevel, variableName, data);
141 else if (variableType.find(
"Graph") != npos) {
142 RCP<Graph> data = currentLevel.
Get<RCP<Graph> >(variableName, fact.get());
143 Set(currentLevel, variableName, data);
145 else if (variableType.find(
"SmootherBase") != npos) {
146 RCP<SmootherBase> data = currentLevel.
Get<RCP<SmootherBase> >(variableName, fact.get());
147 Set(currentLevel, variableName, data);
149 else if (variableType.find(
"SmootherPrototype") != npos) {
150 RCP<SmootherPrototype> data = currentLevel.
Get<RCP<SmootherPrototype> >(variableName, fact.get());
151 Set(currentLevel, variableName, data);
153 else if (variableType.find(
"Export") != npos) {
154 RCP<Export> data = currentLevel.
Get<RCP<Export> >(variableName, fact.get());
155 Set(currentLevel, variableName, data);
157 else if (variableType.find(
"Import") != npos) {
158 RCP<Import> data = currentLevel.
Get<RCP<Import> >(variableName, fact.get());
159 Set(currentLevel, variableName, data);
161 else if (variableType.find(
"Map") != npos) {
162 RCP<Map> data = currentLevel.
Get<RCP<Map> >(variableName, fact.get());
163 Set(currentLevel, variableName, data);
165 else if (variableType.find(
"Matrix") != npos) {
166 RCP<Matrix> data = currentLevel.
Get<RCP<Matrix> >(variableName, fact.get());
167 Set(currentLevel, variableName, data);
169 else if (variableType.find(
"MultiVector") != npos) {
170 RCP<MultiVector> data = currentLevel.
Get<RCP<MultiVector> >(variableName, fact.get());
171 Set(currentLevel, variableName, data);
173 else if (variableType.find(
"Operator") != npos) {
174 RCP<Operator> data = currentLevel.
Get<RCP<Operator> >(variableName, fact.get());
175 Set(currentLevel, variableName, data);
179 TEUCHOS_TEST_FOR_EXCEPTION(
true,
MueLu::Exceptions::RuntimeError,
"FineLevelInputDataFactory: cannot detect type of variable " << variableName <<
" generated by " << fact.get() <<
". User provided type " << variableType );