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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 82 - (hide annotations)
Tue Oct 26 06:53:54 2004 UTC (15 years, 5 months ago) by jgs
File MIME type: text/plain
File size: 4279 byte(s)
Initial revision

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     int NN,i,j,numDim;
21    
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     printf( "=== %s:\nnumber of elements=%d\nnumber of colors=%d\n",
45     in->Elements->ReferenceElement->Type->Name,in->Elements->numElements,in->Elements->numColors);
46     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     printf( "=== %s:\nnumber of elements=%d\nnumber of colors=%d\n",
62     in->FaceElements->ReferenceElement->Type->Name,in->FaceElements->numElements,in->FaceElements->numColors);
63     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     printf( "=== %s:\nnumber of elements=%d\nnumber of colors=%d\n",
77     in->ContactElements->ReferenceElement->Type->Name,in->ContactElements->numElements,in->ContactElements->numColors);
78     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     printf( "=== %s:\nnumber of elements=%d\nnumber of colors=%d\n",
92     in->Points->ReferenceElement->Type->Name,in->Points->numElements,in->Points->numColors);
93     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     * Revision 1.1 2004/10/26 06:53:57 jgs
108     * Initial revision
109     *
110     * Revision 1.1.1.1 2004/06/24 04:00:40 johng
111     * Initial version of eys using boost-python.
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