/[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 155 - (hide annotations)
Wed Nov 9 02:02:19 2005 UTC (13 years, 11 months ago) by jgs
Original Path: trunk/finley/src/finleyC/Mesh_print.c
File MIME type: text/plain
File size: 5668 byte(s)
move all directories from trunk/esys2 into trunk and remove esys2

1 jgs 150 /*
2     ******************************************************************************
3     * *
4     * COPYRIGHT ACcESS 2003,2004,2005 - All Rights Reserved *
5     * *
6     * This software is the property of ACcESS. No part of this code *
7     * may be copied in any form or by any means without the expressed written *
8     * consent of ACcESS. Copying, use or modification of this software *
9     * by any unauthorised person is illegal unless that person has a software *
10     * license agreement with ACcESS. *
11     * *
12     ******************************************************************************
13     */
14    
15 jgs 82 /**************************************************************/
16    
17     /* Finley: prints Mesh */
18    
19     /**************************************************************/
20    
21     /* Author: gross@access.edu.au */
22     /* Version: $Id$ */
23    
24     /**************************************************************/
25    
26     #include "Mesh.h"
27    
28     /**************************************************************/
29    
30     /* prints the mesh to the standarts output: */
31    
32     void Finley_Mesh_print(Finley_Mesh *in) {
33 jgs 123 dim_t NN,i,j,numDim;
34 jgs 82
35     /* write header */
36    
37     printf("Mesh name: %s\n",in->Name);
38    
39     /* write nodes: */
40    
41     if (in->Nodes!=NULL) {
42     numDim=in->Nodes->numDim;
43     printf("=== %1dD-Nodes:\nnumber of nodes=%d\ndegrees of freedom=%d\nreduced degrees of freedom=%d\nreduced number of nodes=%d\n",
44     numDim,in->Nodes->numNodes,in->Nodes->numDegreesOfFreedom,in->Nodes->reducedNumDegreesOfFreedom,in->Nodes->reducedNumNodes);
45     printf("Id,Tag,degreeOfFreedom,reducedDegreeOfFreedom,reducedNumNodes,Coordinates\n");
46     for (i=0;i<in->Nodes->numNodes;i++) {
47     printf("%d,%d,%d,%d,%d,",
48     in->Nodes->Id[i],in->Nodes->Tag[i],in->Nodes->degreeOfFreedom[i],in->Nodes->reducedDegreeOfFreedom[i],in->Nodes->toReduced[i]);
49     for (j=0;j<numDim;j++) printf(" %20.15e",in->Nodes->Coordinates[INDEX2(j,i,numDim)]);
50     printf("\n");
51     }
52     }
53    
54     /* write elements: */
55    
56     if (in->Elements!=NULL) {
57 jgs 123 printf( "=== %s:\nnumber of elements=%d\ncolor range=[%d,%d]\n",
58     in->Elements->ReferenceElement->Type->Name,in->Elements->numElements,in->Elements->minColor,in->Elements->maxColor);
59 jgs 82 NN=in->Elements->ReferenceElement->Type->numNodes;
60     if (in->Elements->numElements>0) {
61     printf("Id,Tag,Color,Nodes\n");
62     for (i=0;i<in->Elements->numElements;i++) {
63     printf("%d,%d,%d,",in->Elements->Id[i],in->Elements->Tag[i],in->Elements->Color[i]);
64     for (j=0;j<NN;j++) printf(" %d",in->Nodes->Id[in->Elements->Nodes[INDEX2(j,i,NN)]]);
65     printf("\n");
66     }
67     }
68     }
69    
70     /* write face elements: */
71    
72    
73     if (in->FaceElements!=NULL) {
74 jgs 123 printf( "=== %s:\nnumber of elements=%d\ncolor range=[%d,%d]\n",
75     in->FaceElements->ReferenceElement->Type->Name,in->FaceElements->numElements,in->FaceElements->minColor,in->FaceElements->maxColor);
76 jgs 82 NN=in->FaceElements->ReferenceElement->Type->numNodes;
77     if (in->FaceElements->numElements>0) {
78     printf("Id,Tag,Color,Nodes\n");
79     for (i=0;i<in->FaceElements->numElements;i++) {
80     printf("%d,%d,%d,",in->FaceElements->Id[i],in->FaceElements->Tag[i],in->FaceElements->Color[i]);
81     for (j=0;j<NN;j++) printf(" %d",in->Nodes->Id[in->FaceElements->Nodes[INDEX2(j,i,NN)]]);
82     printf("\n");
83     }
84     }
85     }
86    
87     /* write Contact elements : */
88     if (in->ContactElements!=NULL) {
89 jgs 123 printf( "=== %s:\nnumber of elements=%d\ncolor range=[%d,%d]\n",
90     in->ContactElements->ReferenceElement->Type->Name,in->ContactElements->numElements,in->ContactElements->minColor,in->ContactElements->maxColor);
91 jgs 82 NN=in->ContactElements->ReferenceElement->Type->numNodes;
92     if (in->ContactElements->numElements>0) {
93     printf("Id,Tag,Color,Nodes\n");
94     for (i=0;i<in->ContactElements->numElements;i++) {
95     printf("%d,%d,%d,",in->ContactElements->Id[i],in->ContactElements->Tag[i],in->ContactElements->Color[i]);
96     for (j=0;j<NN;j++) printf(" %d",in->Nodes->Id[in->ContactElements->Nodes[INDEX2(j,i,NN)]]);
97     printf("\n");
98     }
99     }
100     }
101    
102     /* write points: */
103     if (in->Points!=NULL) {
104 jgs 123 printf( "=== %s:\nnumber of elements=%d\ncolor range=[%d,%d]\n",
105     in->Points->ReferenceElement->Type->Name,in->Points->numElements,in->Points->minColor,in->Points->maxColor);
106 jgs 82 NN=in->Points->ReferenceElement->Type->numNodes;
107     if (in->Points->numElements>0) {
108     printf("Id,Tag,Color,Nodes\n");
109     for (i=0;i<in->Points->numElements;i++) {
110     printf("%d,%d,%d,",in->Points->Id[i],in->Points->Tag[i],in->Points->Color[i]);
111     for (j=0;j<NN;j++) printf(" %d",in->Nodes->Id[in->Points->Nodes[INDEX2(j,i,NN)]]);
112     printf("\n");
113     }
114     }
115     }
116     }
117    
118     /*
119     * $Log$
120 jgs 150 * Revision 1.3 2005/09/15 03:44:22 jgs
121     * Merge of development branch dev-02 back to main trunk on 2005-09-15
122     *
123     * Revision 1.2.2.1 2005/09/07 06:26:19 gross
124     * the solver from finley are put into the standalone package paso now
125     *
126 jgs 123 * Revision 1.2 2005/07/08 04:07:54 jgs
127     * Merge of development branch back to main trunk on 2005-07-08
128 jgs 82 *
129 jgs 123 * Revision 1.1.1.1.2.1 2005/06/29 02:34:53 gross
130     * some changes towards 64 integers in finley
131     *
132     * Revision 1.1.1.1 2004/10/26 06:53:57 jgs
133     * initial import of project esys2
134     *
135 jgs 82 * Revision 1.1.1.1 2004/06/24 04:00:40 johng
136     * Initial version of eys using boost-python.
137     *
138     *
139     */
140    

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26