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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1387 - (show annotations)
Fri Jan 11 07:45:26 2008 UTC (11 years, 8 months ago) by trankine
File MIME type: text/plain
File size: 4618 byte(s)
Restore the trunk that existed before the windows changes were committed to the (now moved to branches) old trunk.
1
2 /* $Id$ */
3
4 /*******************************************************
5 *
6 * Copyright 2003-2007 by ACceSS MNRF
7 * Copyright 2007 by University of Queensland
8 *
9 * http://esscc.uq.edu.au
10 * Primary Business: Queensland, Australia
11 * Licensed under the Open Software License version 3.0
12 * http://www.opensource.org/licenses/osl-3.0.php
13 *
14 *******************************************************/
15
16 /**************************************************************/
17
18 /* Finley: prints Mesh */
19
20 /**************************************************************/
21
22 #include "Mesh.h"
23
24 /**************************************************************/
25
26 /* prints the mesh to the standarts output: */
27
28 void Finley_Mesh_print(Finley_Mesh *in) {
29 dim_t NN,i,j,numDim;
30
31 /* write header */
32
33 printf("Mesh name: %s\n",in->Name);
34
35 /* write nodes: */
36
37 if (in->Nodes!=NULL) {
38 numDim=in->Nodes->numDim;
39 printf("=== %1dD-Nodes:\nnumber of nodes=%d\n", numDim,in->Nodes->numNodes);
40 printf("Id,Tag,globalDegreesOfFreedom,degreesOfFreedom,reducedDegreesOfFeedom,node,reducedNode,Coordinates\n");
41 for (i=0;i<in->Nodes->numNodes;i++) {
42 printf("%d,%d,%d,%d,%d,%d,%d ",
43 in->Nodes->Id[i],in->Nodes->Tag[i],in->Nodes->globalDegreesOfFreedom[i],
44 in->Nodes->degreesOfFreedomMapping->target[i],
45 in->Nodes->reducedDegreesOfFreedomMapping->target[i],
46 in->Nodes->nodesMapping->target[i],
47 in->Nodes->reducedNodesMapping->target[i]);
48 for (j=0;j<numDim;j++) printf(" %20.15e",in->Nodes->Coordinates[INDEX2(j,i,numDim)]);
49 printf("\n");
50 }
51 }
52
53 /* write elements: */
54
55 if (in->Elements!=NULL) {
56 printf( "=== %s:\nnumber of elements=%d\ncolor range=[%d,%d]\n",
57 in->Elements->ReferenceElement->Type->Name,in->Elements->numElements,in->Elements->minColor,in->Elements->maxColor);
58 NN=in->Elements->ReferenceElement->Type->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,NN)]]);
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->ReferenceElement->Type->Name,in->FaceElements->numElements,in->FaceElements->minColor,in->FaceElements->maxColor);
75 NN=in->FaceElements->ReferenceElement->Type->numNodes;
76 if (in->FaceElements->numElements>0) {
77 printf("Id,Tag,Owner,Color,Nodes\n");
78 for (i=0;i<in->FaceElements->numElements;i++) {
79 printf("%d,%d,%d,%d,",in->FaceElements->Id[i],in->FaceElements->Tag[i],in->Elements->Owner[i], in->FaceElements->Color[i]);
80 for (j=0;j<NN;j++) printf(" %d",in->Nodes->Id[in->FaceElements->Nodes[INDEX2(j,i,NN)]]);
81 printf("\n");
82 }
83 }
84 }
85
86 /* write Contact elements : */
87 if (in->ContactElements!=NULL) {
88 printf( "=== %s:\nnumber of elements=%d\ncolor range=[%d,%d]\n",
89 in->ContactElements->ReferenceElement->Type->Name,in->ContactElements->numElements,in->ContactElements->minColor,in->ContactElements->maxColor);
90 NN=in->ContactElements->ReferenceElement->Type->numNodes;
91 if (in->ContactElements->numElements>0) {
92 printf("Id,Tag,Owner,Color,Nodes\n");
93 for (i=0;i<in->ContactElements->numElements;i++) {
94 printf("%d,%d,%d,%d,",in->ContactElements->Id[i],in->ContactElements->Tag[i],in->Elements->Owner[i], in->ContactElements->Color[i]);
95 for (j=0;j<NN;j++) printf(" %d",in->Nodes->Id[in->ContactElements->Nodes[INDEX2(j,i,NN)]]);
96 printf("\n");
97 }
98 }
99 }
100
101 /* write points: */
102 if (in->Points!=NULL) {
103 printf( "=== %s:\nnumber of elements=%d\ncolor range=[%d,%d]\n",
104 in->Points->ReferenceElement->Type->Name,in->Points->numElements,in->Points->minColor,in->Points->maxColor);
105 NN=in->Points->ReferenceElement->Type->numNodes;
106 if (in->Points->numElements>0) {
107 printf("Id,Tag,Owner,Color,Nodes\n");
108 for (i=0;i<in->Points->numElements;i++) {
109 printf("%d,%d,%d,%d,",in->Points->Id[i],in->Points->Tag[i],in->Elements->Owner[i], in->Points->Color[i]);
110 for (j=0;j<NN;j++) printf(" %d",in->Nodes->Id[in->Points->Nodes[INDEX2(j,i,NN)]]);
111 printf("\n");
112 }
113 }
114 }
115 }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26