My bad, the line "nuE1[node->id()] = soln1[node->id()];" worked so far but was incorrect for this case. It works now, thanks again.
On Sun, May 29, 2016 at 5:29 PM, Pepijn Kessels <[email protected]> wrote: > Thanks, that's a nice feature. I tried this for my problem which has an > equation_systems with two systems attached to it. For my Navier-Stokes > system the coarse solution has been projected correctly on the fine mesh. > However for my turbulence model system1 the coarse solution seems to be > scrambled on the fine mesh. The solution of a coarse mesh node in the fine > mesh seems to be connected to a different node now. I'm not sure why it is > correct for one and not for the other. It could be with how I write the > solution to a text file, though I never had problems with this before. Here > is the code for that: > > > std::vector<Number> soln ; > std::vector<Number> soln1; > system.solution->localize_to_one(soln); > system1.solution->localize_to_one(soln1); > > if (mesh.processor_id() == 0) > { > std::vector<Number> u_permute(mesh.n_nodes()); > std::vector<Number> v_permute(mesh.n_nodes()); > std::vector<Number> p_permute(mesh.n_nodes()); > std::vector<Number> x_coord(mesh.n_nodes()); > std::vector<Number> y_coord(mesh.n_nodes()); > std::vector<Number> nuE1(mesh.n_nodes()); > > MeshBase::const_node_iterator nd = mesh.nodes_begin(); > MeshBase::const_node_iterator nd_end = mesh.nodes_end(); > > for (; nd != nd_end; ++nd) > { > const Node* node = *nd; > > u_permute[node->id()] = soln[node->dof_number(0,0,0)]; > v_permute[node->id()] = soln[node->dof_number(0,1,0)]; > p_permute[node->id()] = soln[node->dof_number(0,2,0)]; > x_coord[node->id()] = (*node)(0); > y_coord[node->id()] = (*node)(1); > nuE1[node->id()] = soln1[node->id()]; > } > std::ostringstream filen; > filen << "NavierStokesSolutionMatlabCoarse_" > << std::setw(3) > << std::setfill('0') > << std::right > << t_step + 1 > << ".txt"; > std::ofstream datfile; > datfile.precision(12); > datfile.open(filen.str()); > > for (uint ii=0; ii<u_permute.size(); ii++) > { > datfile << x_coord[ii] << " " << y_coord[ii] << " " << > u_permute[ii] << " " << v_permute[ii] << " " << p_permute[ii] << " " << > nuE1[ii] << std::endl; > } > datfile.close(); > } > > > > Otherwise it may have to do with node renumbering. I also tried to just > use the turbulence model system and comment out the N-S system, but this > yielded the same result. Do you have an idea what could have happened? > > Kind regards, > > Pepijn > > On Sat, May 28, 2016 at 11:00 PM, Derek Gaston <[email protected]> wrote: > >> Don't treat them as separate meshes. Get the values you want on the >> coarse mesh and then uniform_refine() it in libMesh as many times as you >> want... libMesh will automatically project the solution on the the finer >> meshes each time you call EquationSystems::reinit(). Then start solving on >> that fine mesh... >> >> Derek >> >> On Sat, May 28, 2016 at 4:32 PM Pepijn Kessels <[email protected]> >> wrote: >> >>> Hi there, >>> >>> I have a coarse structured mesh, and a couple more that are integer >>> refinements of it. I have the solution for the coarse mesh and could not >>> find if libMesh has the possibility to interpolate this solution onto the >>> finer meshes. That would be nice since I can then use that as an initial >>> solution for solving the finer meshes, saving me a lot of time. Any help >>> would be appreciated. >>> >>> Kind regards, >>> >>> Pepijn >>> >>> ------------------------------------------------------------------------------ >>> What NetFlow Analyzer can do for you? Monitors network bandwidth and >>> traffic >>> patterns at an interface-level. Reveals which users, apps, and protocols >>> are >>> consuming the most bandwidth. Provides multi-vendor support for NetFlow, >>> J-Flow, sFlow and other flows. Make informed decisions using capacity >>> planning reports. >>> https://ad.doubleclick.net/ddm/clk/305295220;132659582;e >>> _______________________________________________ >>> Libmesh-users mailing list >>> [email protected] >>> https://lists.sourceforge.net/lists/listinfo/libmesh-users >>> >> > ------------------------------------------------------------------------------ What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic patterns at an interface-level. Reveals which users, apps, and protocols are consuming the most bandwidth. Provides multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make informed decisions using capacity planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e _______________________________________________ Libmesh-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/libmesh-users
