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

Contents of /trunk-mpi-branch/finley/src/Mesh_print.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1223 - (show annotations)
Fri Aug 3 02:40:39 2007 UTC (11 years, 8 months ago) by gross
File MIME type: text/plain
File size: 4868 byte(s)
first attemt towards an improved MPI version.  

1 /*
2 ************************************************************
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 */
12
13 /**************************************************************/
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 dim_t NN,i,j,numDim;
32
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\n", numDim,in->Nodes->numNodes);
42 printf("Id,Tag,globalDegreesOfFreedom,degreesOfFreedom,reducedDegreesOfFeedom,node,reducedNode,Coordinates\n");
43 for (i=0;i<in->Nodes->numNodes;i++) {
44 printf("%d,%d,%d,%d,%d,%d,%d ",
45 in->Nodes->Id[i],in->Nodes->Tag[i],in->Nodes->globalDegreesOfFreedom[i],
46 in->Nodes->degreesOfFreedomMapping->target[i],
47 in->Nodes->reducedDegreesOfFreedomMapping->target[i],
48 in->Nodes->nodesMapping->target[i],
49 in->Nodes->reducedNodesMapping->target[i]);
50 for (j=0;j<numDim;j++) printf(" %20.15e",in->Nodes->Coordinates[INDEX2(j,i,numDim)]);
51 printf("\n");
52 }
53 }
54
55 /* write elements: */
56
57 if (in->Elements!=NULL) {
58 printf( "=== %s:\nnumber of elements=%d\ncolor range=[%d,%d]\n",
59 in->Elements->ReferenceElement->Type->Name,in->Elements->numElements,in->Elements->minColor,in->Elements->maxColor);
60 NN=in->Elements->ReferenceElement->Type->numNodes;
61 if (in->Elements->numElements>0) {
62 printf("Id,Tag,Owner,Color,Nodes\n");
63 for (i=0;i<in->Elements->numElements;i++) {
64 printf("%d,%d,%d,%d,",in->Elements->Id[i],in->Elements->Tag[i],in->Elements->Owner[i], in->Elements->Color[i]);
65 for (j=0;j<NN;j++) printf(" %d",in->Nodes->Id[in->Elements->Nodes[INDEX2(j,i,NN)]]);
66 printf("\n");
67 }
68 }
69 }
70
71 /* write face elements: */
72
73
74 if (in->FaceElements!=NULL) {
75 printf( "=== %s:\nnumber of elements=%d\ncolor range=[%d,%d]\n",
76 in->FaceElements->ReferenceElement->Type->Name,in->FaceElements->numElements,in->FaceElements->minColor,in->FaceElements->maxColor);
77 NN=in->FaceElements->ReferenceElement->Type->numNodes;
78 if (in->FaceElements->numElements>0) {
79 printf("Id,Tag,Owner,Color,Nodes\n");
80 for (i=0;i<in->FaceElements->numElements;i++) {
81 printf("%d,%d,%d,%d,",in->FaceElements->Id[i],in->FaceElements->Tag[i],in->Elements->Owner[i], in->FaceElements->Color[i]);
82 for (j=0;j<NN;j++) printf(" %d",in->Nodes->Id[in->FaceElements->Nodes[INDEX2(j,i,NN)]]);
83 printf("\n");
84 }
85 }
86 }
87
88 /* write Contact elements : */
89 if (in->ContactElements!=NULL) {
90 printf( "=== %s:\nnumber of elements=%d\ncolor range=[%d,%d]\n",
91 in->ContactElements->ReferenceElement->Type->Name,in->ContactElements->numElements,in->ContactElements->minColor,in->ContactElements->maxColor);
92 NN=in->ContactElements->ReferenceElement->Type->numNodes;
93 if (in->ContactElements->numElements>0) {
94 printf("Id,Tag,Owner,Color,Nodes\n");
95 for (i=0;i<in->ContactElements->numElements;i++) {
96 printf("%d,%d,%d,%d,",in->ContactElements->Id[i],in->ContactElements->Tag[i],in->Elements->Owner[i], in->ContactElements->Color[i]);
97 for (j=0;j<NN;j++) printf(" %d",in->Nodes->Id[in->ContactElements->Nodes[INDEX2(j,i,NN)]]);
98 printf("\n");
99 }
100 }
101 }
102
103 /* write points: */
104 if (in->Points!=NULL) {
105 printf( "=== %s:\nnumber of elements=%d\ncolor range=[%d,%d]\n",
106 in->Points->ReferenceElement->Type->Name,in->Points->numElements,in->Points->minColor,in->Points->maxColor);
107 NN=in->Points->ReferenceElement->Type->numNodes;
108 if (in->Points->numElements>0) {
109 printf("Id,Tag,Owner,Color,Nodes\n");
110 for (i=0;i<in->Points->numElements;i++) {
111 printf("%d,%d,%d,%d,",in->Points->Id[i],in->Points->Tag[i],in->Elements->Owner[i], in->Points->Color[i]);
112 for (j=0;j<NN;j++) printf(" %d",in->Nodes->Id[in->Points->Nodes[INDEX2(j,i,NN)]]);
113 printf("\n");
114 }
115 }
116 }
117 }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26