Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Rightclick on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
From: Yujie <recrusader@gm...>  20071004 00:43:19
Attachments:
Message as HTML

HI, Now, I run my program in parallel, I want to output the result by myself, not GMV, tecplot formats. However, I find part of results are zero. I think that processor 0 can't get all the solution. Because I change cpu number and the number of zero is changed. After simulation, how to let processor 0 get all the solution in parallel mode? thanks a lot. Regards, Yujie 
From: Yujie <recrusader@gm...>  20071004 00:43:19
Attachments:
Message as HTML

HI, Now, I run my program in parallel, I want to output the result by myself, not GMV, tecplot formats. However, I find part of results are zero. I think that processor 0 can't get all the solution. Because I change cpu number and the number of zero is changed. After simulation, how to let processor 0 get all the solution in parallel mode? thanks a lot. Regards, Yujie 
From: Yujie <recrusader@gm...>  20071004 01:28:25
Attachments:
Message as HTML

I have added system::update() function before I output the results. However, it doesn't work. Is it wrong? Thanks, Yujie On 10/3/07, Yujie <recrusader@...> wrote: > > HI, > > Now, I run my program in parallel, I want to output the result by myself, > not GMV, tecplot formats. However, I find part of results are zero. I think > that processor 0 can't get all the solution. Because I change cpu number and > the number of zero is changed. After simulation, how to let processor 0 get > all the solution in parallel mode? > > thanks a lot. > > Regards, > Yujie > 
From: Roy Stogner <roystgnr@ic...>  20071004 02:09:05

On Wed, 3 Oct 2007, Yujie wrote: > I have added system::update() function before I output the results. However, > it doesn't work. Is it wrong? System::update() updates the current_local_solution vector from the solution vector, but it only updates "ghost" values on each processor  values which are stores on elements which neighbor that processor's partition. We don't create any serial vectors by default, so if you want to get all your solution values on a single processor you'll need to do it yourself. See the "global_displacement" vector in examples/ex8.C for the simplest code to do this.  Roy 
From: Yujie <recrusader@gm...>  20071004 16:51:58
Attachments:
Message as HTML

