/[escript]/branches/trilinos_from_5897/dudley/src/Mesh_print.cpp
ViewVC logotype

Contents of /branches/trilinos_from_5897/dudley/src/Mesh_print.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6079 - (show annotations)
Mon Mar 21 12:22:38 2016 UTC (2 years, 10 months ago) by caltinay
File size: 4260 byte(s)
Big commit - making dudley much more like finley to make it more
managable. Fixed quite a few issues that had been fixed in finley.
Disposed of all ReducedNode/ReducedDOF entities that dudley never supported.
Compiles and passes tests.

1
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2016 by The University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Open Software License version 3.0
9 * http://www.opensource.org/licenses/osl-3.0.php
10 *
11 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 * Development 2012-2013 by School of Earth Sciences
13 * Development from 2014 by Centre for Geoscience Computing (GeoComp)
14 *
15 *****************************************************************************/
16
17 #include "Mesh.h"
18
19 namespace dudley {
20
21 /// prints the mesh details to standard output
22 void Mesh::print()
23 {
24 // write header
25 std::cout << "Mesh name: " << m_name << std::endl;
26
27 // write nodes
28 if (Nodes) {
29 const index_t* dofs = Nodes->borrowTargetDegreesOfFreedom();
30 const index_t* nodes = Nodes->borrowTargetNodes();
31 const int numDim = Nodes->numDim;
32 printf("=== %1dD-Nodes:\nnumber of nodes=%d\n", numDim, Nodes->getNumNodes());
33 std::cout << "Id,Tag,globalDegreesOfFreedom,degreesOfFreedom,reducedDegreesOfFeedom,node,reducedNode,Coordinates\n";
34 for (index_t i = 0; i < Nodes->getNumNodes(); i++) {
35 printf("%d,%d,%d,%d,%d,%d,%d ",
36 Nodes->Id[i], Nodes->Tag[i], Nodes->globalDegreesOfFreedom[i],
37 dofs[i], dofs[i], nodes[i], nodes[i]);
38 for (int j = 0; j < numDim; j++)
39 printf(" %20.15e", Nodes->Coordinates[INDEX2(j, i, numDim)]);
40 std::cout << std::endl;
41 }
42 }
43
44 // write elements
45 if (Elements) {
46 std::cout << "=== "
47 << Elements->ename << ":\nnumber of elements="
48 << Elements->numElements << "\ncolor range=["
49 << Elements->minColor << "," << Elements->maxColor << "]\n";
50
51 if (Elements->numElements > 0) {
52 const int NN = Elements->numNodes;
53 std::cout << "Id,Tag,Owner,Color,Nodes" << std::endl;
54 for (index_t i = 0; i < Elements->numElements; i++) {
55 std::cout << Elements->Id[i] << "," << Elements->Tag[i] << ","
56 << Elements->Owner[i] << "," << Elements->Color[i] << ",";
57 for (int j = 0; j < NN; j++)
58 std::cout << " " << Nodes->Id[Elements->Nodes[INDEX2(j, i, NN)]];
59 std::cout << std::endl;
60 }
61 }
62 }
63
64 // write face elements
65 if (FaceElements) {
66 std::cout << "=== "
67 << FaceElements->ename << ":\nnumber of elements="
68 << FaceElements->numElements << "\ncolor range=["
69 << FaceElements->minColor << "," << FaceElements->maxColor
70 << "]\n";
71
72 if (FaceElements->numElements > 0) {
73 const int NN = FaceElements->numNodes;
74 std::cout << "Id,Tag,Owner,Color,Nodes" << std::endl;
75 for (index_t i = 0; i < FaceElements->numElements; i++) {
76 std::cout << FaceElements->Id[i] << "," << FaceElements->Tag[i]
77 << "," << FaceElements->Owner[i] << ","
78 << FaceElements->Color[i] << ",";
79 for (int j=0; j<NN; j++)
80 std::cout << " " << Nodes->Id[FaceElements->Nodes[INDEX2(j,i,NN)]];
81 std::cout << std::endl;
82 }
83 }
84 }
85
86 // write points
87 if (Points) {
88 std::cout << "=== "
89 << Points->ename << ":\nnumber of elements="
90 << Points->numElements << "\ncolor range=["
91 << Points->minColor << "," << Points->maxColor << "]\n";
92
93 if (Points->numElements > 0) {
94 const int NN = Points->numNodes;
95 std::cout << "Id,Tag,Owner,Color,Nodes" << std::endl;
96 for (index_t i=0; i<Points->numElements; i++) {
97 std::cout << Points->Id[i] << "," << Points->Tag[i] << ","
98 << Points->Owner[i] << "," << Points->Color[i] << ",";
99 for (int j=0; j<NN; j++)
100 std::cout << " " << Nodes->Id[Points->Nodes[INDEX2(j,i,NN)]];
101 std::cout << std::endl;
102 }
103 }
104 }
105 }
106
107 } // namespace dudley
108

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision
svn:mergeinfo /branches/4.0fordebian/dudley/src/Mesh_print.cpp:5567-5588 /branches/lapack2681/finley/src/Mesh_print.cpp:2682-2741 /branches/pasowrap/dudley/src/Mesh_print.cpp:3661-3674 /branches/py3_attempt2/dudley/src/Mesh_print.cpp:3871-3891 /branches/restext/finley/src/Mesh_print.cpp:2610-2624 /branches/ripleygmg_from_3668/dudley/src/Mesh_print.cpp:3669-3791 /branches/stage3.0/finley/src/Mesh_print.cpp:2569-2590 /branches/symbolic_from_3470/dudley/src/Mesh_print.cpp:3471-3974 /branches/symbolic_from_3470/ripley/test/python/dudley/src/Mesh_print.cpp:3517-3974 /release/3.0/finley/src/Mesh_print.cpp:2591-2601 /release/4.0/dudley/src/Mesh_print.cpp:5380-5406 /trunk/dudley/src/Mesh_print.cpp:4257-4344,5898-6007 /trunk/ripley/test/python/dudley/src/Mesh_print.cpp:3480-3515

  ViewVC Help
Powered by ViewVC 1.1.26