-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathEMICFactory.C
50 lines (44 loc) · 1.39 KB
/
EMICFactory.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*************************************************************************
*
* Copyright (c) 2018-2022, Lawrence Livermore National Security, LLC.
* See the top-level LICENSE file for details.
* Produced at the Lawrence Livermore National Laboratory
*
* SPDX-License-Identifier: MIT
*
************************************************************************/
#include "EMICFactory.H"
#include "SimpleEMIC.H"
#include "Loki_Defines.H"
// Add new derived EMICInterface headers here
namespace Loki {
EMICInterface*
EMICFactory::create(
LokiInputParser& a_pp)
{
// Get the name of the EM initial condition. This is required.
string name("none");
a_pp.query("name", name);
EMICInterface* em_ic_interface = 0;
// If the user forgot the name, error. Otherwise try to build what they
// asked for.
if (name.compare("none") == 0) {
LOKI_ABORT("Missing electromagnetic initial condition ... quitting");
}
else {
if (SimpleEMIC::isType(name)) {
em_ic_interface = new SimpleEMIC(a_pp);
}
// Add new cases here in this form:
// else if (NewEMIC::isType(name)) {
// em_ic_interface = new NewEMIC(a_pp);
// }
else {
ostringstream error_msg;
error_msg << "Unknown electromagnetic initial condition \"" << name
<< "\" ... quitting";
}
}
return em_ic_interface;
}
} // end namespace Loki