Commit f6feda49 authored by Kirill Terekhov's avatar Kirill Terekhov

Some updates

Remove dependence on mesh in Automatizator

Fix few warnings on llvm-g++ in container.hpp

Add converter from elasticity tensor into matrix

Added separate hessian_variable that enables hessian calculation
parent 481d911b
......@@ -151,10 +151,10 @@ int main(int argc,char ** argv)
//~ if( m->GetProcessorRank() == 0 ) std::cout << "Prepare geometric data: " << Timer()-ttt << std::endl;
{
Automatizator aut(m);
Automatizator aut;
Automatizator::MakeCurrent(&aut);
INMOST_DATA_ENUM_TYPE iphi = aut.RegisterDynamicTag(phi,CELL);
aut.EnumerateDynamicTags();
INMOST_DATA_ENUM_TYPE iphi = aut.RegisterTag(phi,CELL);
aut.EnumerateTags();
// Set the indeces intervals for the matrix and vectors
R.SetInterval(aut.GetFirstIndex(),aut.GetLastIndex());
......@@ -180,7 +180,7 @@ int main(int argc,char ** argv)
Cell r2 = face->FrontCell();
if( ((!r1->isValid() || (s1 = r1->GetStatus()) == Element::Ghost)?0:1) +
((!r2->isValid() || (s2 = r2->GetStatus()) == Element::Ghost)?0:1) == 0) continue;
Storage::integer i1 = aut.GetDynamicIndex(r1,iphi), i2;
Storage::integer i1 = aut.GetIndex(r1,iphi), i2;
Storage::real f_nrm[3], r1_cnt[3], r2_cnt[3], f_cnt[3], d1, d2, D, v[3], T;
Storage::real f_area = face->Area(); // Get the face area
face->UnitNormal(f_nrm); // Get the face normal
......@@ -203,7 +203,7 @@ int main(int argc,char ** argv)
}
else
{
i2 = aut.GetDynamicIndex(r2,iphi);
i2 = aut.GetIndex(r2,iphi);
r2->Centroid(r2_cnt);
D = dot_prod(f_nrm,f_cnt);
d1 = fabs(dot_prod(r1_cnt,f_nrm) - D);
......@@ -281,7 +281,7 @@ int main(int argc,char ** argv)
{
Storage::real old = cell->Real(phi);
Storage::real exact = cell->Mean(func, 0); // Compute the mean value of the function over the cell
Storage::real res = Update[aut.GetDynamicIndex(cell->self(),iphi)];
Storage::real res = Update[aut.GetIndex(cell->self(),iphi)];
Storage::real sol = old-res;
Storage::real err = fabs (sol - exact);
if (err > local_err_C) local_err_C = err;
......
......@@ -547,10 +547,10 @@ int main(int argc,char ** argv)
ttt = Timer();
{ //Main loop for problem solution
Automatizator aut(m); // declare class to help manage unknowns
Automatizator aut; // declare class to help manage unknowns
Automatizator::MakeCurrent(&aut);
dynamic_variable P(aut,aut.RegisterDynamicTag(tag_P,CELL|FACE)); //register pressure as primary unknown
aut.EnumerateDynamicTags(); //enumerate all primary variables
dynamic_variable P(aut,aut.RegisterTag(tag_P,CELL|FACE)); //register pressure as primary unknown
aut.EnumerateTags(); //enumerate all primary variables
std::cout << "Enumeration done, size " << aut.GetLastIndex() - aut.GetFirstIndex() << std::endl;
......
This diff is collapsed.
......@@ -219,7 +219,7 @@ Mesh * ParallelGenerator(INMOST_MPI_Comm comm, int ng, int nx, int ny, int nz)
verts.push_back(newverts[V_ID(i - 0,j - 0, k - 0)]); // 7 /* | | / */
/* |/ |/ */
// Create cells based on parameter ng /* (1)*-------*(3) */
if (ng == 5)
if (ng == 5) // Create tetrahedral grid
{
CreateNWTetElements(m,verts);
}
......@@ -270,20 +270,27 @@ int main(int argc, char *argv[])
{
if( args == 0 ) std::cout << "Usage: " << argv[0] << " ng nx ny nz [output.[p]vtk]" << std::endl << "ng - 3 for prismatic mesh, 4 for cubic mesh" << std::endl;
if( args == 0 ) std::cout << "Default ";
if( ng == 4 )
{
std::cout << "Cubic ";
std::stringstream str;
str << "CUBIC_" << nx << "x" << ny << "x" << nz;
mesh_name = str.str();
}
else
{
std::cout << "Prismatic ";
std::stringstream str;
str << "PRISMATIC_" << nx << "x" << ny << "x" << nz;
mesh_name = str.str();
}
if( ng == 5 )
{
std::cout << "Tetrahedral ";
std::stringstream str;
str << "TETRAHEDRAL_" << nx << "x" << ny << "x" << nz;
mesh_name = str.str();
}
else if( ng == 4 )
{
std::cout << "Cubic ";
std::stringstream str;
str << "CUBIC_" << nx << "x" << ny << "x" << nz;
mesh_name = str.str();
}
else
{
std::cout << "Prismatic ";
std::stringstream str;
str << "PRISMATIC_" << nx << "x" << ny << "x" << nz;
mesh_name = str.str();
}
std::cout << "Grid: " << nx << " x " << ny << " x " << nz << std::endl;
std::cout << "Processors: " <<mesh->GetProcessorsNumber() << std::endl;
std::cout << "Mesh generator time: " << tt << std::endl;
......
......@@ -82,6 +82,9 @@ void transformation(double xyz[3])
mat_ret_type get_material_types(double xyz[3])
{
mat_ret_type ret1;
ret1.push_back(1);
return ret1;
#if defined(MASAHIKO_MESH)
mat_ret_type ret;
//ret.push_back(1);
......@@ -274,6 +277,7 @@ Storage::real get_press_by_mat(Storage::integer mat)
void fill_K(Storage::real * center, Storage::real * Kvec, Storage::real * K)
{
return;
Storage::real Knrm[3];
if( !get_type.Normal(center,Knrm) )
{
......@@ -923,14 +927,16 @@ int main(int argc, char ** argv)
make_proj.ReadLayers(layers);
}
{
std::vector<std::string> layers;
for(int i = 1; i <= 19; i++)
for(int i = 1; i <= 1; i++)
{
std::stringstream name;
//name << "Obj/rt" << i+1 << ".obj";
name << "oil_obj2/mat/layer" << i << ".obj";
layers.push_back(name.str());
}
/*
for(int i = 1; i <= 3; i++)
{
......
......@@ -1896,7 +1896,7 @@ void cellCreateINMOST(struct grid * g, int m, bool print = false)
replace.push_back(new_edge);
}
if( replace.size() == 4 && replace[1] == replace[3] || replace.size() < 4)
if( (replace.size() == 4 && replace[1] == replace[3]) || replace.size() < 4)
{
//if( new_edge != NULL ) face_edges.push_back(new_edge);
replace.clear(); // there is only one node and one edge left - avoid this edge duplication
......
......@@ -4948,8 +4948,9 @@ int main(int argc, char ** argv)
if(mesh->HaveTag("ADDED_ELEMENTS") )
{
Tag add = mesh->GetTag("ADDED_ELEMENTS");
for(Mesh::iteratorEdge it = mesh->BeginEdge(); it != mesh->EndEdge(); ++it) if( it->Integer(add) ) added_edges.push_back(it->self());
for(Mesh::iteratorFace it = mesh->BeginFace(); it != mesh->EndFace(); ++it) if( it->Integer(add) && !it->Boundary() ) added_faces.push_back(DrawFace(it->self()));
if( add.isDefined(EDGE) ) for(Mesh::iteratorEdge it = mesh->BeginEdge(); it != mesh->EndEdge(); ++it) if( it->Integer(add) ) added_edges.push_back(it->self());
if( add.isDefined(FACE) ) for(Mesh::iteratorFace it = mesh->BeginFace(); it != mesh->EndFace(); ++it) if( it->Integer(add) && !it->Boundary() ) added_faces.push_back(DrawFace(it->self()));
}
if(mesh->HaveTag("CONORMALS"))
{
......@@ -5034,12 +5035,12 @@ int main(int argc, char ** argv)
}
if( false )
//if( false )
//if( mesh->HaveTag("VELOCITY") && mesh->GetTag("VELOCITY").isDefined(CELL) )
{
printf("preparing octree around mesh, was sets %d\n",mesh->NumberOfSets());
Octree octsearch = Octree(mesh->CreateSet("octsearch").first);
octsearch.Construct(NODE,true);
octsearch.Construct(NODE,false); //auto-detect octree or quadtree
printf("done, sets %d\n",mesh->NumberOfSets());
printf("building streamlines\n");
Tag cell_size = mesh->CreateTag("CELL_SIZES",DATA_REAL,CELL,NONE,1);
......@@ -5055,73 +5056,76 @@ int main(int argc, char ** argv)
}
velmax = log(velmax+1.0e-25);
velmin = log(velmin+1.0e-25);
if( mesh->HaveTag("FACE_FLUX") )
{
Tag flux = mesh->GetTag("FACE_FLUX");
MarkerType visited = mesh->CreateMarker();
for(Mesh::iteratorFace f = mesh->BeginFace(); f != mesh->EndFace(); ++f) if( f->Boundary() )
{
if( f->Real(flux) > 1.0e-5 )
{
coord cntf;
f->Centroid(cntf.data());
streamlines.push_back(Streamline(octsearch,cntf,vel,cell_size,velmin,velmax,1.0,visited));
ElementArray<Edge> edges = f->getEdges();
for(ElementArray<Edge>::iterator n = edges.begin(); n != edges.end(); ++n)
{
coord cntn;
n->Centroid(cntn.data());
if( cntn[2] == cntf[2] )
{
const Storage::real coef[4] = {0.4,0.8};
for(int q = 0; q < 2; ++q)
streamlines.push_back(Streamline(octsearch,cntf*coef[q]+cntn*(1-coef[q]),vel,cell_size,velmin,velmax,1.0,visited));
}
}
}
else if( f->Real(flux) < -1.0e-5 )
{
coord cntf;
f->Centroid(cntf.data());
streamlines.push_back(Streamline(octsearch,cntf,vel,cell_size,velmin,velmax,-1.0,visited));
ElementArray<Edge> edges = f->getEdges();
for(ElementArray<Edge>::iterator n = edges.begin(); n != edges.end(); ++n)
{
coord cntn;
n->Centroid(cntn.data());
if( cntn[2] == cntf[2] )
{
const Storage::real coef[4] = {0.4,0.8};
for(int q = 0; q < 2; ++q)
streamlines.push_back(Streamline(octsearch,cntf*coef[q]+cntn*(1-coef[q]),vel,cell_size,velmin,velmax,-1.0,visited));
}
}
}
}
printf("done from boundary faces, total streamlines = %d\n",streamlines.size());
/*
for(Mesh::iteratorCell it = mesh->BeginCell(); it != mesh->EndCell(); ++it)
{
if( !it->GetMarker(visited) )
{
coord cntc;
it->Centroid(cntc.data());
if( coord(it->RealArray(vel).data()).length() > 1.0e-4 )
{
streamlines.push_back(Streamline(octsearch,cntc,vel,cell_size,velmin,velmax,1.0,0));
streamlines.push_back(Streamline(octsearch,cntc,vel,cell_size,velmin,velmax,-1.0,0));
}
}
}
printf("done from unvisited cells, total streamlines = %d\n",streamlines.size());
*/
for(Mesh::iteratorCell it = mesh->BeginCell(); it != mesh->EndCell(); ++it)
it->RemMarker(visited);
mesh->ReleaseMarker(visited);
}
/*
Tag flux = mesh->GetTag("FACE_FLUX");
MarkerType visited = mesh->CreateMarker();
if( false )
for(Mesh::iteratorFace f = mesh->BeginFace(); f != mesh->EndFace(); ++f) if( f->Boundary() )
{
if( f->Real(flux) > 1.0e-5 )
{
coord cntf;
f->Centroid(cntf.data());
streamlines.push_back(Streamline(octsearch,cntf,vel,cell_size,velmin,velmax,1.0,visited));
ElementArray<Edge> edges = f->getEdges();
for(ElementArray<Edge>::iterator n = edges.begin(); n != edges.end(); ++n)
{
coord cntn;
n->Centroid(cntn.data());
if( cntn[2] == cntf[2] )
{
const Storage::real coef[4] = {0.4,0.8};
for(int q = 0; q < 2; ++q)
streamlines.push_back(Streamline(octsearch,cntf*coef[q]+cntn*(1-coef[q]),vel,cell_size,velmin,velmax,1.0,visited));
}
}
}
else if( f->Real(flux) < -1.0e-5 )
{
coord cntf;
f->Centroid(cntf.data());
streamlines.push_back(Streamline(octsearch,cntf,vel,cell_size,velmin,velmax,-1.0,visited));
ElementArray<Edge> edges = f->getEdges();
for(ElementArray<Edge>::iterator n = edges.begin(); n != edges.end(); ++n)
{
coord cntn;
n->Centroid(cntn.data());
if( cntn[2] == cntf[2] )
{
const Storage::real coef[4] = {0.4,0.8};
for(int q = 0; q < 2; ++q)
streamlines.push_back(Streamline(octsearch,cntf*coef[q]+cntn*(1-coef[q]),vel,cell_size,velmin,velmax,-1.0,visited));
}
}
}
}
printf("done from boundary faces, total streamlines = %d\n",streamlines.size());
for(Mesh::iteratorCell it = mesh->BeginCell(); it != mesh->EndCell(); ++it)
{
if( !it->GetMarker(visited) )
{
coord cntc;
it->Centroid(cntc.data());
if( coord(it->RealArray(vel).data()).length() > 1.0e-4 )
{
streamlines.push_back(Streamline(octsearch,cntc,vel,cell_size,velmin,velmax,1.0,0));
streamlines.push_back(Streamline(octsearch,cntc,vel,cell_size,velmin,velmax,-1.0,0));
}
}
}
printf("done from unvisited cells, total streamlines = %d\n",streamlines.size());
for(Mesh::iteratorCell it = mesh->BeginCell(); it != mesh->EndCell(); ++it)
it->RemMarker(visited);
mesh->ReleaseMarker(visited);
*/
int numlines = 16;
int numlines = 16;
for(int i = 0; i < numlines; ++i)
{
for(int j = 0; j < numlines; ++j)
......@@ -5136,6 +5140,7 @@ int main(int argc, char ** argv)
}
}
printf("done from %d by %d grid, total streamlines = %d\n",numlines,numlines,(int)streamlines.size());
*/
mesh->DeleteTag(cell_size);
printf("done, total streamlines = %d\n",streamlines.size());
printf("killing octree, was sets %d\n",mesh->NumberOfSets());
......
......@@ -54,13 +54,13 @@ namespace INMOST
#endif //USE_MESH
#if defined(USE_MESH)
Automatizator::Automatizator(Mesh * m) :first_num(0), last_num(0), m(m) {}
Automatizator::Automatizator() :first_num(0), last_num(0) {}
Automatizator::~Automatizator()
{
for (unsigned k = 0; k < index_tags.size(); k++)
index_tags[k].indices = m->DeleteTag(index_tags[k].indices);
index_tags[k].indices = index_tags[k].indices.GetMeshLink()->DeleteTag(index_tags[k].indices);
}
INMOST_DATA_ENUM_TYPE Automatizator::RegisterDynamicTag(Tag t, ElementType typemask, MarkerType domain_mask)
INMOST_DATA_ENUM_TYPE Automatizator::RegisterTag(Tag t, ElementType typemask, MarkerType domain_mask)
{
tagpair p;
p.d.domain_mask = domain_mask;
......@@ -71,18 +71,19 @@ namespace INMOST
if (t.isDefined(q)) def |= q;
if (t.isSparse(q)) sparse |= q;
}
p.indices = m->CreateTag(t.GetTagName() + "_index", DATA_INTEGER, def, sparse, t.GetSize());
p.indices = t.GetMeshLink()->CreateTag(t.GetTagName() + "_index", DATA_INTEGER, def, sparse, t.GetSize());
INMOST_DATA_ENUM_TYPE ret = static_cast<INMOST_DATA_ENUM_TYPE>(reg_tags.size());
reg_tags.push_back(p);
index_tags.push_back(p);
return ret;
}
void Automatizator::EnumerateDynamicTags()
void Automatizator::EnumerateTags()
{
first_num = last_num = 0;
const ElementType paralleltypes = NODE | EDGE | FACE | CELL;
for (index_enum::iterator it = index_tags.begin(); it != index_tags.end(); ++it)
{
Mesh * m = it->indices.GetMeshLink();
for (ElementType etype = NODE; etype <= MESH; etype = etype << 1)
if (it->indices.isDefined(etype) && it->indices.isSparse(etype))
{
......@@ -94,6 +95,7 @@ namespace INMOST
for (index_enum::iterator it = index_tags.begin(); it != index_tags.end(); ++it)
{
Mesh * m = it->indices.GetMeshLink();
for (ElementType etype = NODE; etype <= MESH; etype = etype << 1)
{
if (it->indices.isDefined(etype))
......@@ -159,13 +161,16 @@ namespace INMOST
}
std::set<INMOST_DATA_ENUM_TYPE> Pre, Post; //Nonlocal indices
#if defined(USE_MPI)
if (m->GetProcessorsNumber() > 1)
int size;
MPI_Comm_size(MPI_COMM_WORLD,&size);
if (size > 1)
{
MPI_Scan(&last_num, &first_num, 1, INMOST_MPI_DATA_ENUM_TYPE, MPI_SUM, m->GetCommunicator());
MPI_Scan(&last_num, &first_num, 1, INMOST_MPI_DATA_ENUM_TYPE, MPI_SUM, MPI_COMM_WORLD);
first_num -= last_num;
ElementType exch_mask = NONE;
for (index_enum::iterator it = index_tags.begin(); it != index_tags.end(); ++it)
{
Mesh * m = it->indices.GetMeshLink();
for (ElementType etype = NODE; etype <= MESH; etype = etype << 1)
{
if (it->indices.isDefined(etype))
......@@ -232,13 +237,16 @@ namespace INMOST
//synchronize indices
last_num += first_num;
{
std::vector<Tag> exch_tags;
for (index_enum::iterator it = index_tags.begin(); it != index_tags.end(); ++it) exch_tags.push_back(it->indices);
m->ExchangeData(exch_tags, exch_mask,0);
std::map<Mesh *,std::vector<Tag> > exch_tags;
for (index_enum::iterator it = index_tags.begin(); it != index_tags.end(); ++it)
exch_tags[it->indices.GetMeshLink()].push_back(it->indices);
for(std::map<Mesh *,std::vector<Tag> >::iterator it = exch_tags.begin(); it != exch_tags.end(); ++it)
it->first->ExchangeData(it->second, exch_mask,0);
}
//compute out-of-bounds indices
for (index_enum::iterator it = index_tags.begin(); it != index_tags.end(); ++it)
{
Mesh * m = it->indices.GetMeshLink();
for (ElementType etype = NODE; etype <= MESH; etype = etype << 1)
{
if (it->indices.isDefined(etype))
......
......@@ -1800,7 +1800,7 @@ namespace INMOST
}
else
{
memcpy(other.stack,stack,sizeof(element)*k);
memcpy((void *)other.stack,(void *)stack,sizeof(element)*k);
other.pbegin = other.stack;
other.pend = other.stack+k;
other.preserved = other.stack+static_cast<size_type>(stacked);
......@@ -1814,15 +1814,15 @@ namespace INMOST
if( k <= static_cast<size_type>(stacked) && n <= static_cast<size_type>(stacked) )
{
char temp[stacked*sizeof(element)];
memcpy(temp,stack,sizeof(element)*k);
memcpy(stack,other.stack,sizeof(element)*n);
memcpy(other.stack,temp,sizeof(element)*k);
memcpy(temp,(void *)stack,sizeof(element)*k);
memcpy((void *)stack,(void *)other.stack,sizeof(element)*n);
memcpy((void *)other.stack,temp,sizeof(element)*k);
other.pend = other.pbegin+k;
pend = pbegin+n;
}
else if( k <= static_cast<size_type>(stacked) && n > static_cast<size_type>(stacked) )
{
memcpy(other.stack,stack,sizeof(element)*k);
memcpy((void *)other.stack,(void *)stack,sizeof(element)*k);
pbegin = other.pbegin;
pend = other.pend;
preserved = other.preserved;
......@@ -1832,7 +1832,7 @@ namespace INMOST
}
else if( k > static_cast<size_type>(stacked) && n <= static_cast<size_type>(stacked) )
{
memcpy(stack,other.stack,sizeof(element)*n);
memcpy((void *)stack,(void *)other.stack,sizeof(element)*n);
other.pbegin = pbegin;
other.pend = pend;
other.preserved = preserved;
......@@ -1867,7 +1867,7 @@ namespace INMOST
ptrdiff_t d = pos-begin();
ptrdiff_t s = (end()-pos)-1;
(*pos).~element();
if( s > 0 ) memmove(pbegin+d,pbegin+d+1,sizeof(element)*s);
if( s > 0 ) memmove((void *)(pbegin+d),(void *)(pbegin+d+1),sizeof(element)*s);
pend--;
return pbegin+d;
}
......@@ -1877,7 +1877,7 @@ namespace INMOST
ptrdiff_t s = iterator(pend)-e;
ptrdiff_t n = e-b;
for(iterator i = b; i != e; i++) (*i).~element();
if( s > 0 ) memmove(pbegin+d,pbegin+d+1,sizeof(element)*s);
if( s > 0 ) memmove((void *)(pbegin+d),(void *)(pbegin+d+1),sizeof(element)*s);
pend -= n;
return pbegin+d;
}
......@@ -1887,7 +1887,7 @@ namespace INMOST
ptrdiff_t s = iterator(pend)-pos;
if( pend == preserved ) reserve(capacity()*2);
pend++;
if( s > 0 ) memmove(pbegin+d+1,pbegin+d,sizeof(element)*s);
if( s > 0 ) memmove((void *)(pbegin+d+1),(void *)(pbegin+d),sizeof(element)*s);
new (pbegin+d) element(x);
return pbegin+d;
}
......@@ -1896,7 +1896,7 @@ namespace INMOST
ptrdiff_t d = pos-iterator(pbegin);
ptrdiff_t s = iterator(pend)-pos;
while( capacity()-size() < n ) reserve(capacity()*2);
if( s > 0 ) memmove(pbegin+d+n,pbegin+d,sizeof(element)*s);
if( s > 0 ) memmove((void *)(pbegin+d+n),(void *)(pbegin+d),sizeof(element)*s);
pend+=n;
for(size_type i = 0; i < n; i++) new (pbegin+d+i) element(x);
}
......@@ -1907,7 +1907,7 @@ namespace INMOST
ptrdiff_t d = pos-iterator(pbegin);
ptrdiff_t s = iterator(pend)-pos;
while( capacity() < size()+n ) reserve(capacity()*2);
if( s > 0 ) memmove(pbegin+d+n,pbegin+d,sizeof(element)*s);
if( s > 0 ) memmove((void *)(pbegin+d+n),(void *)(pbegin+d),sizeof(element)*s);
{
InputIterator it = first;
element * i = pbegin+d;
......
......@@ -146,9 +146,8 @@ namespace INMOST
tagpairs_type reg_tags;
INMOST_DATA_ENUM_TYPE first_num;
INMOST_DATA_ENUM_TYPE last_num;
Mesh * m;
public:
Automatizator(Mesh * m);
Automatizator();
~Automatizator();
__INLINE INMOST_DATA_ENUM_TYPE GetFirstIndex() { return first_num; }
__INLINE INMOST_DATA_ENUM_TYPE GetLastIndex() { return last_num; }
......@@ -157,19 +156,16 @@ namespace INMOST
/// Don't register tag twice.
/// \todo
/// Read comments inside, change merger.Resize() behavior.
INMOST_DATA_ENUM_TYPE RegisterDynamicTag(Tag t, ElementType typemask, MarkerType domain_mask = 0);
INMOST_DATA_ENUM_TYPE RegisterTag(Tag t, ElementType typemask, MarkerType domain_mask = 0);
/// Set index for every data entry of dynamic tag.
void EnumerateDynamicTags();
__INLINE Tag GetDynamicValueTag(INMOST_DATA_ENUM_TYPE ind) { return reg_tags[ind].d.t; }
__INLINE Tag GetDynamicIndexTag(INMOST_DATA_ENUM_TYPE ind) { return reg_tags[ind].indices; }
__INLINE MarkerType GetDynamicMask(INMOST_DATA_ENUM_TYPE ind) { return reg_tags[ind].d.domain_mask; }
__INLINE INMOST_DATA_REAL_TYPE GetDynamicValue(const Storage & e, INMOST_DATA_ENUM_TYPE ind, INMOST_DATA_ENUM_TYPE comp = 0) { return e->RealArray(GetDynamicValueTag(ind))[comp]; }
__INLINE INMOST_DATA_ENUM_TYPE GetDynamicIndex(const Storage & e, INMOST_DATA_ENUM_TYPE ind, INMOST_DATA_ENUM_TYPE comp = 0) { return e->IntegerArray(GetDynamicIndexTag(ind))[comp]; }
__INLINE bool isDynamicValid(const Storage & e, INMOST_DATA_ENUM_TYPE ind) { MarkerType mask = GetDynamicMask(ind); return mask == 0 || e->GetMarker(mask); }
__INLINE INMOST_DATA_REAL_TYPE GetIndex(const Storage & e, INMOST_DATA_ENUM_TYPE tagind, INMOST_DATA_ENUM_TYPE comp = 0) { return e->IntegerArray(GetDynamicIndexTag(tagind))[comp]; }
__INLINE INMOST_DATA_ENUM_TYPE GetComponents(const Storage & e, INMOST_DATA_ENUM_TYPE tagind) { return static_cast<INMOST_DATA_ENUM_TYPE>(e->IntegerArray(GetDynamicIndexTag(tagind)).size()); }
__INLINE Mesh * GetMesh() { return m; }
Sparse::RowMerger & GetMerger()
void EnumerateTags();
__INLINE Tag GetValueTag(INMOST_DATA_ENUM_TYPE ind) { return reg_tags[ind].d.t; }
__INLINE Tag GetIndexTag(INMOST_DATA_ENUM_TYPE ind) { return reg_tags[ind].indices; }
__INLINE MarkerType GetMask(INMOST_DATA_ENUM_TYPE ind) { return reg_tags[ind].d.domain_mask; }
__INLINE INMOST_DATA_REAL_TYPE GetValue(const Storage & e, INMOST_DATA_ENUM_TYPE ind, INMOST_DATA_ENUM_TYPE comp = 0) { return e->RealArray(GetValueTag(ind))[comp]; }
__INLINE INMOST_DATA_ENUM_TYPE GetIndex(const Storage & e, INMOST_DATA_ENUM_TYPE ind, INMOST_DATA_ENUM_TYPE comp = 0) { return e->IntegerArray(GetIndexTag(ind))[comp]; }
__INLINE bool isValid(const Storage & e, INMOST_DATA_ENUM_TYPE ind) { MarkerType mask = GetMask(ind); return mask == 0 || e->GetMarker(mask); }
Sparse::RowMerger & GetMerger()
{
#if defined(USE_OMP)
return merger[omp_get_thread_num()];
......
This diff is collapsed.
This diff is collapsed.
......@@ -262,9 +262,9 @@ namespace INMOST
{
if( pregval != ENUMUNDEF )
{
mask = aut.GetDynamicMask(pregval);
value_tag = aut.GetDynamicValueTag(pregval);
index_tag = aut.GetDynamicIndexTag(pregval);
mask = aut.GetMask(pregval);
value_tag = aut.GetValueTag(pregval);
index_tag = aut.GetIndexTag(pregval);
}
}
dynamic_variable(const dynamic_variable & other) : aut(other.aut), index_tag(other.index_tag), value_tag(other.value_tag), mask(other.mask), comp(other.comp) {}
......
......@@ -79,17 +79,13 @@ add_test(NAME solver_test000_parallel_normal_inner_ddpqiluc COMMAND ${MPIEX
add_test(NAME solver_test000_parallel_permute1_inner_ddpqiluc COMMAND ${MPIEXEC} -np 4 $<TARGET_FILE:solver_test000> 1 1)
add_test(NAME solver_test000_parallel_permute2_inner_ddpqiluc COMMAND ${MPIEXEC} -np 4 $<TARGET_FILE:solver_test000> 2 1)
if( HAVE_SOLVER_MPTILUC2 )
add_test(NAME solver_test000_parallel_normal_inner_mptiluc COMMAND ${MPIEXEC} -np 4 $<TARGET_FILE:solver_test000> 0 8)
add_test(NAME solver_test000_parallel_permute1_inner_mptiluc COMMAND ${MPIEXEC} -np 4 $<TARGET_FILE:solver_test000> 1 8)
add_test(NAME solver_test000_parallel_permute2_inner_mptiluc COMMAND ${MPIEXEC} -np 4 $<TARGET_FILE:solver_test000> 2 8)
endif()
if( HAVE_SOLVER_MPTILU2 )
add_test(NAME solver_test000_parallel_normal_inner_mptilu2 COMMAND ${MPIEXEC} -np 4 $<TARGET_FILE:solver_test000> 0 9)
add_test(NAME solver_test000_parallel_permute1_inner_mptilu2 COMMAND ${MPIEXEC} -np 4 $<TARGET_FILE:solver_test000> 1 9)
add_test(NAME solver_test000_parallel_permute2_inner_mptilu2 COMMAND ${MPIEXEC} -np 4 $<TARGET_FILE:solver_test000> 2 9)
endif()
if(USE_SOLVER_PETSC)
add_test(NAME solver_test000_parallel_normal_petsc COMMAND ${MPIEXEC} -np 4 $<TARGET_FILE:solver_test000> 0 2)
......
......@@ -72,12 +72,8 @@ if( USE_MPI )
if( EXISTS ${MPIEXEC} )
add_test(NAME solver_test002_parallel_inner_ilu2 COMMAND ${MPIEXEC} -np 4 $<TARGET_FILE:solver_test002> 0 20)
add_test(NAME solver_test002_parallel_inner_ddpqiluc COMMAND ${MPIEXEC} -np 4 $<TARGET_FILE:solver_test002> 1 20)
if(HAVE_SOLVER_MPTILUC2)
add_test(NAME solver_test002_parallel_inner_mptiluc COMMAND ${MPIEXEC} -np 4 $<TARGET_FILE:solver_test002> 2 20)
endif()
if(HAVE_SOLVER_MPTILU2)
add_test(NAME solver_test002_parallel_inner_mptilu2 COMMAND ${MPIEXEC} -np 4 $<TARGET_FILE:solver_test002> 3 20)
endif()
if(USE_SOLVER_TRILINOS)
add_test(NAME solver_test002_parallel_trilinos_aztec COMMAND ${MPIEXEC} -np 4 $<TARGET_FILE:solver_test002> 4 20)
......
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