Dear Roy: Thank you very much. Because I have several variables in my system. I think the following codes should be better. It is from equation_systems::build_discontious_solution_vector(): 0573 for (; pos != end; ++pos) 00574 { 00575 const System& system = *(pos>second); 00576 const unsigned int nv_sys = system.n_vars(); 00577 00578 system.update_global_solution (sys_soln, 0); 00579 00580 if (_mesh.processor_id() == 0) 00581 { 00582 std::vector<Number> elem_soln; // The finite element solution 00583 std::vector<Number> nodal_soln; // The FE solution interpolated to the nodes 00584 std::vector<unsigned int> dof_indices; // The DOF indices for the finite element 00585 00586 for (unsigned int var=0; var<nv_sys; var++) 00587 { 00588 const FEType& fe_type = system.variable_type(var); 00589 00590 MeshBase::element_iterator it = _mesh.active_elements_begin(); 00591 const MeshBase::element_iterator end = _mesh.active_elements_end(); 00592 00593 unsigned int nn=0; 00594 00595 for ( ; it != end; ++it) 00596 { 00597 const Elem* elem = *it; 00598 system.get_dof_map().dof_indices (elem, dof_indices, var); 00599 00600 elem_soln.resize(dof_indices.size()); 00601 00602 for (unsigned int i=0; i<dof_indices.size(); i++) 00603 elem_soln[i] = sys_soln[dof_indices[i]]; 00604 00605 FEInterface::nodal_soln (dim, 00606 fe_type, 00607 elem, 00608 elem_soln, 00609 nodal_soln); 00610 00611 #ifdef ENABLE_INFINITE_ELEMENTS 00612 // infinite elements should be skipped... 00613 if (!elem>infinite()) 00614 #endif 00615 { 00616 assert (nodal_soln.size() == elem>n_nodes()); 00617 00618 for (unsigned int n=0; n<elem>n_nodes(); n++) 00619 { 00620 soln[nv*(nn++) + (var + var_num)] += 00621 nodal_soln[n]; 00622 } 00623 } 00624 } 00625 } 00626 } 00627 00628 var_num += nv_sys; 00629 } I am wondering that I shoud not use 00605 FEInterface::nodal_soln (dim, 00606 fe_type, 00607 elem, 00608 elem_soln, 00609 nodal_soln); Because I use Firstorder Lagrange Element. I always want to confirm whether the reference element in FE:inverse_map() is isoparameter element? We will integrate on the isoparameter element. The integrate results on the physical element can be obtained by the values times Jacobian. Inverse_map() want to get point (physical element)'s position (reference element). if the FEtype is firstorder lagrange. I think it is simple to get such corresponding relationship. If the FEtype is complicated, it will be difficulat to perform inverse_map(). Is it right? Thanks a lot. Regards, Yujie On 10/3/07, Roy Stogner <roystgnr@...> wrote: > > On Wed, 3 Oct 2007, Yujie wrote: > > > I have added system::update() function before I output the results. > However, > > it doesn't work. Is it wrong? > > System::update() updates the current_local_solution vector from the > solution vector, but it only updates "ghost" values on each processor >  values which are stores on elements which neighbor that processor's > partition. We don't create any serial vectors by default, so if you > want to get all your solution values on a single processor you'll need > to do it yourself. See the "global_displacement" vector in > examples/ex8.C for the simplest code to do this. >  > Roy > 
From: Roy Stogner <roystgnr@ic...>  20071004 17:40:14

On Thu, 4 Oct 2007, Yujie wrote: > Because I have several variables in my system. The code I previously suggested will work just fine no matter how many variables are in your system. > I think the following codes should be better. It is from > equation_systems::build_discontious_solution_vector(): That code doesn't do what you asked, though; you said you wanted to get the solution all on one processor. If what you really want is a nodal interpolant of the solution all on one processor, then the code we use for generating visualization output will work fine too. > I always want to confirm whether the reference element in FE:inverse_map() > is isoparameter element? No. The shape functions are determined by your FEType; the mapping functions are determined by your Elem type. Elements may be iso, super, or subparametric. > We will integrate on the isoparameter element. The > integrate results on the physical element can be obtained by the values > times Jacobian. Inverse_map() want to get point (physical element)'s > position (reference element). inverse_map() may be used to simplify the code when integrating on element sides; but not on element interiors. On element interiors the reference points are generated directly by the quadrature rule and only forward maps are ever needed (if you get_xyz()). > if the FEtype is firstorder lagrange. I think it is simple to get > such corresponding relationship. If the FEtype is complicated, it > will be difficulat to perform inverse_map(). Is it right? An inverse_map() requires a Newton iteration, which will take more than a step or two if you're not using linear geometric elements, but it's hardly difficult, and as far as your code is concerned it's all inverse_map().  Roy 
From: Yujie <recrusader@gm...>  20071004 19:56:17
Attachments:
Message as HTML

Dear Roy: The following codes is about global_displacement from ex8. I change "displacement" in .get_vector() using my variables' name. I can get the corresponding values of my variables by using different variables' name? However, how to know the corresponding relationship between the index of this vector and the global index of point in the mesh, global degree of freedom number in parallel? dof_no may not be local in parallel runs, so we may need a global displacement vector NumericVector<Number> &displacement = t_system.get_vector("displacement"); std::vector<Number> global_displacement(displacement.size()); displacement.localize(global_displacement); Write nodal results to file. The results can then be viewed with e.g. gnuplot (run gnuplot and type 'plot "pressure_node.res" with lines' in the command line) res_out << t_time << "\t" << global_displacement[dof_no] << std::endl; In addition, regarding the codes from build_discontious_solution_vector(); I think that update_globle_solution() for geting all solutions on one processor. ? 00602 for (unsigned int i=0; i<dof_indices.size(); i++) 00603 elem_soln[i] = sys_soln[dof_indices[i]]; for dispatching the values to the corresponding point of variable.? 00605 FEInterface::nodal_soln (dim, 00606 fe_type, 00607 elem, 00608 elem_soln, 00609 nodal_soln); for interpolating? Is it right? thanks a lot. Regards, Yujie On 10/4/07, Roy Stogner <roystgnr@...> wrote: > > On Thu, 4 Oct 2007, Yujie wrote: > > > Because I have several variables in my system. > > The code I previously suggested will work just fine no matter how many > variables are in your system. > > > I think the following codes should be better. It is from > > equation_systems::build_discontious_solution_vector(): > > That code doesn't do what you asked, though; you said you wanted to > get the solution all on one processor. If what you really want is a > nodal interpolant of the solution all on one processor, then the code > we use for generating visualization output will work fine too. > > > I always want to confirm whether the reference element in > FE:inverse_map() > > is isoparameter element? > > No. The shape functions are determined by your FEType; the mapping > functions are determined by your Elem type. Elements may be iso, > super, or subparametric. > > > We will integrate on the isoparameter element. The > > integrate results on the physical element can be obtained by the values > > times Jacobian. Inverse_map() want to get point (physical element)'s > > position (reference element). > > inverse_map() may be used to simplify the code when integrating on > element sides; but not on element interiors. On element interiors the > reference points are generated directly by the quadrature rule and > only forward maps are ever needed (if you get_xyz()). > > > if the FEtype is firstorder lagrange. I think it is simple to get > > such corresponding relationship. If the FEtype is complicated, it > > will be difficulat to perform inverse_map(). Is it right? > > An inverse_map() requires a Newton iteration, which will take more > than a step or two if you're not using linear geometric elements, but > it's hardly difficult, and as far as your code is concerned it's all > inverse_map(). >  > Roy > 
From: Roy Stogner <roystgnr@ic...>  20071004 20:13:42

On Thu, 4 Oct 2007, Yujie wrote: > The following codes is about global_displacement from > ex8. I change "displacement" in .get_vector() using my variables' > name. I can get the corresponding values of my variables by using different > variables' name? No. "displacement" is a vector name, not a variable name. Normally each vector includes coefficients corresponding to each variable in the system; ex8 is special because of the NewmarkSystem formulation they're using for time integration. > However, how to know the corresponding relationship between the > index of this vector and the global index of point in the mesh, > global degree of freedom number in parallel? The same way as the last three or four times you asked. ;) There's nothing different about the DofObject and DofMap behavior in parallel. > In addition, regarding the codes from build_discontious_solution_vector(); > > I think that > update_globle_solution() for geting all solutions on one processor. ? Yes. > 00602 for (unsigned int i=0; i<dof_indices.size(); i++) > 00603 elem_soln[i] = sys_soln[dof_indices[i]]; > for dispatching the values to the corresponding point of variable.? Yes; sys_soln is indexed by global DoF number, elem_soln by local DoF number. > 00605 FEInterface::nodal_soln (dim, > 00606 fe_type, > 00607 elem, > 00608 elem_soln, > 00609 nodal_soln); > for interpolating? Yes. > Is it right? Yes.  Roy 
Sign up for the SourceForge newsletter:
No, thanks