# Contents of /trunk/finley/src/Quadrature.c

Revision 616 - (show annotations)
Wed Mar 22 02:46:56 2006 UTC (13 years, 6 months ago) by elspeth
File MIME type: text/plain
File size: 16500 byte(s)
```Copyright added to more source files.

```
 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: */ 16 17 /**************************************************************/ 18 19 /* Author: gross@access.edu.au */ 20 /* Version: \$Id\$ */ 21 22 /**************************************************************/ 23 24 #include "Quadrature.h" 25 26 #define QUADNODES(_K_,_I_) quadNodes[INDEX2(_K_,_I_,DIM)] 27 #define QUADWEIGHTS(_I_) quadWeights[_I_] 28 29 /**************************************************************/ 30 31 /* get a quadrature scheme with numQuadNodes quadrature nodes for the tri */ 32 /* as a queezed scheme on a quad [0,1]^2 */ 33 34 void Finley_Quad_getNodesTri(int numQuadNodes,double* quadNodes,double* quadWeights) { 35 int i; 36 double Q1,Q2; 37 #define DIM 2 38 39 /* the easy case: */ 40 41 if (numQuadNodes==1) { 42 QUADNODES(0,0)=1./3.; 43 QUADNODES(1,0)=1./3.; 44 QUADWEIGHTS(0)= .5; 45 } else { 46 47 /* get scheme on [0.1]^2 */ 48 49 Finley_Quad_getNodesRec(numQuadNodes,quadNodes,quadWeights); 50 if (! Finley_noError()) return; 51 52 /* squeeze it: */ 53 54 for (i=0;i 2*MAX_numQuadNodesLine-1) { 424 sprintf(error_msg,"__FILE__: requested integration order %d on line is too large (>%d).", 425 order,2*MAX_numQuadNodesLine-1); 426 Finley_setError(VALUE_ERROR,error_msg); 427 return -1; 428 } else { 429 Finley_resetError(); 430 return order/2+1; 431 } 432 } 433 } 434 435 int Finley_Quad_getNumNodesTri(int order) { 436 int numQuadNodesLine; 437 if (order==1) { 438 return 1; 439 } else { 440 numQuadNodesLine=Finley_Quad_getNumNodesLine(order+1); 441 if (Finley_noError()) { 442 return numQuadNodesLine*numQuadNodesLine; 443 } else { 444 return -1; 445 } 446 } 447 } 448 449 int Finley_Quad_getNumNodesRec(int order) { 450 int numQuadNodesLine; 451 numQuadNodesLine=Finley_Quad_getNumNodesLine(order); 452 if (Finley_noError()) { 453 return numQuadNodesLine*numQuadNodesLine; 454 } else { 455 return -1; 456 } 457 } 458 459 int Finley_Quad_getNumNodesTet(int order) { 460 int numQuadNodesLine; 461 numQuadNodesLine=Finley_Quad_getNumNodesLine(order+2); 462 if (Finley_noError()) { 463 return numQuadNodesLine*numQuadNodesLine*numQuadNodesLine; 464 } else { 465 return -1; 466 } 467 } 468 469 int Finley_Quad_getNumNodesHex(int order) { 470 int numQuadNodesLine; 471 numQuadNodesLine=Finley_Quad_getNumNodesLine(order); 472 if (Finley_noError()) { 473 return numQuadNodesLine*numQuadNodesLine*numQuadNodesLine; 474 } else { 475 return -1; 476 } 477 } 478 /* 479 * \$Log\$ 480 * Revision 1.2 2005/09/15 03:44:23 jgs 481 * Merge of development branch dev-02 back to main trunk on 2005-09-15 482 * 483 * Revision 1.1.1.1.6.1 2005/09/07 06:26:20 gross 484 * the solver from finley are put into the standalone package paso now 485 * 486 * Revision 1.1.1.1 2004/10/26 06:53:57 jgs 487 * initial import of project esys2 488 * 489 * Revision 1.2 2004/08/03 04:49:06 gross 490 * bug in Quadrature.c fixed 491 * 492 * Revision 1.1.1.1 2004/06/24 04:00:40 johng 493 * Initial version of eys using boost-python. 494 * 495 * 496 */

## Properties

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

 ViewVC Help Powered by ViewVC 1.1.26