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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2748 - (show annotations)
Tue Nov 17 07:32:59 2009 UTC (9 years, 8 months ago) by gross
File MIME type: text/plain
File size: 4884 byte(s)
Macro elements are implemented now. VTK writer for macro elements still needs testing.
1
2 /*******************************************************
3 *
4 * Copyright (c) 2003-2009 by University of Queensland
5 * Earth Systems Science Computational Center (ESSCC)
6 * http://www.uq.edu.au/esscc
7 *
8 * Primary Business: Queensland, Australia
9 * Licensed under the Open Software License version 3.0
10 * http://www.opensource.org/licenses/osl-3.0.php
11 *
12 *******************************************************/
13
14
15 /**************************************************************/
16
17 /* Finley: prints Mesh */
18
19 /**************************************************************/
20
21 #include "Mesh.h"
22
23 /**************************************************************/
24
25 /* prints the mesh to the standarts output: */
26
27 void Finley_Mesh_print(Finley_Mesh *in) {
28 dim_t NN,i,j,numDim,NN2;
29
30 /* write header */
31
32 printf("Mesh name: %s\n",in->Name);
33
34 /* write nodes: */
35
36 if (in->Nodes!=NULL) {
37 numDim=in->Nodes->numDim;
38 printf("=== %1dD-Nodes:\nnumber of nodes=%d\n", numDim,in->Nodes->numNodes);
39 printf("Id,Tag,globalDegreesOfFreedom,degreesOfFreedom,reducedDegreesOfFeedom,node,reducedNode,Coordinates\n");
40 for (i=0;i<in->Nodes->numNodes;i++) {
41 printf("%d,%d,%d,%d,%d,%d,%d ",
42 in->Nodes->Id[i],in->Nodes->Tag[i],in->Nodes->globalDegreesOfFreedom[i],
43 in->Nodes->degreesOfFreedomMapping->target[i],
44 in->Nodes->reducedDegreesOfFreedomMapping->target[i],
45 in->Nodes->nodesMapping->target[i],
46 in->Nodes->reducedNodesMapping->target[i]);
47 for (j=0;j<numDim;j++) printf(" %20.15e",in->Nodes->Coordinates[INDEX2(j,i,numDim)]);
48 printf("\n");
49 }
50 }
51
52 /* write elements: */
53
54 if (in->Elements!=NULL) {
55 printf( "=== %s:\nnumber of elements=%d\ncolor range=[%d,%d]\n",
56 in->Elements->referenceElementSet->referenceElement->Type->Name,in->Elements->numElements,in->Elements->minColor,in->Elements->maxColor);
57 NN=in->Elements->referenceElementSet->referenceElement->Type->numNodes;
58 NN2=in->Elements->numNodes;
59 if (in->Elements->numElements>0) {
60 printf("Id,Tag,Owner,Color,Nodes\n");
61 for (i=0;i<in->Elements->numElements;i++) {
62 printf("%d,%d,%d,%d,",in->Elements->Id[i],in->Elements->Tag[i],in->Elements->Owner[i], in->Elements->Color[i]);
63 for (j=0;j<NN;j++) printf(" %d",in->Nodes->Id[in->Elements->Nodes[INDEX2(j,i,NN2)]]);
64 printf("\n");
65 }
66 }
67 }
68
69 /* write face elements: */
70
71
72 if (in->FaceElements!=NULL) {
73 printf( "=== %s:\nnumber of elements=%d\ncolor range=[%d,%d]\n",
74 in->FaceElements->referenceElementSet->referenceElement->Type->Name,in->FaceElements->numElements,in->FaceElements->minColor,in->FaceElements->maxColor);
75 NN=in->FaceElements->referenceElementSet->referenceElement->Type->numNodes;
76 NN2=in->FaceElements->numNodes;
77 if (in->FaceElements->numElements>0) {
78 printf("Id,Tag,Owner,Color,Nodes\n");
79 for (i=0;i<in->FaceElements->numElements;i++) {
80 printf("%d,%d,%d,%d,",in->FaceElements->Id[i],in->FaceElements->Tag[i],in->Elements->Owner[i], in->FaceElements->Color[i]);
81 for (j=0;j<NN;j++) printf(" %d",in->Nodes->Id[in->FaceElements->Nodes[INDEX2(j,i,NN2)]]);
82 printf("\n");
83 }
84 }
85 }
86
87 /* write Contact elements : */
88 if (in->ContactElements!=NULL) {
89 printf( "=== %s:\nnumber of elements=%d\ncolor range=[%d,%d]\n",
90 in->ContactElements->referenceElementSet->referenceElement->Type->Name,in->ContactElements->numElements,in->ContactElements->minColor,in->ContactElements->maxColor);
91 NN=in->ContactElements->referenceElementSet->referenceElement->Type->numNodes;
92 NN2=in->ContactElements->numNodes;
93 if (in->ContactElements->numElements>0) {
94 printf("Id,Tag,Owner,Color,Nodes\n");
95 for (i=0;i<in->ContactElements->numElements;i++) {
96 printf("%d,%d,%d,%d,",in->ContactElements->Id[i],in->ContactElements->Tag[i],in->Elements->Owner[i], in->ContactElements->Color[i]);
97 for (j=0;j<NN;j++) printf(" %d",in->Nodes->Id[in->ContactElements->Nodes[INDEX2(j,i,NN2)]]);
98 printf("\n");
99 }
100 }
101 }
102
103 /* write points: */
104 if (in->Points!=NULL) {
105 printf( "=== %s:\nnumber of elements=%d\ncolor range=[%d,%d]\n",
106 in->Points->referenceElementSet->referenceElement->Type->Name,in->Points->numElements,in->Points->minColor,in->Points->maxColor);
107 NN=in->Points->referenceElementSet->referenceElement->Type->numNodes;
108 NN2=in->Points->numNodes;
109 if (in->Points->numElements>0) {
110 printf("Id,Tag,Owner,Color,Nodes\n");
111 for (i=0;i<in->Points->numElements;i++) {
112 printf("%d,%d,%d,%d,",in->Points->Id[i],in->Points->Tag[i],in->Elements->Owner[i], in->Points->Color[i]);
113 for (j=0;j<NN;j++) printf(" %d",in->Nodes->Id[in->Points->Nodes[INDEX2(j,i,NN2)]]);
114 printf("\n");
115 }
116 }
117 }
118 }

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26