/[escript]/trunk/finley/src/Mesh_print.cpp
ViewVC logotype

Contents of /trunk/finley/src/Mesh_print.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4492 - (show annotations)
Tue Jul 2 01:44:11 2013 UTC (5 years, 9 months ago) by caltinay
File size: 4308 byte(s)
Finley changes that were held back while in release mode - moved more stuff
into finley namespace.

1
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2013 by 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 since 2012 by School of Earth Sciences
13 *
14 *****************************************************************************/
15
16
17 /************************************************************************************/
18
19 /* Finley: prints Mesh */
20
21 /************************************************************************************/
22
23 #include "Mesh.h"
24
25 /************************************************************************************/
26
27 /* prints the mesh to standard output: */
28
29 void Finley_Mesh_print(Finley_Mesh *in) {
30 dim_t NN,i,j,NN2;
31
32 /* write header */
33
34 printf("Mesh name: %s\n",in->Name);
35
36 /* write nodes: */
37 in->Nodes->print();
38
39 /* write elements: */
40
41 if (in->Elements!=NULL) {
42 printf( "=== %s:\nnumber of elements=%d\ncolor range=[%d,%d]\n",
43 in->Elements->referenceElementSet->referenceElement->Type->Name,in->Elements->numElements,in->Elements->minColor,in->Elements->maxColor);
44 NN=in->Elements->referenceElementSet->referenceElement->Type->numNodes;
45 NN2=in->Elements->numNodes;
46 if (in->Elements->numElements>0) {
47 printf("Id,Tag,Owner,Color,Nodes\n");
48 for (i=0;i<in->Elements->numElements;i++) {
49 printf("%d,%d,%d,%d,",in->Elements->Id[i],in->Elements->Tag[i],in->Elements->Owner[i], in->Elements->Color[i]);
50 for (j=0;j<NN;j++) printf(" %d",in->Nodes->Id[in->Elements->Nodes[INDEX2(j,i,NN2)]]);
51 printf("\n");
52 }
53 }
54 }
55
56 /* write face elements: */
57
58
59 if (in->FaceElements!=NULL) {
60 printf( "=== %s:\nnumber of elements=%d\ncolor range=[%d,%d]\n",
61 in->FaceElements->referenceElementSet->referenceElement->Type->Name,in->FaceElements->numElements,in->FaceElements->minColor,in->FaceElements->maxColor);
62 NN=in->FaceElements->referenceElementSet->referenceElement->Type->numNodes;
63 NN2=in->FaceElements->numNodes;
64 if (in->FaceElements->numElements>0) {
65 printf("Id,Tag,Owner,Color,Nodes\n");
66 for (i=0;i<in->FaceElements->numElements;i++) {
67 printf("%d,%d,%d,%d,",in->FaceElements->Id[i],in->FaceElements->Tag[i],in->Elements->Owner[i], in->FaceElements->Color[i]);
68 for (j=0;j<NN;j++) printf(" %d",in->Nodes->Id[in->FaceElements->Nodes[INDEX2(j,i,NN2)]]);
69 printf("\n");
70 }
71 }
72 }
73
74 /* write Contact elements : */
75 if (in->ContactElements!=NULL) {
76 printf( "=== %s:\nnumber of elements=%d\ncolor range=[%d,%d]\n",
77 in->ContactElements->referenceElementSet->referenceElement->Type->Name,in->ContactElements->numElements,in->ContactElements->minColor,in->ContactElements->maxColor);
78 NN=in->ContactElements->referenceElementSet->referenceElement->Type->numNodes;
79 NN2=in->ContactElements->numNodes;
80 if (in->ContactElements->numElements>0) {
81 printf("Id,Tag,Owner,Color,Nodes\n");
82 for (i=0;i<in->ContactElements->numElements;i++) {
83 printf("%d,%d,%d,%d,",in->ContactElements->Id[i],in->ContactElements->Tag[i],in->Elements->Owner[i], in->ContactElements->Color[i]);
84 for (j=0;j<NN;j++) printf(" %d",in->Nodes->Id[in->ContactElements->Nodes[INDEX2(j,i,NN2)]]);
85 printf("\n");
86 }
87 }
88 }
89
90 /* write points: */
91 if (in->Points!=NULL) {
92 printf( "=== %s:\nnumber of elements=%d\ncolor range=[%d,%d]\n",
93 in->Points->referenceElementSet->referenceElement->Type->Name,in->Points->numElements,in->Points->minColor,in->Points->maxColor);
94 NN=in->Points->referenceElementSet->referenceElement->Type->numNodes;
95 NN2=in->Points->numNodes;
96 if (in->Points->numElements>0) {
97 printf("Id,Tag,Owner,Color,Nodes\n");
98 for (i=0;i<in->Points->numElements;i++) {
99 printf("%d,%d,%d,%d,",in->Points->Id[i],in->Points->Tag[i],in->Elements->Owner[i], in->Points->Color[i]);
100 for (j=0;j<NN;j++) printf(" %d",in->Nodes->Id[in->Points->Nodes[INDEX2(j,i,NN2)]]);
101 printf("\n");
102 }
103 }
104 }
105 }

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision
svn:mergeinfo /branches/lapack2681/finley/src/Mesh_print.cpp:2682-2741 /branches/pasowrap/finley/src/Mesh_print.cpp:3661-3674 /branches/py3_attempt2/finley/src/Mesh_print.cpp:3871-3891 /branches/restext/finley/src/Mesh_print.cpp:2610-2624 /branches/ripleygmg_from_3668/finley/src/Mesh_print.cpp:3669-3791 /branches/stage3.0/finley/src/Mesh_print.cpp:2569-2590 /branches/symbolic_from_3470/finley/src/Mesh_print.cpp:3471-3974 /release/3.0/finley/src/Mesh_print.cpp:2591-2601 /trunk/finley/src/Mesh_print.cpp:4257-4344

  ViewVC Help
Powered by ViewVC 1.1.26