Hi Yves, Thank you very much for the advice. The “getfem::add_source_term_brick(model, mim_1,"u_1", "(your expression).Normal", boundary_top_1);” is extremely helpful – making the operation 100 times simpler.
Could you please let me know about the parameter “__fmal” in getfem::add_normal_source_term_brick? Where can I find the documentation or example for it? Thank you very much Regards Zhenghuai Guo From: Yves Renard <[email protected]> Sent: Tuesday, April 30, 2019 12:42 AM To: Zhenghuai Guo <[email protected]>; [email protected] Cc: [email protected]; Konstantinos Poulios <[email protected]> Subject: Re: How to apply hydraulic pressure on the boundary Dear Zhenghuai Guo, Yes, it shoudl work for __fmal = "F" and "u_1" the variable on which you add a source term. Alternatively, If you have an explicit expression, you can just use getfem::add_source_term_brick(model, mim_1,"u_1", "(your expression).Normal", boundary_top_1); Best regards, Yves Le 28/04/2019 à 12:14, Zhenghuai Guo a écrit : Hi , Andriy and Yves and Konstantinos, I would like to add a source term to represent the liquid hydraulic pressure acting on the boundary boundary_top_1. After some study of the getfem, I suspect I can do it as codes below. Could you please advise whether my thinking is right or not? Or is there another better way to do so – because I find it hard to get the outward unit normals according to the geometrical coordinates. Thank you very much. Zhenghuai Guo dim_type N = mesh1.dim(); getfem::mesh_fem mf_rhs(mesh1,N); size_type nb_dof_rhs = mf_rhs.nb_basic_dof(); plain_vector F(nb_dof_rhs*N); getfem::interpolation_function(mf_rhs, F, neumann_val, boundary_top_1); model.add_initialized_fem_data("hydraylic_pressure", mf_rhs, F); mf_rhs.set_finite_element(getfem::fem_descriptor("FEM_PK(2, 1)")); model.add_initialized_scalar_data("hydraylic_pressure", pressure); getfem::add_normal_source_term_brick(model, mim_1,"u_1",__fmal, boundary_top_1); where neumann_val is a function which gives the hydraulic pressure * outward unit normal at the point x on the boundary: base_small_vector neumann_val(const base_node &x) { return hydraulic pressure * ourward unit normal at x; } -- Yves Renard ([email protected]<mailto:[email protected]>) tel : (33) 04.72.43.87.08 INSA-Lyon 20, rue Albert Einstein 69621 Villeurbanne Cedex, FRANCE http://math.univ-lyon1.fr/~renard ---------
