]> git.leopard-lacewing.eu Git - bacc.git/commitdiff
[src] gauss läuft... grenzen ???
authortreecity <treecity@26120e32-c555-405d-b3e1-1f783fb42516>
Fri, 11 Nov 2011 09:58:12 +0000 (09:58 +0000)
committertreecity <treecity@26120e32-c555-405d-b3e1-1f783fb42516>
Fri, 11 Nov 2011 09:58:12 +0000 (09:58 +0000)
[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

.cproject
src/gauss.cpp [new file with mode: 0644]
src/gauss.hpp [deleted file]
src/gaussgen.m [new file with mode: 0644]
src/slpRectangle.cpp
src/test_calcInt2.m

index c2da3d3cafcd17b7bff8c18c48e81eb87cdd77a0..b9158d1080ea345e4856f712d2465cd27c0594f4 100644 (file)
--- a/.cproject
+++ b/.cproject
@@ -45,7 +45,7 @@
                                                </toolChain>
                                        </folderInfo>
                                        <sourceEntries>
-                                               <entry excluding="src/maik|src/bem3d" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
+                                               <entry excluding="src/mex_build_AU.cpp|src/slpRectangle.cpp|src/mex_hello.cpp|src/maik|src/bem3d" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
                                        </sourceEntries>
                                </configuration>
                        </storageModule>
                                </scannerConfigBuildInfo>
                        </storageModule>
                        <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+                       <storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
+                       <storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+                       <storageModule moduleId="org.eclipse.cdt.make.core.buildtargets">
+                               <buildTargets/>
+                       </storageModule>
                </cconfiguration>
                <cconfiguration id="cdt.managedbuild.config.gnu.exe.release.1551091927">
                        <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.exe.release.1551091927" moduleId="org.eclipse.cdt.core.settings" name="Release">
                                                </toolChain>
                                        </folderInfo>
                                        <sourceEntries>
-                                               <entry excluding="src/maik|src/bem3d" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
+                                               <entry excluding="src/mex_build_AU.cpp|src/slpRectangle.cpp|src/mex_hello.cpp|src/maik|src/bem3d" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
                                        </sourceEntries>
                                </configuration>
                        </storageModule>
                                </scannerConfigBuildInfo>
                        </storageModule>
                        <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+                       <storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
+                       <storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
+                       <storageModule moduleId="org.eclipse.cdt.make.core.buildtargets">
+                               <buildTargets/>
+                       </storageModule>
                </cconfiguration>
        </storageModule>
        <storageModule moduleId="cdtBuildSystem" version="4.0.0">
diff --git a/src/gauss.cpp b/src/gauss.cpp
new file mode 100644 (file)
index 0000000..76b4630
--- /dev/null
@@ -0,0 +1,91 @@
+#ifndef GAUSS_NODES
+#define GAUSS_NODES
+
+#include <iostream>
+
+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 (file)
index 17f9c1f..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-#ifndef GAUSS_NODES
-#define GAUSS_NODES
-
-#include <string.h>
-
-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<N)
-                       return weight[i];
-               else
-                       retrun 0;
-       }
-       double getn(int i) const {
-               if(i<N)
-                       return node[i];
-               else
-                       retrun 0;
-       }
-
-private:
-       int N;
-       double * node;
-       double * weight;
-};
-
-*/
-
-
-#endif
diff --git a/src/gaussgen.m b/src/gaussgen.m
new file mode 100644 (file)
index 0000000..1e1fd29
--- /dev/null
@@ -0,0 +1,16 @@
+function str = gaussgen(start,stop,steps)
+
+str =['{' char(10)];
+for i = steps(1:end)
+  str = [str '{' char(10)];
+  [n w] = gauss(i,start,stop);
+  for j = 1:length(n)
+    str = [str char(9) '{' num2str(n(j),16) ',' num2str(w(j),16) '},' char(10)];
+  end
+  str = [str(1:end-2) '},' char(10)];
+end
+
+
+
+str = [str(1:end-2) '}'];
+end
\ No newline at end of file
index 84d81755fe9e0caab28816b6780ac4333d625b9e..cb06626f67a3390239aed3002594f6859e840268 100644 (file)
@@ -104,14 +104,18 @@ double G_AY2X2(double y1, double y2, double x1, double x2, double d3) {
 \r
        double sol = sqrt(hlp);\r
 \r
+       if (sol!=sol||fabs(sol)==numeric_limits<double>::infinity()){\r
+               cout << sol << endl;\r
+       }\r
 \r
        if ((x2 - y2) != 0)\r
                sol += (x2 - y2) * log(sqrt(hlp) - (x2 - y2));\r
 \r
-       if (sol!=sol||sol==numeric_limits<double>::infinity())\r
-               cerr << "G_AY2X2: " << sol << " isn't a Number. ("\r
+       if (sol!=sol||fabs(sol)==numeric_limits<double>::infinity()){\r
+               cout << "G_AY2X2: " << sol << " isn't a Number. ("\r
                        << y1 << "," << y2 << ")(" << x1 << "," << x2 << ")(" << d3 << ")" << endl;\r
-\r
+               cout << (x2-y2) << "__" << sqrt(hlp) << endl;\r
+       }\r
        return sol;\r
 }\r
 \r
@@ -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)\r
                                        * t * b * gauss_w5[i] * gauss_w5[j];\r
 \r
-                       if (sol!=sol||sol==numeric_limits<double>::infinity()){\r
+                       if (sol!=sol||fabs(sol)==numeric_limits<double>::infinity()){\r
                                cout << "->(" << i << "," << j << ")" << endl;\r
                                cout << "-|(" <<\r
                                                G_AY2X2(t * gauss_n5[j] + d1, v + d2, b * gauss_n5[i], d, d3)\r
@@ -309,6 +313,10 @@ double calcParIntQY1X1(double b, double d, double t, double v, double d1,
                                                                                        * t * b * gauss_w5[i] * gauss_w5[j]\r
                                << ")" << endl;\r
                                cout << "||"<< t * b * gauss_w5[i] * gauss_w5[j] <<"||-----------------" << endl;\r
+\r
+                               cout << "? (" << G_AY2X2(t * gauss_n5[j] + d1, d2, b * gauss_n5[i], 0, d3)\r
+                                               << "," <<  t * b * gauss_w5[i] * gauss_w5[j] << ")" << endl;\r
+\r
                                cout << endl;\r
                                return sol;\r
                        }\r
index 34a9e2d9d2d06bfd24768727c74510622636a128..e020ae3c4e6e668a4ddcb620f74a805371dd6cb5 100644 (file)
@@ -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