From 77465a0c873b2721608c2831fadff87bbe6f448b Mon Sep 17 00:00:00 2001 From: Oliver Sander <sander@igpm.rwth-aachen.de> Date: Fri, 10 Jun 2011 14:18:43 +0000 Subject: [PATCH] write output frame field into AmiraMesh files [[Imported from SVN: r7413]] --- cosserat-continuum.cc | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/cosserat-continuum.cc b/cosserat-continuum.cc index 1ac1a30a..de7a786d 100644 --- a/cosserat-continuum.cc +++ b/cosserat-continuum.cc @@ -181,7 +181,7 @@ int main (int argc, char *argv[]) try // //////////////////////////////////////////////////////////// // Create an assembler for the Harmonic Energy Functional // //////////////////////////////////////////////////////////// -#if 0 + HarmonicEnergyLocalStiffness<GridType::LeafGridView,TargetSpace> harmonicEnergyLocalStiffness; GeodesicFEAssembler<GridType::LeafGridView,TargetSpace> assembler(grid.leafView(), @@ -217,7 +217,6 @@ int main (int argc, char *argv[]) try solver.solve(); x = solver.getSol(); -#endif // ////////////////////////////// // Output result @@ -229,11 +228,26 @@ int main (int argc, char *argv[]) try DeformedGridType deformedGrid(grid, deformationFunction); + LeafAmiraMeshWriter<DeformedGridType>::writeSurfaceGrid(deformedGrid.leafView(), "cosseratGrid"); - LeafAmiraMeshWriter<DeformedGridType> amiramesh; - amiramesh.writeSurfaceGrid(deformedGrid.leafView(), "cosseratGrid"); -/* amiramesh.addGrid(deformedGrid.leafView()); - amiramesh.write("cosseratGrid", 1);*/ + // Make three vector fields containing the directors + // I don't think there is a simpler way to get the data into vanilla Amira + + for (int i=0; i<3; i++) { + + std::vector<FieldVector<double,3> > director(x.size()); + for (size_t j=0; j<x.size(); j++) + director[j] = x[j].q.director(i); + + LeafAmiraMeshWriter<DeformedGridType> amiramesh; + amiramesh.addVertexData(director, deformedGrid.leafView()); + + std::stringstream iAsAscii; + iAsAscii << i; + amiramesh.write("cosseratOrientation"+iAsAscii.str(), true); + + } + // ////////////////////////////// } catch (Exception e) { -- GitLab