# Contents of /trunk/finley/src/Assemble_getSize.cpp

Revision 4492 - (show annotations)
Tue Jul 2 01:44:11 2013 UTC (5 years, 9 months ago) by caltinay
File size: 3624 byte(s)
```Finley changes that were held back while in release mode - moved more stuff
into finley namespace.

```
 1 2 /***************************************************************************** 3 * 4 * Copyright (c) 2003-2013 by University of Queensland 5 6 * 7 * Primary Business: Queensland, Australia 8 * Licensed under the Open Software License version 3.0 9 10 * 11 * Development until 2012 by Earth Systems Science Computational Center (ESSCC) 12 * Development since 2012 by School of Earth Sciences 13 * 14 *****************************************************************************/ 15 16 17 /**************************************************************************** 18 19 Assemblage routines: calculates the minimum distance between two vertices 20 of elements and assigns the value to each quadrature point in out. 21 22 *****************************************************************************/ 23 24 #include "Assemble.h" 25 #include "Util.h" 26 27 namespace finley { 28 29 void Assemble_getSize(NodeFile* nodes, ElementFile* elements, escript::Data& out) 30 { 31 Finley_resetError(); 32 33 if (!nodes || !elements) 34 return; 35 36 ReferenceElement *refElement = ReferenceElementSet_borrowReferenceElement( 37 elements->referenceElementSet, 38 util::hasReducedIntegrationOrder(out)); 39 40 const int numDim=nodes->numDim; 41 const int numQuad=refElement->Parametrization->numQuadNodes; 42 const int NN=elements->numNodes; 43 const int NS=refElement->Parametrization->Type->numShapes; 44 const int NVertices=refElement->Parametrization->Type->numVertices; 45 46 // check the dimensions of out 47 if (!out.numSamplesEqual(numQuad, elements->numElements)) { 48 Finley_setError(TYPE_ERROR, "Assemble_getSize: illegal number of samples of out Data object"); 49 } else if (!out.isDataPointShapeEqual(0, &numDim)) { 50 Finley_setError(TYPE_ERROR, "Assemble_getSize: illegal data point shape of out Data object"); 51 } else if (!out.actsExpanded()) { 52 Finley_setError(TYPE_ERROR, "Assemble_getSize: expanded Data object is expected for element size."); 53 } 54 55 if (!Finley_noError()) 56 return; 57 58 // now we can start 59 int node_offset; 60 if (out.getFunctionSpace().getTypeCode()==FINLEY_CONTACT_ELEMENTS_2) { 61 node_offset=refElement->Type->offsets[1]; 62 } else { 63 node_offset=refElement->Type->offsets[0]; 64 } 65 const double f=pow(0.5, pow((double)(refElement->Type->numSubElements), 66 1./(double)(numDim))-1); 67 68 out.requireWrite(); 69 #pragma omp parallel 70 { 71 std::vector local_X(NN*numDim); 72 #pragma omp parallel for 73 for (int e=0; enumElements; e++) { 74 // gather local coordinates of nodes into 75 // local_X(numDim,NN): 76 util::gather(NS, &(elements->Nodes[INDEX2(node_offset,e,NN)]), 77 numDim, nodes->Coordinates, &local_X[0]); 78 // calculate minimal differences: 79 double max_diff=0.; 80 for (int n0=0; n0

## Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision
svn:mergeinfo /branches/lapack2681/finley/src/Assemble_getSize.cpp:2682-2741 /branches/pasowrap/finley/src/Assemble_getSize.cpp:3661-3674 /branches/py3_attempt2/finley/src/Assemble_getSize.cpp:3871-3891 /branches/restext/finley/src/Assemble_getSize.cpp:2610-2624 /branches/ripleygmg_from_3668/finley/src/Assemble_getSize.cpp:3669-3791 /branches/stage3.0/finley/src/Assemble_getSize.cpp:2569-2590 /branches/symbolic_from_3470/finley/src/Assemble_getSize.cpp:3471-3974 /release/3.0/finley/src/Assemble_getSize.cpp:2591-2601 /trunk/finley/src/Assemble_getSize.cpp:4257-4344