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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 964 - (show annotations)
Tue Feb 13 05:10:26 2007 UTC (12 years, 8 months ago) by gross
File MIME type: text/plain
File size: 3477 byte(s)
The set/getRefVal functions of Data objects have been removed (mainly to avoid later problems with MPI).
Moreover, a faster access to the reference id of samples has been introduced. I don't think that anybody will
profit form this at this stage but it will allow a faster dump of data objects.


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: Mesh: prepares the mesh for further calculations */
16
17 /**************************************************************/
18
19 /* Author: gross@access.edu.au */
20 /* Version: $Id$ */
21
22 /**************************************************************/
23
24 #include "Mesh.h"
25
26 /**************************************************************/
27
28 void Finley_Mesh_prepare(Finley_Mesh* in) {
29
30 /* set the labeling vectors in node files: */
31 Finley_Mesh_prepareNodes(in);
32
33 #ifndef PASO_MPI
34 /* rearrange elements: */
35 Finley_Mesh_optimizeElementDistribution(in);
36
37 /* improve coloring */
38 Finley_Mesh_improveColoring(in);
39 #endif
40 }
41
42 bool_t Finley_Mesh_isPrepared(Finley_Mesh* in) {
43 /* returns true if nodes and elements have been prepared for calculation */
44 index_t out = TRUE;
45 if ( in->Nodes != NULL) out = MIN(out , in->Nodes->isPrepared);
46 if ( in->Elements != NULL) out = MIN(out , in->Elements->isPrepared);
47 if ( in->FaceElements != NULL) out = MIN(out , in->FaceElements->isPrepared);
48 if ( in->ContactElements != NULL) out = MIN(out , in->ContactElements->isPrepared);
49 if ( in->Points != NULL) out = MIN(out , in->Points->isPrepared);
50
51 return out == FINLEY_PREPARED;
52 }
53 /* */
54 /* tries to reduce the coloring for all element files: */
55 /* */
56 void Finley_Mesh_improveColoring(Finley_Mesh* in) {
57 Finley_ElementFile_improveColoring(in->Elements,in->Nodes->numNodes,in->Nodes->degreeOfFreedom);
58 Finley_ElementFile_improveColoring(in->FaceElements,in->Nodes->numNodes,in->Nodes->degreeOfFreedom);
59 Finley_ElementFile_improveColoring(in->Points,in->Nodes->numNodes,in->Nodes->degreeOfFreedom);
60 Finley_ElementFile_improveColoring(in->ContactElements,in->Nodes->numNodes,in->Nodes->degreeOfFreedom);
61 }
62 /* */
63 /* redistribute elements to minimize communication during assemblage */
64 /* */
65 void Finley_Mesh_optimizeElementDistribution(Finley_Mesh* in) {
66 Finley_ElementFile_optimizeDistribution(&(in->Elements));
67 Finley_ElementFile_optimizeDistribution(&(in->FaceElements));
68 Finley_ElementFile_optimizeDistribution(&(in->Points));
69 Finley_ElementFile_optimizeDistribution(&(in->ContactElements));
70 }
71
72 /*
73 * $Log$
74 * Revision 1.2 2005/09/15 03:44:22 jgs
75 * Merge of development branch dev-02 back to main trunk on 2005-09-15
76 *
77 * Revision 1.1.1.1.6.1 2005/09/07 06:26:19 gross
78 * the solver from finley are put into the standalone package paso now
79 *
80 * Revision 1.1.1.1 2004/10/26 06:53:57 jgs
81 * initial import of project esys2
82 *
83 * Revision 1.1.1.1 2004/06/24 04:00:40 johng
84 * Initial version of eys using boost-python.
85 *
86 *
87 */
88

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26