| 107 | |
| 108 | |
| 109 | LinearSOE* |
| 110 | G3Parse_newLinearSOE(ClientData clientData, Tcl_Interp* interp, Tcl_Size argc, |
| 111 | G3_Char ** const argv) |
| 112 | { |
| 113 | G3_Runtime* rt = G3_getRuntime(interp); |
| 114 | |
| 115 | // argc is checked by calling function; |
| 116 | |
| 117 | LinearSOE *theSOE = nullptr; |
| 118 | std::string sys_name{argv[1]}; |
| 119 | transform(sys_name.begin(), sys_name.end(), sys_name.begin(), ::tolower); |
| 120 | auto ctor = soe_table.find(sys_name); |
| 121 | |
| 122 | if (ctor != soe_table.end()) { |
| 123 | return ctor->second.ss(rt, argc, argv); |
| 124 | } |
| 125 | |
| 126 | #if defined(XARA_USE_MUMPS) |
| 127 | else if (strcasecmp(argv[1], "mumps") == 0) { |
| 128 | return TclDispatch_newMumpsLinearSOE(clientData, interp, argc, argv); |
| 129 | } |
| 130 | #endif |
| 131 | |
| 132 | else if (strcasecmp(argv[1], "Umfpack")==0) { |
| 133 | // TODO: if "umfpack" is in solver.hpp, this wont be reached |
| 134 | return TclDispatch_newUmfpackLinearSOE(clientData, interp, argc, argv); |
| 135 | } |
| 136 | |
| 137 | #if defined(OPS_PETSC) |
| 138 | else if (strcmp(argv[1], "petsc")==0 || |
| 139 | strcmp(argv[1], "Petsc")==0) { |
| 140 | theSOE = TclDispatch_newPetscSOE(clientData, interp, argc, argv); |
| 141 | } |
| 142 | #endif |
| 143 | |
| 144 | // Diagonal SOE & SOLVER |
| 145 | #ifdef _PARALLEL_INTERPRETERS |
| 146 | else if (strcmp(argv[1], "ParallelProfileSPD") == 0) { |
| 147 | ProfileSPDLinSolver *theSolver = new ProfileSPDLinDirectSolver(); |
| 148 | DistributedProfileSPDLinSOE *theParallelSOE = |
| 149 | new DistributedProfileSPDLinSOE(*theSolver); |
| 150 | theSOE = theParallelSOE; |
| 151 | theParallelSOE->setProcessID(OPS_rank); |
| 152 | theParallelSOE->setChannels(numChannels, theChannels); |
| 153 | } |
| 154 | #endif |
| 155 | |
| 156 | #ifdef _PARALLEL_INTERPRETERS |
| 157 | else if (strcmp(argv[1], "MPIDiagonal") == 0) { |
| 158 | setMPIDSOEFlag = true; |
| 159 | } |
| 160 | #endif |
| 161 | |
| 162 | else { |
| 163 | opserr << OpenSees::PromptValueError |
| 164 | << " system '" |
| 165 | << argv[1] << "' is unknown or not installed\n"; |
| 166 | return nullptr; |
no test coverage detected