Commit 6853b1e7 authored by Kirill Terekhov's avatar Kirill Terekhov

Synchronize

parent 3842dfb7
......@@ -600,7 +600,7 @@ namespace INMOST
{
std::pair<Matrix,bool> ret = std::make_pair(Matrix(m,n),true);
Matrix At = Transpose(); //m by n matrix
Matrix AtB = At*Unit(n); //m by n matrix
Matrix AtB = At; //m by n matrix
Matrix AtA = At*(*this); //m by m matrix
enumerator * order = new enumerator [m];
for(enumerator i = 0; i < m; ++i) order[i] = i;
......@@ -832,6 +832,23 @@ namespace INMOST
for(enumerator k = 0; k < size; ++k) ret(k,k) = 1.0/r[k];
return ret;
}
static Matrix CrossProduct(Var vec[3])
{
// | 0 -z y |
// | z 0 -x |
// | -y x 0 |
Matrix ret(3,3);
ret(0,0) = 0.0;
ret(0,1) = -vec[2]; //-z
ret(0,2) = vec[1]; //y
ret(1,0) = vec[2]; //z
ret(1,1) = 0;
ret(1,2) = -vec[0]; //-x
ret(2,0) = -vec[1]; //-y
ret(2,1) = vec[0]; //x
ret(2,2) = 0;
return ret;
}
///Unit matrix
static Matrix Unit(enumerator pn)
{
......@@ -951,9 +968,15 @@ namespace INMOST
};
//template<typename typeA, typename typeB>
//Matrix<typename Promote<typeA,typeB>::type> operator *(const typeA & coef, const Matrix<typeB> & other)
//{return other*coef;}
template<typename typeB>
Matrix<typename Promote<INMOST_DATA_REAL_TYPE,typeB>::type> operator *(INMOST_DATA_REAL_TYPE coef, const Matrix<typeB> & other)
{return other*coef;}
#if defined(USE_AUTODIFF)
template<typename typeB>
Matrix<typename Promote<variable,typeB>::type> operator *(const variable & coef, const Matrix<typeB> & other)
{return other*coef;}
#endif
typedef Matrix<INMOST_DATA_REAL_TYPE> rMatrix; //shortcut for real matrix
......
......@@ -94,8 +94,9 @@ namespace INMOST
void Mesh::Init(std::string name)
{
m_link = this;
integer selfid = TieElement(5);
m_link = this;
integer selfid = 1;
selfid = TieElement(5);
assert(selfid == 0);
dim = 3;
have_global_id = NONE;
......@@ -111,7 +112,7 @@ namespace INMOST
tag_geom_type = CreateTag("PROTECTED_GEOM_TYPE",DATA_BULK,CELL|FACE|EDGE|NODE,NONE,1);
tag_setname = CreateTag("PROTECTED_SET_NAME",DATA_BULK,ESET,NONE);
tag_setcomparator = CreateTag("PROTECTED_SET_COMPARATOR",DATA_BULK,ESET,NONE,1);
AllocatePrivateMarkers();
AllocatePrivateMarkers();
for(ElementType etype = NODE; etype <= MESH; etype = etype << 1)
ReallocateData(ElementNum(etype),GetArrayCapacity(ElementNum(etype)));
epsilon = 1.0e-8;
......@@ -277,7 +278,8 @@ namespace INMOST
name = tmp.str();
}
m_link = this;
integer selfid = TieElement(5);
integer selfid = 1;
selfid = TieElement(5);
assert(selfid == 0);
//TagManager constuctor copied only tags
//copy links:
......
......@@ -1177,7 +1177,7 @@ namespace INMOST
assert(JR.isSorted());
assert(H.isSorted());
output.Resize(H.Size()+JL.Size()*JR.Size());
INMOST_DATA_ENUM_TYPE i = 0, j = 0, k = 0, l = 0, q = 0, kk = 0, ll = 0, r;
INMOST_DATA_ENUM_TYPE i = 0, k = 0, l = 0, q = 0, kk = 0, ll = 0, r;
entry candidate[2] = {stub_entry,stub_entry};
if( i < H.Size() )
candidate[0] = make_entry(H.GetIndex(i),b*H.GetValue(i));
......
......@@ -89,7 +89,7 @@ int main(int argc,char ** argv)
Mesh * m = new Mesh(); // Create an empty mesh
m->SetCommunicator(INMOST_MPI_COMM_WORLD); // Set the MPI communicator for the mesh
int rank = m->GetProcessorRank(), nproc = m->GetProcessorsNumber();
int rank = m->GetProcessorRank();//, nproc = m->GetProcessorsNumber();
if( rank == 0 || m->isParallelFileFormat(argv[1]) ) m->Load(argv[1]); // Load input mesh
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment