On 05/20/2013 03:05 PM, John Peterson wrote:
> On Tue, Apr 30, 2013 at 10:02 AM, Robert Blake <[email protected]>
> wrote:
>> Hi again,
>>
>> I'm trying to use libmesh to replace some legacy custom FEM software. I
>> need an output file where every line of text contains the value of a
>> solution variable at the corresponding node in a VTK input mesh. For
>> example, the value of the solution at node 5 in the VTK file should be
>> at line 5 in the output file.
>>
>> This seems trivial, but I can't figure out how to do this in parallel.
>> MeshData doesn't work in parallel, and partitioning can introduce
>> arbitrary reorderings of the Node ids. I can't figure out how to invert
>> the partitioning so I can get the correct ordering for output.
>>
>> I looked a bit into the Xdr class, and it uses a space-filling curve to
>> construct a canonical ordering. This isn't what I want-- I need the
>> output node ordering to match my input mesh exactly so I can
>> post-process the results with downstream software.
> Have you tried running with SerialMesh and telling it to not renumber
> nodes and elements while reading?
>
> It sounds like you eventually want to use ParallelMesh, but maybe
> getting it to work with SerialMesh will give you some ideas about how
> to handle the parallel case.
>
> If the nodes themselves don't move, perhaps you can use their
> positions to determine the node renumbering map.
>
> --
> John
Things always worked if I use a SerialMesh or a ParallelMesh running on
one processor. The problem was that I had a problem that took 2 hours
running on one processor and 15 minutes running on all 8 cores of my
local machine.
For now, I figured out a work around. When creating the mesh in
parallel I use:
MeshCommunication().broadcast(mesh);
mesh.partitioner() = AutoPtr(new LinearPartitioner);
mesh.allow_renumbering(false);
mesh.prepare_for_use();
Followed by:
vector<Number> u_data;
system.solution->localize_to_one(u_data);
if (libMesh::processor_id() == 0) {
vector<Number> u_permute(u_data.size());
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()] = u_data[node->dof_number(0,u_var,0)];
}
ofstream datfile(outputFilename);
for (uint ii=0; ii<u_permute.size(); ii++) {
datfile << u_permute[ii] << endl;
}
}
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
Libmesh-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users