From: David K. <dav...@ak...> - 2018-01-18 18:12:48
|
Hello, The key point here is that if you check the literature on reduced basis methods you'll see that you should not impose non-zero Dirichlet conditions directly. If you do that then the RB basis functions would have non-zero boundary values on the Dirichlet boundary and that would impose a constraint on how the basis functions can be summed up in order to satisfy the specified boundary values, and this would strongly limit the RB convergence. What you should do instead is use a "lifting function", i.e. let u denote the desired solution with non-zero boundary values, and introduce \hat u = u - g, where g is the lifting function that you specify yourself which satisfies the boundary conditions as well. Substitute u = \hat u + g into your PDE, and you'll get a PDE for \hat u that you can solve, where g ends up on the right-hand side. You can then solve for \hat u, which has zero Dirichlet boundary conditions, and reconstruct u at the end via u = \hat u + g. Hope that helps, David On Thu, Jan 18, 2018 at 12:22 PM, <cau...@gm...> wrote: > Hello, > > > > I am now trying to solve the thermoelasticity problem using libmesh. I > modified ex3 of reduced_basis by adding the temperature as a variable and > by adjusting the matrixes. I started from a simple steady case of a cuboid. > Its left side is clamped and the temperature there is fixed at 0 degree > while there is a heat flux entering on the right side. The heat flux is set > as the only parameter. It works well but I encountered problems when > imposing a non-zero temperature on the left. > > > > At the beginning, I tried penalty method and intended to set the boundary > temperature as a parameter. Therefore, I add a new matrix and a new vector > in assembly.c. These two objects are defined as boundary_assembly and the > terms are calculated like in ex3 of introduction. However, a convergence > error occurs: > > > > ============================================================ > ================ > ==================================== > > Assembling affine operator 1 of 2 > > Assembling affine operator 2 of 2 > > Assembling affine vector 1 of 2 > > Assembling affine vector 2 of 2 > > Convergence error. Error id: -3 > > Stack frames: 8 > > 0: libMesh::print_trace(std::ostream&) > > 1: libMesh::MacroFunctions::report_error(char const*, int, char const*, > char > const*) > > 2: > libMesh::RBConstruction::check_convergence(libMesh::LinearSolver<double>&) > > 3: libMesh::RBConstruction::compute_Fq_representor_innerprods(bool) > > 4: libMesh::RBConstruction::train_reduced_basis(bool) > > 5: ./Thermoelasticity-opt() [0x41df39] > > 6: __libc_start_main > > 7: ./Thermoelasticity-opt() [0x41e77d] > > [0] src/reduced_basis/rb_construction.C, line 2124, compiled Jan 6 2018 > at > 16:42:44 > > > > > > Then I turned to another method. I created a DirichletBoundary object and > add it to the map just like ex4 of introduction except that I defined a > function that returns a constant instead of the "exact_solution": > > > > ============================================================ > ================ > ============================================================ > ================ > =========================== > > std::set<boundary_id_type> boundary_ids; > boundary_ids.insert(BOUNDARY_ID_MIN_X); > > // Create a vector storing the variable numbers which the BC applies to > std::vector<unsigned int> variables(4); > variables[0] = T_var; > > std::vector<unsigned int> variables_displacement(3); > variables_displacement[0] = u_var; variables_displacement[1] = v_var; > variables_displacement[2] = w_var; > > ZeroFunction<> zf; > AnalyticFunction<> fun_object(fun_wrapper); > > DirichletBoundary dirichlet_bc(boundary_ids, variables, fun_object); > > DirichletBoundary dirichlet_bc_displacment(boundary_ids, > variables_displacement, zf); > > get_dof_map().add_dirichlet_boundary(dirichlet_bc); > > get_dof_map().add_dirichlet_boundary(dirichlet_bc_displacement); > > ============================================================ > ================ > ===================================== > > > > in rb_classes.h. The code runs well but when I check the output, I find > that > the temperature on the left remains 0 instead of the value I set in the > constant function. > > > > I would like to know whether my methods are right or not. If not, could you > please tell me where the error is and show me other possible solution? > Thanks a lot for your kindness. > > > > Best regards, > > > > Gauvain > > > > > > ------------------------------------------------------------ > ------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > Libmesh-users mailing list > Lib...@li... > https://lists.sourceforge.net/lists/listinfo/libmesh-users > |