On Wed, 6 Feb 2013, Kyunghoon Lee wrote: > I checked transient_ex1.C and found it handles inhomogeneous Dirichlet BCs > by the penalty method. Instead of the penalty method, I wonder if I can > specify them directly with DirichletBoundary class as shown below: > > system.attach_assemble_function(assemble_Laplace); > > std::set<boundary_id_type> boundary_ids0; > boundary_ids0.insert(0); // bottom > std::vector<unsigned int> u0(1); u0[0] = u_var; > ConstFunction<Number> u0_value0(0.0); > DirichletBoundary dirichlet_bc0(boundary_ids0,u0,&u0_value0); > system.get_dof_map().add_dirichlet_boundary(dirichlet_bc0); > > equation_systems.init(); > > I tried but it seemed not working properly.
Using DirichletBoundary constraints is trickier than the penalty method: in the system assembly process, you need to make sure that constraints are applied in a heterogenous way or homogenous way depending on whether the system's solution vector should meet the heterogenous constraint values (like a nonlinear solution u would be) or should be zero at those values (like a Newton descent step or a transient delta_u would be). The constrain_ call in transient_ex1.C only does the latter, but at first glance it looks like that's a linear problem solving directly for the solution in which case the former heterogenously_constrain_ call would be appropriate instead. --- Roy ------------------------------------------------------------------------------ Free Next-Gen Firewall Hardware Offer Buy your Sophos next-gen firewall before the end March 2013 and get the hardware for free! Learn more. http://p.sf.net/sfu/sophos-d2d-feb _______________________________________________ Libmesh-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/libmesh-users
