dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #19658
Re: xy format for solutions.
Sorry,
I was modifying the 0.9.9 stable version.
Hope this is it.
On Thursday 09 September 2010 11:38:11 Garth N. Wells wrote:
> On 09/09/10 11:35, ndlopes@xxxxxxxxx wrote:
> > On Wednesday 08 September 2010 21:14:46 Garth N. Wells wrote:
> >>> When you say "merging the classes" do you mean to keep only the xyz
> >>> format and when the dimension is 1 output the solutions as in the xy
> >>> format?
> >>
> >> Yes. Once class should handle
> >>
> >> x0 x1, . . . xn
> >>
> >> output.
> >>
> >> Garth
> >
> > Done
> > All in XYZFile.cpp...just added a few lines.
>
> We've removed old-style C file syntax from DOLFIN. Could you modify it
> to use C++ file streams.
>
> Garth
>
> > _______________________________________________
> > Mailing list: https://launchpad.net/~dolfin
> > Post to : dolfin@xxxxxxxxxxxxxxxxxxx
> > Unsubscribe : https://launchpad.net/~dolfin
> > More help : https://help.launchpad.net/ListHelp
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dolfin
> Post to : dolfin@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dolfin
> More help : https://help.launchpad.net/ListHelp
--
Nuno David Lopes
e-mail:ndl @ ptmat.fc.ul.pt (FCUL/CMAF)
nlopes @ dec.isel.ipl.pt (ISEL)
ndlopes @ gmail.com
http://ptmat.ptmat.fc.ul.pt/%7Endl/
Thu Sep 9 12:13:16 WEST 2010
# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: ndl@an9-20100909110532-m3i4fqf8n0gv9kad
# target_branch: bzr+ssh://bazaar.launchpad.net/%2Bbranch/dolfin/
# testament_sha1: 633882848afd273b728111ca80179a4b33f07e92
# timestamp: 2010-09-09 12:06:04 +0100
# base_revision_id: johannr@xxxxxxxxx-20100909075345-6y0x7o7jehug6nxa
#
# Begin patch
=== modified file 'dolfin/io/XYZFile.cpp'
--- dolfin/io/XYZFile.cpp 2010-09-03 20:14:27 +0000
+++ dolfin/io/XYZFile.cpp 2010-09-09 11:05:32 +0000
@@ -78,13 +78,27 @@
error("Cannot handle XYZ file for non-scalar functions. ");
std::ostringstream ss;
ss << std::scientific;
- for (VertexIterator vertex(mesh); !vertex.end(); ++vertex)
- {
- ss.str("");
- ss << vertex->x(0) << " " << vertex->x(1) << " " << values[ vertex->index() ];
- ss <<std::endl;
- fp << ss.str( );
- }
+ if (mesh.topology().dim()==1)
+ {
+ for (VertexIterator vertex(mesh); !vertex.end(); ++vertex)
+ {
+ ss.str("");
+ ss<<vertex->x(0)<<" "<< values[ vertex->index()];
+ ss <<std::endl;
+ fp << ss.str( );
+ }
+ }
+ else if (mesh.topology().dim()==2)
+ {
+ for (VertexIterator vertex(mesh); !vertex.end(); ++vertex)
+ {
+ ss.str("");
+ ss << vertex->x(0) << " " << vertex->x(1) << " " << values[ vertex->index() ];
+ ss <<std::endl;
+ fp << ss.str( );
+ }
+ }
+ else error("Unable to write XYZ file, mesh topology dimension is not supported for this format.");
}
//----------------------------------------------------------------------------
void XYZFile::xyz_name_update(int counter)
# Begin bundle
IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWbSeQgAAAgjfgFUQcG///1cl
A3q////6UAQ+5ZnULFda203cEkiTSZkxTaTZTyMlPCANqTepNAaNqA2oMqYmmTRoNCGSZNGgAA0A
ABoEigKepoNFPJggm0QGmgaGg0GmgaHMCYmgwmTJkyMJgmmmRiYAhgEpNJoT0ppp7VPJPU8RqPSA
AAA0ADI4QKMhZn2OotsnNJpFJURRlcQwsdJADC5bMkzW6wkKCEO48JqXaW6zaUJ/DCxv7/Q7pWyO
HPdSUZHgO0u7m1u7N1P9pJfF307bVrSbz+TFUjLVL1shsMuOQ5FPeMaeYpJhBblM1F2OFuU5JzoR
8bmoYkNFQ4+xoSJhjda897pIlHhGM48gZQFxTRmLHKgXDqTEqLNOUUtS6KMGWHPMthEcFrCMszy5
MVdeaEVdQ61PEcq5nQEMHiwqeO3iiVFoUlaEE0DE1JWmm8RK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