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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 201 - (show annotations)
Wed Nov 23 04:10:21 2005 UTC (13 years, 11 months ago) by jgs
File MIME type: text/plain
File size: 5668 byte(s)
copy finleyC and CPPAdapter to finley and finley/CPPAdapter to
facilitate scons builds

1 /*
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 /**************************************************************/
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 dim_t NN,i,j,numDim;
34
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 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 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 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 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 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 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 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 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 * 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 * Revision 1.2 2005/07/08 04:07:54 jgs
127 * Merge of development branch back to main trunk on 2005-07-08
128 *
129 * 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 * 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