From: Jan B. <bie...@tu...> - 2006-10-25 09:30:21
|
*Hey guys, I have the following problem and I am very thakful for every hint that helps solving it. I do have a FrequencySystem properly set up and initialized:* EquationSystems equation_systems (mesh, &mesh_data); FrequencySystem& system = equation_systems.add_system<FrequencySystem> ("Helmholtz"); FEType fe_type(SECOND, LAGRANGE, SIXTH); FrequencySystem& system = equation_systems.add_system<FrequencySystem> ("Helmholtz"); equation_systems.get_system<FrequencySystem>("Helmholtz").linear_solver->set_solver_type (solver_type); equation_systems.get_system<FrequencySystem>("Helmholtz").linear_solver->set_preconditioner_type (precond_type); equation_systems.parameters.set<Real> ("linear solver tolerance") = solver_tolerance; equation_systems.get_system<FrequencySystem>("Helmholtz").add_variable("p", fe_type); equation_systems.get_system<FrequencySystem>("Helmholtz").add_matrix("damping"); equation_systems.get_system<FrequencySystem>("Helmholtz").add_matrix("stiffness"); equation_systems.get_system<FrequencySystem>("Helmholtz").add_matrix("mass"); equation_systems.get_system<FrequencySystem>("Helmholtz").attach_assemble_function (assemble_helmholtz); equation_systems.get_system<FrequencySystem>("Helmholtz").attach_solve_function (add_M_C_K_helmholtz); equation_systems.get_system<FrequencySystem>("Helmholtz").set_frequencies(freq_vector, false); equation_systems.parameters.set<Real>("speed") = 3.4e5; equation_systems.parameters.set<Real>("fluid density") = 1.225e-12; equation_systems.parameters.set<Real>("current frequency") = 0.; equation_systems.get_system<FrequencySystem>("Helmholtz").init(); * Now I want to change the order to SECOND at a certain frequency. Therefor, I delete the system and set it up again* equation_systems.delete_system("Helmholtz"); FEType fe_type(SECOND, LAGRANGE, SIXTH); FrequencySystem& system = equation_systems.add_system<FrequencySystem> ("Helmholtz"); FEType fe_type(SECOND, LAGRANGE, SIXTH); FrequencySystem& system = equation_systems.add_system<FrequencySystem> ("Helmholtz"); equation_systems.get_system<FrequencySystem>("Helmholtz").linear_solver->set_solver_type (solver_type); equation_systems.get_system<FrequencySystem>("Helmholtz").linear_solver->set_preconditioner_type (precond_type); equation_systems.parameters.set<Real> ("linear solver tolerance") = solver_tolerance; equation_systems.get_system<FrequencySystem>("Helmholtz").add_variable("p", fe_type); equation_systems.get_system<FrequencySystem>("Helmholtz").add_matrix("damping"); equation_systems.get_system<FrequencySystem>("Helmholtz").add_matrix("stiffness"); equation_systems.get_system<FrequencySystem>("Helmholtz").add_matrix("mass"); equation_systems.get_system<FrequencySystem>("Helmholtz").attach_assemble_function (assemble_helmholtz); equation_systems.get_system<FrequencySystem>("Helmholtz").attach_solve_function (add_M_C_K_helmholtz); equation_systems.get_system<FrequencySystem>("Helmholtz").set_frequencies(freq_vector, false); equation_systems.parameters.set<Real>("speed") = 3.4e5; equation_systems.parameters.set<Real>("fluid density") = 1.225e-12; equation_systems.parameters.set<Real>("current frequency") = 0.; equation_systems.get_system<FrequencySystem>("Helmholtz").init(); * but at the init() the program hangs-up whichs goes down to the call:* solution->init (this->n_dofs(), this->n_local_dofs()); *in the init_data() function of system.C. This causes just the call * ierr = VecCreateMPI (libMesh::COMM_WORLD, petsc_n_local, petsc_n, &_vec); CHKERRABORT(libMesh::COMM_WORLD,ierr); * in petsc_vector.C.* This problem just appears in parallel mode!!(so not if ierr = VecCreateSeq (PETSC_COMM_SELF, petsc_n, &_vec); CHKERRABORT(PETSC_COMM_SELF,ierr); *is called for solution->init(...) **I have no idea what the difference is between creating a system and init() and deleting an existing system and then creating a new one and init(). Thanks a lot for your help, Jan* |