[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [29858] branches/soc-2010-rohith291991/ intern/comiso/intern: Small fixes to comiso.
Rohith B V
rohith291991 at gmail.com
Fri Jul 2 00:12:25 CEST 2010
Revision: 29858
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=29858
Author: rohith291991
Date: 2010-07-02 00:12:24 +0200 (Fri, 02 Jul 2010)
Log Message:
-----------
Small fixes to comiso.
Modified Paths:
--------------
branches/soc-2010-rohith291991/intern/comiso/intern/CMesh.cpp
branches/soc-2010-rohith291991/intern/comiso/intern/comiso.cpp
Modified: branches/soc-2010-rohith291991/intern/comiso/intern/CMesh.cpp
===================================================================
--- branches/soc-2010-rohith291991/intern/comiso/intern/CMesh.cpp 2010-07-01 21:09:45 UTC (rev 29857)
+++ branches/soc-2010-rohith291991/intern/comiso/intern/CMesh.cpp 2010-07-01 22:12:24 UTC (rev 29858)
@@ -247,7 +247,7 @@
else
sign=-1;// <---- TODO check
- solver.mdata[t].value=mesh->edges[mesh->faces[i].edges[j]].p * sign * 3.1415926;
+ solver.mdata[t].value= sign * 3.1415926;
t++;
}
@@ -264,17 +264,17 @@
solver.mdata[t].i=i+totface;
solver.mdata[t].j=totface+mesh->edges[i].index;
- solver.mdata[t].value=3.1415926*3.1415926*0.5*mesh->edges[i].p;
+ solver.mdata[t].value=3.1415926*3.1415926*0.5;
t++;
solver.mdata[t].i=i+totface;
solver.mdata[t].j=mesh->edges[i].faces[0];
- solver.mdata[t].value=mesh->faces[mesh->edges[i].faces[0]].theta*3.1415926;
+ solver.mdata[t].value=3.1415926;
t++;
solver.mdata[t].i=i+totface;
solver.mdata[t].j=mesh->edges[i].faces[1];
- solver.mdata[t].value=mesh->faces[mesh->edges[i].faces[1]].theta* -3.1415926;
+ solver.mdata[t].value=-3.1415926;
t++;
solver.mdata[t].i=i+totface;
@@ -335,7 +335,7 @@
t++;
solver.cdata[t].i = c;
solver.cdata[t].j = solver.n-1;
- solver.cdata[t].value = mesh->faces[i].theta;
+ solver.cdata[t].value = -mesh->faces[i].theta;
t++;
c++;
}
@@ -352,7 +352,7 @@
t++;
solver.cdata[t].i = c;
solver.cdata[t].j = solver.n-1;
- solver.cdata[t].value = mesh->edges[i].p;
+ solver.cdata[t].value = -mesh->edges[i].p;
t++;
c++;
}
Modified: branches/soc-2010-rohith291991/intern/comiso/intern/comiso.cpp
===================================================================
--- branches/soc-2010-rohith291991/intern/comiso/intern/comiso.cpp 2010-07-01 21:09:45 UTC (rev 29857)
+++ branches/soc-2010-rohith291991/intern/comiso/intern/comiso.cpp 2010-07-01 22:12:24 UTC (rev 29858)
@@ -37,36 +37,22 @@
int i;
int j;
- MatrixXd Btcol;
- MatrixXd Bcol;
VectorXd b;
- Btcol.resize(dimn, dimm);
- Bcol.resize(dimm, dimn);
- _A.resize( dimn, dimn);
- Bcol=MatrixXd(_B);
- Btcol=MatrixXd(Bcol.transpose());
- _A=MatrixXd((Btcol*Bcol));
+ _A.resize( dimm, dimm);
+ _A=MatrixXd((_B.block(0,0,dimm,dimm)));
- b.resize( dimn);
- b=_A.col(dimn-1);
- _b.resize(dimn-1);
+ b.resize( dimm);
+ b=_B.col(dimn-1);
+ _b.resize(dimm);
- MatrixXd tA=_A;
+
- _A.resize( dimn-1, dimn-1);
-
- for(i=0;i<dimn-1;i++)
+ for(i=0;i<dimm;i++)
{
- _b[i]=-1.0*b[i];
+ _b[i]=b[i];
+ std::cout<<_b[i]<<"\n";
- for(j=0;j<dimn-1;j++)
- {
-
- _A(i,j)=tA(i,j);
-
- }
}
-
}
/// function to print the equations corresponding to the matrices of an equation system
@@ -118,8 +104,8 @@
std::vector< int > new_idx;
std::vector< double > x(b.size());
-// std::cout<<B<<"\n\n\n";
-// std::cout<<C<<"\n";
+ //std::cout<<B<<"\n\n\n";
+ //std::cout<<A<<"\n";
cs.eliminate_constraints( C, A, x, b, ids_to_round, ids_to_elim, new_idx, Acsc);
More information about the Bf-blender-cvs
mailing list