/[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 6009 - (show annotations)
Wed Mar 2 04:13:26 2016 UTC (3 years, 1 month ago) by caltinay
File size: 4330 byte(s)
Much needed sync with trunk...

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 to the standard output: */
22 void Dudley_Mesh_print(Dudley_Mesh* in)
23 {
24 dim_t NN, i, j, numDim, NN2;
25
26 /* write header */
27
28 printf("Mesh name: %s\n", in->Name);
29
30 /* write nodes: */
31 if (in->Nodes != NULL)
32 {
33 numDim = in->Nodes->numDim;
34 printf("=== %1dD-Nodes:\nnumber of nodes=%d\n", numDim, in->Nodes->numNodes);
35 printf("Id,Tag,globalDegreesOfFreedom,degreesOfFreedom,reducedDegreesOfFeedom,node,reducedNode,Coordinates\n");
36 for (i = 0; i < in->Nodes->numNodes; i++)
37 {
38 printf("%d,%d,%d,%d,%d,%d,%d ",
39 in->Nodes->Id[i], in->Nodes->Tag[i], in->Nodes->globalDegreesOfFreedom[i],
40 in->Nodes->degreesOfFreedomMapping->target[i],
41 in->Nodes->reducedDegreesOfFreedomMapping->target[i],
42 in->Nodes->nodesMapping->target[i], in->Nodes->reducedNodesMapping->target[i]);
43 for (j = 0; j < numDim; j++)
44 printf(" %20.15e", in->Nodes->Coordinates[INDEX2(j, i, numDim)]);
45 printf("\n");
46 }
47 }
48
49 /* write elements: */
50
51 if (in->Elements != NULL)
52 {
53 printf("=== %s:\nnumber of elements=%d\ncolor range=[%d,%d]\n",
54 in->Elements->ename, in->Elements->numElements, in->Elements->minColor, in->Elements->maxColor);
55 NN = in->Elements->numNodes;
56 NN2 = in->Elements->numNodes;
57 if (in->Elements->numElements > 0)
58 {
59 printf("Id,Tag,Owner,Color,Nodes\n");
60 for (i = 0; i < in->Elements->numElements; i++)
61 {
62 printf("%d,%d,%d,%d,", in->Elements->Id[i], in->Elements->Tag[i], in->Elements->Owner[i],
63 in->Elements->Color[i]);
64 for (j = 0; j < NN; j++)
65 printf(" %d", in->Nodes->Id[in->Elements->Nodes[INDEX2(j, i, NN2)]]);
66 printf("\n");
67 }
68 }
69 }
70
71 /* write face elements: */
72
73 if (in->FaceElements != NULL)
74 {
75 printf("=== %s:\nnumber of elements=%d\ncolor range=[%d,%d]\n",
76 in->FaceElements->ename, in->FaceElements->numElements, in->FaceElements->minColor,
77 in->FaceElements->maxColor);
78 NN = in->FaceElements->numNodes;
79 NN2 = in->FaceElements->numNodes;
80 if (in->FaceElements->numElements > 0)
81 {
82 printf("Id,Tag,Owner,Color,Nodes\n");
83 for (i = 0; i < in->FaceElements->numElements; i++)
84 {
85 printf("%d,%d,%d,%d,", in->FaceElements->Id[i], in->FaceElements->Tag[i], in->Elements->Owner[i],
86 in->FaceElements->Color[i]);
87 for (j = 0; j < NN; j++)
88 printf(" %d", in->Nodes->Id[in->FaceElements->Nodes[INDEX2(j, i, NN2)]]);
89 printf("\n");
90 }
91 }
92 }
93
94 /* write points: */
95 if (in->Points != NULL)
96 {
97 printf("=== %s:\nnumber of elements=%d\ncolor range=[%d,%d]\n",
98 in->Points->ename, in->Points->numElements, in->Points->minColor, in->Points->maxColor);
99 NN = in->Points->numNodes;
100 NN2 = in->Points->numNodes;
101 if (in->Points->numElements > 0)
102 {
103 printf("Id,Tag,Owner,Color,Nodes\n");
104 for (i = 0; i < in->Points->numElements; i++)
105 {
106 printf("%d,%d,%d,%d,", in->Points->Id[i], in->Points->Tag[i], in->Elements->Owner[i],
107 in->Points->Color[i]);
108 for (j = 0; j < NN; j++)
109 printf(" %d", in->Nodes->Id[in->Points->Nodes[INDEX2(j, i, NN2)]]);
110 printf("\n");
111 }
112 }
113 }
114 }
115
116 } // namespace dudley
117

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