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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1387 - (hide annotations)
Fri Jan 11 07:45:26 2008 UTC (11 years, 10 months ago) by trankine
Original Path: temp/finley/src/Mesh_print.c
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 jgs 150
2 ksteube 1312 /* $Id$ */
3 jgs 82
4 ksteube 1312 /*******************************************************
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 jgs 82
16     /**************************************************************/
17    
18 ksteube 1312 /* Finley: prints Mesh */
19 jgs 82
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 jgs 123 dim_t NN,i,j,numDim;
30 jgs 82
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 ksteube 1312 printf("=== %1dD-Nodes:\nnumber of nodes=%d\n", numDim,in->Nodes->numNodes);
40     printf("Id,Tag,globalDegreesOfFreedom,degreesOfFreedom,reducedDegreesOfFeedom,node,reducedNode,Coordinates\n");
41 jgs 82 for (i=0;i<in->Nodes->numNodes;i++) {
42 ksteube 1312 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 jgs 82 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 jgs 123 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 jgs 82 NN=in->Elements->ReferenceElement->Type->numNodes;
59     if (in->Elements->numElements>0) {
60 ksteube 1312 printf("Id,Tag,Owner,Color,Nodes\n");
61 jgs 82 for (i=0;i<in->Elements->numElements;i++) {
62 ksteube 1312 printf("%d,%d,%d,%d,",in->Elements->Id[i],in->Elements->Tag[i],in->Elements->Owner[i], in->Elements->Color[i]);
63 jgs 82 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 jgs 123 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 jgs 82 NN=in->FaceElements->ReferenceElement->Type->numNodes;
76     if (in->FaceElements->numElements>0) {
77 ksteube 1312 printf("Id,Tag,Owner,Color,Nodes\n");
78 jgs 82 for (i=0;i<in->FaceElements->numElements;i++) {
79 ksteube 1312 printf("%d,%d,%d,%d,",in->FaceElements->Id[i],in->FaceElements->Tag[i],in->Elements->Owner[i], in->FaceElements->Color[i]);
80 jgs 82 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 jgs 123 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 jgs 82 NN=in->ContactElements->ReferenceElement->Type->numNodes;
91     if (in->ContactElements->numElements>0) {
92 ksteube 1312 printf("Id,Tag,Owner,Color,Nodes\n");
93 jgs 82 for (i=0;i<in->ContactElements->numElements;i++) {
94 ksteube 1312 printf("%d,%d,%d,%d,",in->ContactElements->Id[i],in->ContactElements->Tag[i],in->Elements->Owner[i], in->ContactElements->Color[i]);
95 jgs 82 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 jgs 123 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 jgs 82 NN=in->Points->ReferenceElement->Type->numNodes;
106     if (in->Points->numElements>0) {
107 ksteube 1312 printf("Id,Tag,Owner,Color,Nodes\n");
108 jgs 82 for (i=0;i<in->Points->numElements;i++) {
109 ksteube 1312 printf("%d,%d,%d,%d,",in->Points->Id[i],in->Points->Tag[i],in->Elements->Owner[i], in->Points->Color[i]);
110 jgs 82 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