/[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 123 - (hide annotations)
Fri Jul 8 04:08:13 2005 UTC (14 years, 3 months ago) by jgs
Original Path: trunk/esys2/finley/src/finleyC/Mesh_print.c
File MIME type: text/plain
File size: 4593 byte(s)
Merge of development branch back to main trunk on 2005-07-08

1 jgs 82 /**************************************************************/
2    
3     /* Finley: prints Mesh */
4    
5     /**************************************************************/
6    
7     /* Copyrights by ACcESS Australia 2003 */
8     /* Author: gross@access.edu.au */
9     /* Version: $Id$ */
10    
11     /**************************************************************/
12    
13     #include "Mesh.h"
14    
15     /**************************************************************/
16    
17     /* prints the mesh to the standarts output: */
18    
19     void Finley_Mesh_print(Finley_Mesh *in) {
20 jgs 123 dim_t NN,i,j,numDim;
21 jgs 82
22     /* write header */
23    
24     printf("Mesh name: %s\n",in->Name);
25    
26     /* write nodes: */
27    
28     if (in->Nodes!=NULL) {
29     numDim=in->Nodes->numDim;
30     printf("=== %1dD-Nodes:\nnumber of nodes=%d\ndegrees of freedom=%d\nreduced degrees of freedom=%d\nreduced number of nodes=%d\n",
31     numDim,in->Nodes->numNodes,in->Nodes->numDegreesOfFreedom,in->Nodes->reducedNumDegreesOfFreedom,in->Nodes->reducedNumNodes);
32     printf("Id,Tag,degreeOfFreedom,reducedDegreeOfFreedom,reducedNumNodes,Coordinates\n");
33     for (i=0;i<in->Nodes->numNodes;i++) {
34     printf("%d,%d,%d,%d,%d,",
35     in->Nodes->Id[i],in->Nodes->Tag[i],in->Nodes->degreeOfFreedom[i],in->Nodes->reducedDegreeOfFreedom[i],in->Nodes->toReduced[i]);
36     for (j=0;j<numDim;j++) printf(" %20.15e",in->Nodes->Coordinates[INDEX2(j,i,numDim)]);
37     printf("\n");
38     }
39     }
40    
41     /* write elements: */
42    
43     if (in->Elements!=NULL) {
44 jgs 123 printf( "=== %s:\nnumber of elements=%d\ncolor range=[%d,%d]\n",
45     in->Elements->ReferenceElement->Type->Name,in->Elements->numElements,in->Elements->minColor,in->Elements->maxColor);
46 jgs 82 NN=in->Elements->ReferenceElement->Type->numNodes;
47     if (in->Elements->numElements>0) {
48     printf("Id,Tag,Color,Nodes\n");
49     for (i=0;i<in->Elements->numElements;i++) {
50     printf("%d,%d,%d,",in->Elements->Id[i],in->Elements->Tag[i],in->Elements->Color[i]);
51     for (j=0;j<NN;j++) printf(" %d",in->Nodes->Id[in->Elements->Nodes[INDEX2(j,i,NN)]]);
52     printf("\n");
53     }
54     }
55     }
56    
57     /* write face elements: */
58    
59    
60     if (in->FaceElements!=NULL) {
61 jgs 123 printf( "=== %s:\nnumber of elements=%d\ncolor range=[%d,%d]\n",
62     in->FaceElements->ReferenceElement->Type->Name,in->FaceElements->numElements,in->FaceElements->minColor,in->FaceElements->maxColor);
63 jgs 82 NN=in->FaceElements->ReferenceElement->Type->numNodes;
64     if (in->FaceElements->numElements>0) {
65     printf("Id,Tag,Color,Nodes\n");
66     for (i=0;i<in->FaceElements->numElements;i++) {
67     printf("%d,%d,%d,",in->FaceElements->Id[i],in->FaceElements->Tag[i],in->FaceElements->Color[i]);
68     for (j=0;j<NN;j++) printf(" %d",in->Nodes->Id[in->FaceElements->Nodes[INDEX2(j,i,NN)]]);
69     printf("\n");
70     }
71     }
72     }
73    
74     /* write Contact elements : */
75     if (in->ContactElements!=NULL) {
76 jgs 123 printf( "=== %s:\nnumber of elements=%d\ncolor range=[%d,%d]\n",
77     in->ContactElements->ReferenceElement->Type->Name,in->ContactElements->numElements,in->ContactElements->minColor,in->ContactElements->maxColor);
78 jgs 82 NN=in->ContactElements->ReferenceElement->Type->numNodes;
79     if (in->ContactElements->numElements>0) {
80     printf("Id,Tag,Color,Nodes\n");
81     for (i=0;i<in->ContactElements->numElements;i++) {
82     printf("%d,%d,%d,",in->ContactElements->Id[i],in->ContactElements->Tag[i],in->ContactElements->Color[i]);
83     for (j=0;j<NN;j++) printf(" %d",in->Nodes->Id[in->ContactElements->Nodes[INDEX2(j,i,NN)]]);
84     printf("\n");
85     }
86     }
87     }
88    
89     /* write points: */
90     if (in->Points!=NULL) {
91 jgs 123 printf( "=== %s:\nnumber of elements=%d\ncolor range=[%d,%d]\n",
92     in->Points->ReferenceElement->Type->Name,in->Points->numElements,in->Points->minColor,in->Points->maxColor);
93 jgs 82 NN=in->Points->ReferenceElement->Type->numNodes;
94     if (in->Points->numElements>0) {
95     printf("Id,Tag,Color,Nodes\n");
96     for (i=0;i<in->Points->numElements;i++) {
97     printf("%d,%d,%d,",in->Points->Id[i],in->Points->Tag[i],in->Points->Color[i]);
98     for (j=0;j<NN;j++) printf(" %d",in->Nodes->Id[in->Points->Nodes[INDEX2(j,i,NN)]]);
99     printf("\n");
100     }
101     }
102     }
103     }
104    
105     /*
106     * $Log$
107 jgs 123 * Revision 1.2 2005/07/08 04:07:54 jgs
108     * Merge of development branch back to main trunk on 2005-07-08
109 jgs 82 *
110 jgs 123 * Revision 1.1.1.1.2.1 2005/06/29 02:34:53 gross
111     * some changes towards 64 integers in finley
112     *
113     * Revision 1.1.1.1 2004/10/26 06:53:57 jgs
114     * initial import of project esys2
115     *
116 jgs 82 * Revision 1.1.1.1 2004/06/24 04:00:40 johng
117     * Initial version of eys using boost-python.
118     *
119     *
120     */
121    

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26