void EigenSystem::addKernel(const std::string & kernel_name, const std::string & name, InputParameters parameters) { for (THREAD_ID tid = 0; tid < libMesh::n_threads(); tid++) { // Set the parameters for thread ID and material data parameters.set<THREAD_ID>("_tid") = tid; parameters.set<MaterialData *>("_material_data") = _fe_problem._material_data[tid]; // In the case of EigenKernels, we might need to add two to the system if (parameters.have_parameter<bool>("eigen")) { { // EigenKernel parameters.set<bool>("implicit") = true; EigenKernel *ekernel = static_cast<EigenKernel *>(_factory.create(kernel_name, name, parameters)); mooseAssert(ekernel != NULL, "Not an EigenKernel object"); if (parameters.get<bool>("eigen")) markEigenVariable(parameters.get<NonlinearVariableName>("variable")); // Extract the SubdomainIDs from the object (via BlockRestrictable class) std::set<SubdomainID> blk_ids = ekernel->blockIDs(); _kernels[tid].addKernel(ekernel, blk_ids); _fe_problem._objects_by_name[tid][name].push_back(ekernel); } if (parameters.get<bool>("eigen")) { // EigenKernel_old parameters.set<bool>("implicit") = false; std::string old_name(name + "_old"); EigenKernel *ekernel = static_cast<EigenKernel *>(_factory.create(kernel_name, old_name, parameters)); _eigen_var_names.insert(parameters.get<NonlinearVariableName>("variable")); // Extract the SubdomainIDs from the object (via BlockRestrictable class) std::set<SubdomainID> blk_ids = ekernel->blockIDs(); _kernels[tid].addKernel(ekernel, blk_ids); _fe_problem._objects_by_name[tid][old_name].push_back(ekernel); } } else // Standard nonlinear system kernel { // Create the kernel object via the factory KernelBase *kernel = static_cast<KernelBase *>(_factory.create(kernel_name, name, parameters)); mooseAssert(kernel != NULL, "Not a Kernel object"); // Extract the SubdomainIDs from the object (via BlockRestrictable class) std::set<SubdomainID> blk_ids = kernel->blockIDs(); _kernels[tid].addKernel(kernel, blk_ids); _fe_problem._objects_by_name[tid][name].push_back(kernel); } } }