/[escript]/branches/domexper/dudley/src/Mesh_print.c
ViewVC logotype

Contents of /branches/domexper/dudley/src/Mesh_print.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3126 - (show annotations)
Wed Sep 1 00:37:53 2010 UTC (9 years, 4 months ago) by jfenwick
File MIME type: text/plain
File size: 4003 byte(s)
Updated referenceElements and enums
1
2 /*******************************************************
3 *
4 * Copyright (c) 2003-2010 by University of Queensland
5 * Earth Systems Science Computational Center (ESSCC)
6 * http://www.uq.edu.au/esscc
7 *
8 * Primary Business: Queensland, Australia
9 * Licensed under the Open Software License version 3.0
10 * http://www.opensource.org/licenses/osl-3.0.php
11 *
12 *******************************************************/
13
14
15 /**************************************************************/
16
17 /* Dudley: prints Mesh */
18
19 /**************************************************************/
20
21 #include "Mesh.h"
22
23 /**************************************************************/
24
25 /* prints the mesh to the standarts output: */
26
27 void Dudley_Mesh_print(Dudley_Mesh *in) {
28 dim_t NN,i,j,numDim,NN2;
29
30 /* write header */
31
32 printf("Mesh name: %s\n",in->Name);
33
34 /* write nodes: */
35
36 if (in->Nodes!=NULL) {
37 numDim=in->Nodes->numDim;
38 printf("=== %1dD-Nodes:\nnumber of nodes=%d\n", numDim,in->Nodes->numNodes);
39 printf("Id,Tag,globalDegreesOfFreedom,degreesOfFreedom,reducedDegreesOfFeedom,node,reducedNode,Coordinates\n");
40 for (i=0;i<in->Nodes->numNodes;i++) {
41 printf("%d,%d,%d,%d,%d,%d,%d ",
42 in->Nodes->Id[i],in->Nodes->Tag[i],in->Nodes->globalDegreesOfFreedom[i],
43 in->Nodes->degreesOfFreedomMapping->target[i],
44 in->Nodes->reducedDegreesOfFreedomMapping->target[i],
45 in->Nodes->nodesMapping->target[i],
46 in->Nodes->reducedNodesMapping->target[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 printf( "=== %s:\nnumber of elements=%d\ncolor range=[%d,%d]\n",
56 in->Elements->referenceElementSet->referenceElement->Type->Name,in->Elements->numElements,in->Elements->minColor,in->Elements->maxColor);
57 NN=in->Elements->referenceElementSet->referenceElement->Type->numNodes;
58 NN2=in->Elements->numNodes;
59 if (in->Elements->numElements>0) {
60 printf("Id,Tag,Owner,Color,Nodes\n");
61 for (i=0;i<in->Elements->numElements;i++) {
62 printf("%d,%d,%d,%d,",in->Elements->Id[i],in->Elements->Tag[i],in->Elements->Owner[i], in->Elements->Color[i]);
63 for (j=0;j<NN;j++) printf(" %d",in->Nodes->Id[in->Elements->Nodes[INDEX2(j,i,NN2)]]);
64 printf("\n");
65 }
66 }
67 }
68
69 /* write face elements: */
70
71
72 if (in->FaceElements!=NULL) {
73 printf( "=== %s:\nnumber of elements=%d\ncolor range=[%d,%d]\n",
74 in->FaceElements->referenceElementSet->referenceElement->Type->Name,in->FaceElements->numElements,in->FaceElements->minColor,in->FaceElements->maxColor);
75 NN=in->FaceElements->referenceElementSet->referenceElement->Type->numNodes;
76 NN2=in->FaceElements->numNodes;
77 if (in->FaceElements->numElements>0) {
78 printf("Id,Tag,Owner,Color,Nodes\n");
79 for (i=0;i<in->FaceElements->numElements;i++) {
80 printf("%d,%d,%d,%d,",in->FaceElements->Id[i],in->FaceElements->Tag[i],in->Elements->Owner[i], in->FaceElements->Color[i]);
81 for (j=0;j<NN;j++) printf(" %d",in->Nodes->Id[in->FaceElements->Nodes[INDEX2(j,i,NN2)]]);
82 printf("\n");
83 }
84 }
85 }
86
87
88 /* write points: */
89 if (in->Points!=NULL) {
90 printf( "=== %s:\nnumber of elements=%d\ncolor range=[%d,%d]\n",
91 in->Points->referenceElementSet->referenceElement->Type->Name,in->Points->numElements,in->Points->minColor,in->Points->maxColor);
92 NN=in->Points->referenceElementSet->referenceElement->Type->numNodes;
93 NN2=in->Points->numNodes;
94 if (in->Points->numElements>0) {
95 printf("Id,Tag,Owner,Color,Nodes\n");
96 for (i=0;i<in->Points->numElements;i++) {
97 printf("%d,%d,%d,%d,",in->Points->Id[i],in->Points->Tag[i],in->Elements->Owner[i], in->Points->Color[i]);
98 for (j=0;j<NN;j++) printf(" %d",in->Nodes->Id[in->Points->Nodes[INDEX2(j,i,NN2)]]);
99 printf("\n");
100 }
101 }
102 }
103 }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26