/[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 616 - (hide annotations)
Wed Mar 22 02:46:56 2006 UTC (13 years, 7 months ago) by elspeth
File MIME type: text/plain
File size: 5346 byte(s)
Copyright added to more source files.

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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26