> > As you advised, I edited that part in "RB_construction.C" and ran my code > again. > > As a result, I could obtain the correct result. >
OK, good to hear! By the way, I didn't mean that you need to edit rb_construction.C. The impose_internal_fluxes boolean is a public member of the RBConstruction class, so you can just set impose_internal_fluxes to true in the RBConstruction object that you're using. You can do that in your application code, no need to edit the libMesh library code. Best, David > ----- Original Message ----- > From : David Knezevic <david.kneze...@akselos.com> > To : "Shinseong Kang" <ss.k...@pusan.ac.kr> > Cc : "Libmesh user group" <libmesh-users@lists.sourceforge.net> > Sent : 2019-10-08 21:53:36 > Subject : Re: [RB] Assembly for a Interior (neighbor) side between elements > > > Hello, > > I think your approach is basically correct, but issue is that by default > the code skips assembly on internal sides for the sake of efficiency (since > usually we do not need to do assembly on internal sides). In order to not > skip internal sides you can set "impose_internal_fluxes = true" on your > RBConstruction object. That is false by default and if you look > at RBConstruction::add_scaled_matrix_and_vector() you will see that you > have to set it to true in order to loop over non-boundary sides. > > Let me know if that works for you. > > Best, > David > > On Tue, Oct 8, 2019 at 6:57 AM Shinseong Kang <ss.k...@pusan.ac.kr> wrote: > >> Hello, all. >> >> >> >> I tried to define an output in a simply supported 3-D beam problem. >> >> My output is an average displacement in the middle of the beam. >> >> For simplicity, I only used two brick elements, i.e, ■|■, where "■" is >> an element, and "|" is a location I want to compute the average output. >> >> >> To do this, I utilized the codes in RB example 5. >> >> First, I declared "ThetaOutput" (parameter-dependent term) and >> also declared "AssemblyOutput" (parameter-independent term) as follows: >> >> ======================================= >> >> void AssemblyOutput::boundary_assembly(FEMContext & c) >> >> { >> >> if (rb_sys.get_mesh().get_boundary_info().has_boundary_id >> >> (&c.get_elem(), c.side, BOUNDARY_ID_MID)) >> >> { >> >> const unsigned int u_var = 0; >> >> const unsigned int v_var = 1; >> >> >> FEBase * side_fe = libmesh_nullptr; >> >> c.get_side_fe(v_var, side_fe); >> >> >> const std::vector<Real> & JxW_side = side_fe->get_JxW(); >> >> >> const std::vector<std::vector<Real> > & phi_side = >> side_fe->get_phi(); >> >> >> const unsigned int n_v_dofs = c.get_dof_indices(v_var).size(); >> >> >> unsigned int n_qpoints = c.get_side_qrule().n_points(); >> >> DenseSubVector<Number> & output = c.get_elem_residual(v_var); >> >> >> for (unsigned int qp=0; qp < n_qpoints; qp++) >> >> for (unsigned int i=0; i < n_v_dofs; i++) >> >> output(i) += JxW_side[qp] * (1. * phi_side[i][qp]); >> >> } >> >> } >> >> ======================================= >> As you can see, The above code is very similar to "Assemblyp1" in >> "assembly.C" of RB example 5. >> >> However, I could not obtain the correct output because the above code >> cannot deal with interior side between elements. >> In other words, the boundary information of FEMContext only include outer >> side. >> >> I tried to find another way, but I could not find the right solution. >> Therefore, I'd like your help. >> >> To summarize my questions are as follows: >> 1. Is there any way to assemble an interior (neighbor) side between >> elements? >> 2. How to compute an average displacement for the middle of a beam in >> terms of the RB codes? >> >> >> Thank you. >> >> >> >> Best regards, >> >> Kang >> >> >> ------------------------------------------------------------ >> >> Shinseong Kang >> Graduate Student >> Pusan National University, South Korea >> >> Tel.: +82-051-510-3052 >> H.P.: +82-010-9770-6595 >> E-mail: ss.k...@pusan.ac.kr >> >> ------------------------------------------------------------ >> > _______________________________________________ Libmesh-users mailing list Libmesh-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libmesh-users