Hi, Roy, Thank you for your answer! I tried 'ghosted', but still got the same error. U11 only contains local dofs, but I want U11 contains all dofs. Anything else I'm missing?
2012/8/26 Roy Stogner <[email protected]>: > > On Sun, 26 Aug 2012, 蔡园武 wrote: > >> I tried to use parallel in my code, but got error. I traced my code and >> found where the error is: >> I defined vector using: >> NumericVector < Number > &U11 = system.add_vector("U11"); >> and init it: >> U11.init(system.n_dofs(), system.n_local_dofs()); >> After solve, I stored the solution in the vector: >> U11 = *system.solution; >> Then, in the following, I want to use the solution value in the vector: >> a = U11(dof_indices[i]); >> But I found that U11 only contains local dofs, when I want to access dofs >> not stored in local, I got an error. >> So where am I wrong? > > > The easiest solution: tell U11 to be a "ghosted" rather than a > "parallel" vector. > > bool do_I_want_this_projected = true; // or false, your choice > NumericVector < Number > &U11 = > system.add_vector("U11", do_I_want_this_projected, GHOSTED); > --- > Roy -- Cai Yuanwu 蔡园武 Dept. of Engineering Mechanics, Dalian University of Technology, Dalian 116024, China ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Libmesh-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/libmesh-users
