From: treecity Date: Fri, 11 Nov 2011 09:58:12 +0000 (+0000) Subject: [src] gauss läuft... grenzen ??? X-Git-Url: https://git.leopard-lacewing.eu/?a=commitdiff_plain;h=926ba8d4bad7267bdfb81b548cc9c49e07cf49b6;p=bacc.git [src] gauss läuft... grenzen ??? [src] QuadAchse Fehler gefunden... -> muss noch umgangen werden ((x2-y2) == |x-y| git-svn-id: https://drops.fb12.tu-berlin.de/svn/bacc/trunk@67 26120e32-c555-405d-b3e1-1f783fb42516 --- diff --git a/.cproject b/.cproject index c2da3d3..b9158d1 100644 --- a/.cproject +++ b/.cproject @@ -45,7 +45,7 @@ - + @@ -465,6 +465,11 @@ + + + + + @@ -508,7 +513,7 @@ - + @@ -928,6 +933,11 @@ + + + + + diff --git a/src/gauss.cpp b/src/gauss.cpp new file mode 100644 index 0000000..76b4630 --- /dev/null +++ b/src/gauss.cpp @@ -0,0 +1,91 @@ +#ifndef GAUSS_NODES +#define GAUSS_NODES + +#include + +using namespace std; + +typedef struct _Gauss{ + double n; + double w; +} Gauss; + +Gauss gauss[][32] = { + { + {0.5,1}}, + { + {0.2113248654051871,0.4999999999999999}, + {0.7886751345948129,0.4999999999999999}}, + { + {0.06943184420297371,0.1739274225687271}, + {0.3300094782075718,0.3260725774312732}, + {0.6699905217924281,0.326072577431273}, + {0.9305681557970263,0.173927422568727}}, + { + {0.01985507175123191,0.05061426814518822}, + {0.1016667612931866,0.1111905172266873}, + {0.2372337950418356,0.1568533229389437}, + {0.4082826787521751,0.1813418916891811}, + {0.5917173212478251,0.1813418916891812}, + {0.7627662049581644,0.1568533229389436}, + {0.8983332387068135,0.1111905172266873}, + {0.980144928248768,0.05061426814518825}}, + { + {0.005299532504175253,0.01357622970587728}, + {0.02771248846338364,0.03112676196932351}, + {0.06718439880608407,0.04757925584124631}, + {0.1222977958224983,0.06231448562776711}, + {0.1910618777986778,0.07479799440828819}, + {0.2709916111713863,0.08457825969750139}, + {0.3591982246103706,0.09130170752246231}, + {0.4524937450811814,0.09472530522753414}, + {0.5475062549188187,0.09472530522753445}, + {0.6408017753896295,0.09130170752246193}, + {0.7290083888286135,0.08457825969750142}, + {0.808938122201322,0.0747979944082887}, + {0.8777022041775016,0.06231448562776742}, + {0.9328156011939159,0.04757925584124623}, + {0.9722875115366163,0.03112676196932403}, + {0.9947004674958249,0.0135762297058772}}, + { + {0.001368069075259104,0.003509305004735008}, + {0.007194244227365809,0.008137197365452637}, + {0.01761887220624681,0.01269603265463125}, + {0.03254696203113011,0.01713693145651049}, + {0.05183942211697379,0.02141794901111367}, + {0.07531619313371507,0.02549902963118811}, + {0.1027581020160289,0.0293420467392677}, + {0.1339089406298552,0.03291111138818078}, + {0.1684778665348924,0.03617289705442425}, + {0.2061421213796186,0.03909694789353495}, + {0.2465500455338854,0.04165596211347347}, + {0.2893243619346824,0.04382604650220204}, + {0.3340656988589361,0.04558693934788215}, + {0.3803563188739316,0.04692219954040191}, + {0.4277640192086017,0.04781936003963715}, + {0.4758461671561307,0.04827004425736407}, + {0.5241538328438691,0.04827004425736345}, + {0.5722359807913984,0.04781936003963707}, + {0.6196436811260685,0.04692219954040222}, + {0.6659343011410638,0.04558693934788176}, + {0.7106756380653179,0.04382604650220195}, + {0.7534499544661147,0.04165596211347328}, + {0.7938578786203814,0.03909694789353577}, + {0.8315221334651075,0.03617289705442422}, + {0.866091059370145,0.03291111138818064}, + {0.8972418979839712,0.02934204673926768}, + {0.9246838068662852,0.02549902963118814}, + {0.9481605778830262,0.0214179490111134}, + {0.9674530379688698,0.01713693145651111}, + {0.9823811277937532,0.01269603265463138}, + {0.992805755772634,0.008137197365453092}, + {0.9986319309247407,0.003509305004734969}}}; + +int main(){ + + cout << "--" << endl; + cout << gauss[0][0].w << endl; + return 0; +} + +#endif diff --git a/src/gauss.hpp b/src/gauss.hpp deleted file mode 100644 index 17f9c1f..0000000 --- a/src/gauss.hpp +++ /dev/null @@ -1,83 +0,0 @@ -#ifndef GAUSS_NODES -#define GAUSS_NODES - -#include - -class gauss{ -public: - double * nod; - double * wei; -}; - -gauss* Quad = new gauss [6]; - -void initeQuad(){ - -double gn1[] = {0.2113248654051871, - 0.7886751345948129 - }; - -double gw1[] = {0.4999999999999999, - 0.4999999999999999 - }; - - - -Quad[0].nod = new double[1]; -Quad[0].nod[0] = 0.5; -Quad[0].wei = new double[1]; -Quad[0].wei[0] = 1; - -Quad[1].nod = new double[2]; -memcpy(Quad[1].nod,gn1,sizeof(double)*2); -Quad[1].wei = new double[2]; -memcpy(Quad[1].wei,gw1,sizeof(double)*2); - -Quad[2].nod = new double[4]; -memcpy(Quad[2].nod,gn4,sizeof(double)*4); -Quad[2].wei = new double[4]; -memcpy(Quad[2].wei,gw4,sizeof(double)*4); - -} -/* -class Gauss { -public: - Gauss(int n){ - N = n; - node = new double[n]; - weight = new double[n]; - - - } - ~Gauss(){ - delete[] node; - delete[] weight; - } - - int getN() const{ - return N; - } - - double getw(int i) const{ - if(i::infinity()){ + cout << sol << endl; + } if ((x2 - y2) != 0) sol += (x2 - y2) * log(sqrt(hlp) - (x2 - y2)); - if (sol!=sol||sol==numeric_limits::infinity()) - cerr << "G_AY2X2: " << sol << " isn't a Number. (" + if (sol!=sol||fabs(sol)==numeric_limits::infinity()){ + cout << "G_AY2X2: " << sol << " isn't a Number. (" << y1 << "," << y2 << ")(" << x1 << "," << x2 << ")(" << d3 << ")" << endl; - + cout << (x2-y2) << "__" << sqrt(hlp) << endl; + } return sol; } @@ -293,7 +297,7 @@ double calcParIntQY1X1(double b, double d, double t, double v, double d1, sol += G_AY2X2(t * gauss_n5[j] + d1, d2, b * gauss_n5[i], 0, d3) * t * b * gauss_w5[i] * gauss_w5[j]; - if (sol!=sol||sol==numeric_limits::infinity()){ + if (sol!=sol||fabs(sol)==numeric_limits::infinity()){ cout << "->(" << i << "," << j << ")" << endl; cout << "-|(" << G_AY2X2(t * gauss_n5[j] + d1, v + d2, b * gauss_n5[i], d, d3) @@ -309,6 +313,10 @@ double calcParIntQY1X1(double b, double d, double t, double v, double d1, * t * b * gauss_w5[i] * gauss_w5[j] << ")" << endl; cout << "||"<< t * b * gauss_w5[i] * gauss_w5[j] <<"||-----------------" << endl; + + cout << "? (" << G_AY2X2(t * gauss_n5[j] + d1, d2, b * gauss_n5[i], 0, d3) + << "," << t * b * gauss_w5[i] * gauss_w5[j] << ")" << endl; + cout << endl; return sol; } diff --git a/src/test_calcInt2.m b/src/test_calcInt2.m index 34a9e2d..e020ae3 100644 --- a/src/test_calcInt2.m +++ b/src/test_calcInt2.m @@ -56,7 +56,7 @@ coordinates=coo(h,diff); A_loadMesh(coordinates,elements,neigh); datA=[]; -for I = 1:5 +for I = 1:3 datA(I,:) = A_stepIso(1,[0 3 2]); % datA(I,:) = A_stepAniso(1,[0 1 3 2],1,0); I