Added: A dedicated domain-decomposition helper class.

This administers the parallel finite element model.
- establishes global node numbers
- establishes global equation numbers
- establishes global DOF numbers
- generates subdomains for schwarz preconditioners
  (if using multiple subdomains for each patch)
This commit is contained in:
Arne Morten Kvarving 2016-07-01 14:03:04 +02:00 committed by Knut Morten Okstad
parent 78d7f3d818
commit cad3a7929f
262 changed files with 6003 additions and 32 deletions

View File

@ -153,6 +153,7 @@ else()
src/ASM/Integrand.h src/ASM/Lagrange.h
src/ASM/LocalIntegral.h src/ASM/SAMpatch.h
src/ASM/TimeDomain.h src/ASM/ASMs?D.h src/ASM/ASM?D.h
src/ASM/DomainDecomposition.h
src/LinAlg/*.h src/SIM/*.h
src/Utility/*.h
${CMAKE_BINARY_DIR}/IFEM.h)

View File

@ -1,20 +1,17 @@
# Get GTest tests as CMake tests.
# Copied from FindGTest.cmake
# Thanks to Daniel Blezek <blezek@gmail.com> for the GTEST_ADD_TESTS code
function(gtest_add_tests executable working_dir)
if(NOT ARGN)
message(FATAL_ERROR "Missing ARGN: Read the documentation for GTEST_ADD_TESTS")
endif()
function(gtest_add_tests executable working_dir source_var)
if(NOT UNIT_TEST_NUMBER)
set(UNIT_TEST_NUMBER 0 CACHE INT "" FORCE)
endif()
foreach(source ${ARGN})
foreach(source ${${source_var}})
file(READ "${source}" contents)
string(REGEX MATCHALL "TEST_?[F]?\\(([A-Za-z_0-9 ,]+)\\)" found_tests ${contents})
foreach(hit ${found_tests})
string(REGEX REPLACE ".*\\( *([A-Za-z_0-9]+), *([A-Za-z_0-9]+) *\\).*" "\\1.\\2" test_name ${hit})
math(EXPR UNIT_TEST_NUMBER "${UNIT_TEST_NUMBER}+1")
set(UNIT_TEST${UNIT_TEST_NUMBER} ${test_name} ${working_dir} ${executable} --gtest_filter=${test_name} CACHE STRING "" FORCE)
set(UNIT_TEST${UNIT_TEST_NUMBER} ${test_name} ${working_dir} ${ARGN} ${executable} --gtest_filter=${test_name} CACHE STRING "" FORCE)
endforeach()
# Groups parametrized tests under a single ctest entry
string(REGEX MATCHALL "INSTANTIATE_TEST_CASE_P\\(([^,]+), *([^,]+)" found_tests2 ${contents})
@ -24,8 +21,16 @@ function(gtest_add_tests executable working_dir)
list(GET test_name 0 filter_name)
list(GET test_name 1 test_prefix)
string(STRIP ${test_prefix} test_prefix)
math(EXPR UNIT_TEST_NUMBER "${UNIT_TEST_NUMBER}+1")
set(UNIT_TEST${UNIT_TEST_NUMBER} ${test_prefix}.${filter_name} ${working_dir} ${executable} --gtest_filter=${filter_name}* CACHE STRING "" FORCE)
string(REGEX MATCHALL "TEST_P\\(${test_prefix},([^\\)]+)\\)" found_tests3 ${contents})
foreach(ghit ${found_tests3})
string(SUBSTRING ${ghit} 8 -1 ghit_name)
string(REPLACE "," ";" ghit_name "${ghit_name}")
list(GET ghit_name 1 ghit_tname)
string(STRIP ${ghit_tname} ghit_tname)
string(REPLACE ")" "" ghit_tname "${ghit_tname}")
math(EXPR UNIT_TEST_NUMBER "${UNIT_TEST_NUMBER}+1")
set(UNIT_TEST${UNIT_TEST_NUMBER} ${test_prefix}.${ghit_tname} ${working_dir} ${ARGN} ${executable} --gtest_filter=*${filter_name}.${ghit_tname}/* CACHE STRING "" FORCE)
endforeach()
endforeach()
endforeach()
set(UNIT_TEST_NUMBER ${UNIT_TEST_NUMBER} PARENT_SCOPE)
@ -39,7 +44,7 @@ macro(IFEM_add_test_app path workdir name)
set(TEST_SRCS ${path})
endif()
add_executable(${name}-test EXCLUDE_FROM_ALL ${IFEM_PATH}/src/IFEM-test.C ${TEST_SRCS})
gtest_add_tests($<TARGET_FILE:${name}-test> ${workdir} ${TEST_SRCS})
gtest_add_tests($<TARGET_FILE:${name}-test> ${workdir} TEST_SRCS)
list(APPEND TEST_APPS ${name}-test)
target_link_libraries(${name}-test ${ARGN} gtest pthread)
endmacro()
@ -49,6 +54,17 @@ macro(IFEM_add_unittests IFEM_PATH)
${IFEM_PATH}
IFEM
${IFEM_LIBRARIES} ${IFEM_DEPLIBS})
# Parallel unit tests. These all run with 4 processes.
if(MPI_FOUND)
set(TEST_SRCS_MPI ${IFEM_PATH}/src/ASM/Test/MPI/TestDomainDecomposition.C)
add_executable(IFEM-MPI-test EXCLUDE_FROM_ALL
${IFEM_PATH}/src/IFEM-test.C ${TEST_SRCS_MPI})
target_link_libraries(IFEM-MPI-test ${IFEM_LIBRARIES} ${IFEM_DEPLIBS} gtest)
gtest_add_tests($<TARGET_FILE:IFEM-MPI-test> ${IFEM_PATH} TEST_SRCS_MPI
${MPIEXEC} -np 4)
list(APPEND TEST_APPS IFEM-MPI-test)
endif()
endmacro()
function(IFEM_add_test name binary)
@ -78,11 +94,13 @@ macro(add_check_target)
foreach(test_number RANGE 1 ${UNIT_TEST_NUMBER})
list(GET UNIT_TEST${test_number} 0 name)
list(GET UNIT_TEST${test_number} 1 dir)
list(GET UNIT_TEST${test_number} 2 -1 cmd)
list(REMOVE_AT UNIT_TEST${test_number} 0 1)
if(IFEM_TEST_MEMCHECK)
set(cmd ${MEMCHECK_COMMAND} ${cmd})
endif()
add_test(NAME ${name} WORKING_DIRECTORY ${dir} COMMAND ${cmd})
add_test(NAME ${name}
COMMAND ${UNIT_TEST${test_number}}
WORKING_DIRECTORY ${dir})
endforeach()
endif()
add_dependencies(check ${TEST_APPS})

View File

@ -0,0 +1,781 @@
// $Id$
//==============================================================================
//!
//! \file DomainDecomposition.C
//!
//! \date Feb 23 2016
//!
//! \author Arne Morten Kvarving / SINTEF
//!
//! \brief Domain decomposition partitioning for structured models.
//!
//==============================================================================
#include "DomainDecomposition.h"
#include "ASMbase.h"
#include "ASMstruct.h"
#include "LinSolParams.h"
#include "ProcessAdm.h"
#include "SAMpatch.h"
#include "SIMbase.h"
#include "IFEM.h"
#include "Utilities.h"
#include <cassert>
#include <numeric>
#include <iostream>
//! \brief Iterator for matching nodes on edges/faces with a given orientation and index.
class NodeIterator {
public:
//! \brief Constructor.
//! \param pch Slave patch
//! \param orient Orientation of boundary on slave
//! \param lIdx Index of boundary on slave
//! \param basis Basis to use for boundary on slave
NodeIterator(const ASMstruct* pch, int orient, int lIdx, int basis)
{
int n1, n2, n3;
pch->getSize(n1,n2,n3,basis);
int nsd = pch->getNoSpaceDim();
if (nsd == 3) {
int dim1, dim2;
if (lIdx == 1 || lIdx == 2)
dim1 = n2, dim2 = n3;
else if (lIdx == 3 || lIdx == 4)
dim1 = n1, dim2 = n3;
else //if (lIdx == 5 || lIdx == 6)
dim1 = n1, dim2 = n2;
nodes.resize(dim1*dim2);
typedef std::function<std::pair<int,int>(int dim1, int dim2, int n)> NodeOrder;
#define PAIR(x, y) [](int dim1, int dim2, int n) { return std::make_pair(x,y); }
const std::vector<NodeOrder> orders = {PAIR(n*dim1, 1), // 0 1 2 3 4 5 6 7 8
PAIR((dim2-n-1)*dim1, 1), // 6 7 8 3 4 5 0 1 2
PAIR((n+1)*dim1-1, -1), // 2 1 0 5 4 3 8 7 6
PAIR(dim1*dim2-n*dim1-1, -1), // 8 7 6 5 4 3 2 1 0
PAIR(n, dim1), // 0 3 6 1 4 7 2 5 8
PAIR(dim2-n-1, dim1), // 2 5 8 1 4 7 0 3 6
PAIR((dim2-1)*dim1+n, -dim1), // 6 3 0 7 4 1 8 5 2
PAIR(dim2*dim1-n-1, -dim1)}; // 8 5 2 7 4 1 6 3 0
#undef PAIR
auto it = nodes.begin();
for (int n = 0; n < dim2; ++n) {
auto order = orders[orient](dim1, dim2, n);
for (int i = 0; i < dim1; ++i, ++it, order.first += order.second)
*it = order.first;
}
} else {
if (lIdx == 1 || lIdx == 2)
nodes.resize(n2);
else
nodes.resize(n1);
if (orient == 0)
std::iota(nodes.begin(), nodes.end(), 0);
else
std::iota(nodes.rbegin(), nodes.rend(), 0);
}
}
//! \brief Obtain start of node numbers.
std::vector<int>::const_iterator begin() { return nodes.begin(); }
//! \brief Obtain end of node numbers.
std::vector<int>::const_iterator end() { return nodes.end(); }
//! \brief Obtain number of nodes
size_t size() const { return nodes.size(); }
protected:
//! \brief Node number on boundary.
std::vector<int> nodes;
};
std::vector<std::set<int>> DomainDecomposition::getSubdomains(int nx, int ny, int nz,
int overlap, size_t block) const
{
std::vector<IntSet> result(nx*(ny?ny:1)*(nz?nz:1)*getSAM()->getNoPatches());
size_t d = 0;
for (const auto& it : *getSAM()) {
const ASMstruct* pch = dynamic_cast<const ASMstruct*>(it);
if (!pch)
break;
int n1, n2, n3;
pch->getNoStructElms(n1,n2,n3);
auto subdomains = calcSubdomains(n1, n2, n3, nx, ny, nz, overlap);
for (size_t g = 0; g < subdomains.size(); ++g, ++d) {
for (const int& iEl : subdomains[g]) {
if (getNoBlocks() == 0) {
IntVec eqns;
int el = it->getElmID(iEl+1);
if (el == 0)
continue;
getSAM()->getElmEqns(eqns, el);
for (auto& it : eqns) {
if (it > 0)
result[d].insert(it);
}
} else {
IntVec nodes;
getSAM()->getElmNodes(nodes, it->getElmID(iEl+1));
int basis = blocks[block+1].basis;
for (auto& node : nodes) {
char type = getSAM()->getNodeType(node);
if (type == (basis == 1 ? 'D' : 'P'+basis-2) || (type == ' ' && basis < 2)) {
IntVec eqns;
getSAM()->getNodeEqns(eqns, node);
for (auto& it : eqns) {
if (it > 0) {
auto geq = blocks[block+1].G2LEQ.find(it);
result[d].insert(geq->second);
}
}
}
}
}
}
}
}
return result;
}
std::vector<std::vector<int>> DomainDecomposition::calcSubdomains(size_t nel1, size_t nel2, size_t nel3,
size_t g1, size_t g2, size_t g3, size_t overlap)
{
if (nel3 > 0)
return calcSubdomains3D(nel1, nel2, nel3, g1, g2, g3, overlap);
else if (nel2 > 0)
return calcSubdomains2D(nel1, nel2, g1, g2, overlap);
else
return calcSubdomains1D(nel1, g1, overlap);
}
std::vector<IntVec> DomainDecomposition::calcSubdomains1D(size_t nel1, size_t g1, size_t overlap)
{
std::vector<IntVec> subdomains;
if (g1 == 1)
{
subdomains.resize(1);
subdomains[0].resize(nel1);
std::iota(subdomains[0].begin(),subdomains[0].end(),0);
}
else
{
size_t nel1_sub = floor(double(nel1)/g1 + 1);
subdomains.resize(g1);
size_t ofs1 = 0;
for (size_t gu = 0; gu < g1; ++gu) {
if (gu == g1 - 1)
nel1_sub = nel1 - ofs1;
subdomains[gu].reserve(nel1_sub);
for (size_t i = 0; i < nel1_sub && ofs1 + i < nel1; ++i)
subdomains[gu].push_back(ofs1 + i);
ofs1 += nel1_sub - overlap;
}
}
return subdomains;
}
std::vector<IntVec> DomainDecomposition::calcSubdomains2D(size_t nel1, size_t nel2,
size_t g1, size_t g2, size_t overlap)
{
std::vector<IntVec> subdomains;
if (g1*g2 == 1)
{
subdomains.resize(1);
subdomains[0].resize(nel1*nel2);
std::iota(subdomains[0].begin(),subdomains[0].end(),0);
}
else
{
size_t nel2_sub = floor(double(nel2)/g2 + 1);
subdomains.resize(g1*g2);
size_t g = 0;
size_t ofs2 = 0;
for (size_t gv = 0; gv < g2; ++gv) {
if (gv == g2 - 1)
nel2_sub = nel2 - ofs2;
size_t nel1_sub = floor(double(nel1)/g1 + 1);
size_t ofs1 = 0;
for (size_t gu = 0; gu < g1; ++gu, ++g) {
if (gu == g1 - 1)
nel1_sub = nel1-ofs1;
subdomains[g].reserve(nel1_sub*nel2_sub);
for (size_t j = 0; j < nel2_sub && ofs2 + j < nel2; ++j)
for (size_t i = 0; i < nel1_sub && ofs1 + i < nel1; ++i)
subdomains[g].push_back((ofs2+j)*nel1 + ofs1 + i);
ofs1 += nel1_sub - overlap;
}
ofs2 += nel2_sub - overlap;
}
}
return subdomains;
}
std::vector<IntVec> DomainDecomposition::calcSubdomains3D(size_t nel1, size_t nel2, size_t nel3,
size_t g1, size_t g2, size_t g3, size_t overlap)
{
std::vector<IntVec> subdomains;
if (g1*g2*g3 == 1)
{
subdomains.resize(1);
subdomains[0].resize(nel1*nel2*nel3);
std::iota(subdomains[0].begin(),subdomains[0].end(),0);
}
else
{
subdomains.resize(g1*g2*g3);
size_t g = 0;
size_t ofs3 = 0;
size_t nel3_sub = floor(double(nel3)/g3+1);
for (size_t gw = 0; gw < g3; ++gw) {
if (gw == g3 - 1)
nel3_sub = nel3-ofs3;
size_t ofs2 = 0;
size_t nel2_sub = floor(double(nel2)/g2+1);
for (size_t gv = 0; gv < g2; ++gv) {
if (gv == g2 - 1)
nel2_sub = nel2-ofs2;
size_t ofs1 = 0;
size_t nel1_sub = floor(double(nel1)/g1+1);
for (size_t gu = 0; gu < g1; ++gu, ++g) {
if (gu == g1 - 1)
nel1_sub = nel1-ofs1;
subdomains[g].reserve(nel1_sub*nel2_sub*nel3_sub);
for (size_t k = 0; k < nel3_sub && ofs3 + k < nel3; ++k)
for (size_t j = 0; j < nel2_sub && ofs2 + j < nel2; ++j)
for (size_t i = 0; i < nel1_sub && ofs1 + i < nel1; ++i)
subdomains[g].push_back((ofs3 + k)*nel1*nel2 + (ofs2+j)*nel1 + ofs1 + i);
ofs1 += nel1_sub - overlap;
}
ofs2 += nel2_sub - overlap;
}
ofs3 += nel3_sub - overlap;
}
}
return subdomains;
}
bool DomainDecomposition::calcGlobalNodeNumbers(const ProcessAdm& adm,
const SIMbase& sim)
{
minDof = minNode = 1;
maxDof = sim.getSAM()->getNoDOFs();
maxNode = sim.getSAM()->getNoNodes();
#ifdef HAVE_MPI
if (adm.getNoProcs() == 1)
return true;
IFEM::cout << "\tEstablishing global node numbers" << std::endl;
minDof = 1;
maxDof = sim.getSAM()->getNoDOFs();
minNode = 1;
maxNode = sim.getSAM()->getNoNodes();
if (adm.getProcId() > 0) {
adm.receive(minNode, adm.getProcId()-1);
adm.receive(minDof, adm.getProcId()-1);
maxDof = minDof++;
maxNode = minNode++;
}
MLGN.resize(sim.getSAM()->getNoNodes());
std::iota(MLGN.begin(), MLGN.end(), minNode);
std::map<int,int> old2new;
for (const auto& it : ghostConnections) {
int sidx = sim.getLocalPatchIndex(it.slave);
if (sidx < 1)
continue;
IntVec lNodes;
sim.getPatch(sidx)->getBoundaryNodes(it.sidx, lNodes);
int nRecv;
adm.receive(nRecv, getPatchOwner(it.master));
if (nRecv =! lNodes.size()) {
std::cerr <<"\n *** DomainDecomposition::calcGlobalNodeNumbers(): "
<<" Topology error, boundary size "
<< nRecv << ", expected " << lNodes.size() << std::endl;
return false;
}
IntVec glbNodes(lNodes.size());
adm.receive(glbNodes, getPatchOwner(it.master));
size_t ofs = 0;
for (size_t b = 1; b <= sim.getPatch(sidx)->getNoBasis(); ++b) {
NodeIterator iter(dynamic_cast<const ASMstruct*>(sim.getPatch(sidx)),
it.orient, it.sidx, b);
auto it_n = iter.begin();
for (size_t i = 0; i < iter.size(); ++i, ++it_n) {
int node = MLGN[lNodes[i+ofs]-1];
old2new[node] = glbNodes[*it_n + ofs];
}
ofs += iter.size();
}
}
// remap ghost nodes
for (auto& it : MLGN)
utl::renumber(it, old2new, false);
// remap rest of our nodes
for (int i = 0; i < sim.getSAM()->getNoNodes() && adm.getProcId() != 0; ++i)
if (old2new.find(i + minNode) == old2new.end()) {
std::map<int,int> old2new2;
old2new2[i + minNode] = ++maxNode;
auto dof = sim.getSAM()->getNodeDOFs(i);
maxDof += dof.second-dof.first+1;
for (auto& it : MLGN)
utl::renumber(it, old2new2, false);
}
if (adm.getProcId() < adm.getNoProcs()-1) {
adm.send(maxNode, adm.getProcId()+1);
adm.send(maxDof, adm.getProcId()+1);
}
for (const auto& it : ghostConnections) {
int midx = sim.getLocalPatchIndex(it.master);
if (midx < 1)
continue;
std::vector<int> glbNodes;
sim.getPatch(midx)->getBoundaryNodes(it.midx, glbNodes);
for (size_t i = 0; i < glbNodes.size(); ++i)
glbNodes[i] = MLGN[glbNodes[i]-1];
adm.send(int(glbNodes.size()), getPatchOwner(it.slave));
adm.send(glbNodes, getPatchOwner(it.slave));
}
#endif
return true;
}
std::vector<int> DomainDecomposition::setupEquationNumbers(const SIMbase& sim,
int pidx, int lidx)
{
std::vector<IntVec> lNodes(sim.getPatch(pidx)->getNoBasis());
std::vector<int> result;
for (size_t block = 0; block < blocks.size(); ++block) {
std::set<int> bases;
if (block == 0) {
for (size_t i = 1; i <= sim.getPatch(pidx)->getNoBasis(); ++i)
bases.insert(i);
} else
bases = utl::getDigits(sim.getSolParams()->getBlock(block-1).basis);
for (const int& basis : bases) {
if (lNodes[basis-1].empty())
sim.getPatch(pidx)->getBoundaryNodes(lidx, lNodes[basis-1], basis);
std::set<int> components;
if (block == 0 || sim.getSolParams()->getBlock(block-1).comps == 0) {
for (size_t i = 1; i <= sim.getPatch(pidx)->getNoFields(basis); ++i)
components.insert(i);
} else
components = utl::getDigits(sim.getSolParams()->getBlock(block-1).comps);
for (size_t i = 0; i < lNodes[basis-1].size(); ++i) {
int node = lNodes[basis-1][i];
for (const int& dof : components) {
int eq = sim.getSAM()->getEquation(node, dof);
if (eq > 0) {
if (block == 0)
result.push_back(blocks[block].MLGEQ[eq-1]);
else
result.push_back(blocks[block].MLGEQ[blocks[block].G2LEQ[eq]-1]);
} else
result.push_back(0);
}
}
}
}
return result;
}
bool DomainDecomposition::calcGlobalEqNumbers(const ProcessAdm& adm,
const SIMbase& sim)
{
// defaults in serial and non-parallel runs with MPI enabled builds.
blocks[0].minEq = 1;
blocks[0].maxEq = sim.getSAM()->getNoEquations();
for (size_t i = 1; i < blocks.size(); ++i) {
blocks[i].minEq = 1;
blocks[i].maxEq = blocks[i].localEqs.size();
}
#ifdef HAVE_MPI
if (adm.getNoProcs() == 1)
return true;
IFEM::cout << "\tEstablishing global equation numbers" << std::endl;
std::vector<int> locLMs;
for (size_t n = 1; n <= sim.getPatch(1)->getNoNodes(); ++n) {
if (sim.getPatch(1)->getLMType(n) == 'G')
locLMs.push_back(n);
}
std::vector<int> glbLMs;
std::vector<int> blkLMs;
std::vector<int> nEqs(blocks.size());
if (adm.getProcId() > 0) {
adm.receive(nEqs, adm.getProcId()-1);
int nLMs;
adm.receive(nLMs, adm.getProcId()-1);
if (locLMs.size() != (size_t)nLMs) {
std::cerr <<"\n *** DomainDecomposition::calcGlobalEqNumbers():"
<<" Non-matching number of multipliers "
<< nLMs << ", expected " << locLMs.size() << std::endl;
return false;
}
glbLMs.resize(nLMs);
adm.receive(glbLMs, adm.getProcId()-1);
// HACK: multipliers always in second block
if (blocks.size() > 1) {
blkLMs.resize(nLMs);
adm.receive(blkLMs, adm.getProcId()-1);
}
}
for (size_t block = 0; block < blocks.size(); ++block) {
size_t size = block == 0 ? sim.getSAM()->getNoEquations() :
blocks[block].localEqs.size();
blocks[block].MLGEQ.resize(size);
std::iota(blocks[block].MLGEQ.begin(),
blocks[block].MLGEQ.end(), nEqs[block]+1);
if (adm.getProcId() > 0) {
blocks[block].minEq = nEqs[block]+1;
blocks[block].maxEq = nEqs[block];
} else {
blocks[block].minEq = 1;
blocks[block].maxEq = size;
}
}
std::vector<std::map<int,int>> old2new(blocks.size());
std::vector<std::vector<bool>> o2nu(blocks.size()); // flat vector cache
for (size_t block = 0; block < o2nu.size(); ++block)
if (block == 0)
o2nu[block].resize(sim.getSAM()->getNoEquations(), false);
else
o2nu[block].resize(adm.dd.getBlockEqs(block-1).size(), false);
size_t n = 0;
auto blockIt = blkLMs.begin();
for (const auto& it : glbLMs) {
int seq = sim.getSAM()->getEquation(sim.getPatch(1)->getNodeID(locLMs[n++]), 1);
int leq = blocks[0].MLGEQ[seq-1];
old2new[0][leq] = it;
o2nu[0][leq-nEqs[0]-1] = true;
if (blocks.size() > 1 && !blkLMs.empty()) {
int leq = blocks[2].MLGEQ[blocks[2].G2LEQ[seq]-1];
old2new[2][leq] = *blockIt;
o2nu[2][leq-nEqs[2]-1] = true;
++blockIt;
}
}
for (const auto& it : ghostConnections) {
int sidx = sim.getLocalPatchIndex(it.slave);
if (sidx < 1)
continue;
IntVec locEqs = setupEquationNumbers(sim, sidx, it.sidx);
int nRecv;
adm.receive(nRecv, getPatchOwner(it.master));
if (nRecv != (int)locEqs.size()) {
std::cerr <<"\n *** DomainDecomposition::calcGlobalEqNumbers():"
<<" Topology error, number of equations "
<< nRecv << ", expected " << locEqs.size() << std::endl;
return false;
}
IntVec glbEqs(locEqs.size());
adm.receive(glbEqs, getPatchOwner(it.master));
size_t ofs = 0;
for (size_t block = 0; block < blocks.size(); ++block) {
std::set<int> bases;
if (block == 0) {
for (size_t i = 1; i <= sim.getPatch(sidx)->getNoBasis(); ++i)
bases.insert(i);
} else
bases = utl::getDigits(sim.getSolParams()->getBlock(block-1).basis);
for (const int& basis : bases) {
std::set<int> components;
if (block == 0 || sim.getSolParams()->getBlock(block-1).comps == 0) {
for (size_t i = 1; i <= sim.getPatch(sidx)->getNoFields(basis); ++i)
components.insert(i);
} else
components = utl::getDigits(sim.getSolParams()->getBlock(block-1).comps);
NodeIterator iter(dynamic_cast<const ASMstruct*>(sim.getPatch(sidx)),
it.orient, it.sidx, basis);
auto it_n = iter.begin();
int nodeDofs = components.size();
for (size_t i = 0; i < iter.size(); ++i, ++it_n) {
for (size_t comp = 0; comp < components.size(); ++comp) {
int leq = locEqs[ofs+i*nodeDofs+comp];
int geq = glbEqs[ofs+(*it_n)*nodeDofs+comp];
if (leq < 1 && geq > 0) {
std::cerr <<"\n *** DomainDecomposition::calcGlobalNodeNumbers(): "
<< "Topology error on process " << adm.getProcId()
<< ", dof constraint mismatch "
<< "local: " << leq << " global " << geq << std::endl;
return false;
}
if (leq < 1)
continue;
old2new[block][leq] = geq;
o2nu[block][leq-nEqs[block]-1] = true;
}
}
ofs += iter.size()*nodeDofs;
}
}
}
for (size_t block = 0; block < blocks.size() && adm.getProcId() > 0; ++block) {
// remap ghost equations
for (auto& it : blocks[block].MLGEQ)
utl::renumber(it, old2new[block], false);
// remap the rest of our equations
size_t size = block == 0 ? sim.getSAM()->getNoEquations() :
blocks[block].localEqs.size();
std::map<int,int> old2new2;
for (size_t i = 1; i <= size; ++i) {
if (!o2nu[block][i-1])
old2new2[i + nEqs[block]] = ++blocks[block].maxEq;
}
for (auto& it : blocks[block].MLGEQ)
utl::renumber(it, old2new2, false);
}
if (adm.getProcId() < adm.getNoProcs()-1) {
std::vector<int> maxEqs;
for (auto& it : blocks)
maxEqs.push_back(it.maxEq);
adm.send(maxEqs, adm.getProcId()+1);
std::vector<int> LM;
size_t nMult = 0;
for (size_t n = 0; n < locLMs.size(); ++n) {
// TODO: > 1 dof for multipliers
int eq = sim.getSAM()->getEquation(sim.getPatch(1)->getNodeID(locLMs[n]), 1);
if (eq > 0)
LM.push_back(blocks[0].MLGEQ[eq-1]), ++nMult;
}
adm.send((int)LM.size(), adm.getProcId()+1);
adm.send(LM, adm.getProcId()+1);
// HACK: multipliers always in second block
LM.clear();
if (blocks.size() > 1) {
for (size_t i = 0; i < nMult; ++i)
LM.push_back(blocks[2].MLGEQ[blocks[2].MLGEQ.size()-nMult+i]);
adm.send(LM, adm.getProcId()+1);
}
}
for (const auto& it : ghostConnections) {
int midx = sim.getLocalPatchIndex(it.master);
if (midx < 1)
continue;
IntVec glbEqs = setupEquationNumbers(sim, midx, it.midx);
adm.send(int(glbEqs.size()), getPatchOwner(it.slave));
adm.send(glbEqs, getPatchOwner(it.slave));
}
#endif
return true;
}
int DomainDecomposition::getGlobalEq(int lEq, size_t idx) const
{
if (lEq < 1 || idx >= blocks.size())
return 0;
if (blocks[0].MLGEQ.empty()) { // serial
if (lEq > blocks[idx].maxEq)
return 0;
return lEq;
}
if (!blocks[idx].MLGEQ.empty() && lEq > (int)blocks[idx].MLGEQ.size())
return 0;
return blocks[idx].MLGEQ[lEq-1];
}
bool DomainDecomposition::setup(const ProcessAdm& adm, const SIMbase& sim)
{
#ifdef HAVE_MPI
if (adm.isParallel()) {
IFEM::cout << "Establishing domain decomposition" << std::endl;
#if SP_DEBUG > 1
IFEM::cout << " Ghost connections:\n";
for (const auto& it : ghostConnections) {
IFEM::cout << " Interface: master/idx=" << it.master << "/" << it.midx <<
", slave/idx=" << it.slave << "/" << it.sidx <<
", orient=" << it.orient << ", dim=" << it.dim <<
", basis=" << it.basis << std::endl;
#endif
}
#endif
sam = dynamic_cast<const SAMpatch*>(sim.getSAM());
int ok = 1;
// Establish global node numbers
if (!calcGlobalNodeNumbers(adm, sim))
ok = 0;
// sanity check the established domain decomposition
if (getMinNode() > getMaxNode()) {
std::cerr << "**DomainDecomposition::setup ** Process "
<< adm.getProcId() << " owns no nodes." << std::endl;
ok = 0;
}
#ifdef HAVE_MPI
int lok = ok;
MPI_Allreduce(&lok, &ok, 1, MPI_INT, MPI_SUM, *adm.getCommunicator());
#endif
if (ok < adm.getNoProcs())
return false;
ok = 1;
// Establish local equation mappings for each block.
if (sim.getSolParams() && sim.getSolParams()->getNoBlocks() > 1) {
IFEM::cout << "\tEstablishing local block equation numbers" << std::endl;
const LinSolParams& solParams = *sim.getSolParams();
blocks.resize(solParams.getNoBlocks()+1);
// Find local equations for each block
for (size_t i = 0; i < solParams.getNoBlocks(); ++i) {
// grab DOFs of given type(s)
blocks[i+1].basis = solParams.getBlock(i).basis;
blocks[i+1].components = solParams.getBlock(i).comps;
char dofType = blocks[i+1].basis == 1 ? 'D' : 'P'+blocks[i+1].basis-2;
if (solParams.getBlock(i).comps != 0) {
std::set<int> comps = utl::getDigits(solParams.getBlock(i).comps);
for (auto& c : comps) {
std::set<int> tmp = sam->getEquations(dofType, c);
blocks[i+1].localEqs.insert(tmp.begin(), tmp.end());
}
} else {
std::set<int> bases = utl::getDigits(blocks[i+1].basis);
for (auto& b : bases) {
int cb = b;
dofType = cb == 1 ? 'D' : 'P'+cb-2;
std::set<int> tmp = adm.dd.getSAM()->getEquations(dofType);
blocks[i+1].localEqs.insert(tmp.begin(), tmp.end());
// HACK: multipliers always in second block
// Correct thing to do for average pressure constraint in Stokes.
if (i == 1) {
for (size_t n = 1; n <= sim.getPatch(1)->getNoNodes(); ++n) {
if (sim.getPatch(1)->isLMn(n) && sim.getPatch(1)->getLMType(n) == 'G') {
int lEq = sam->getEquation(sim.getPatch(1)->getNodeID(n), 1);
if (lEq > 0)
blocks[i+1].localEqs.insert(lEq);
}
}
}
}
}
size_t idx = 1;
for (auto& it : blocks[i+1].localEqs)
blocks[i+1].G2LEQ[it] = idx++;
}
}
// Establish global equation numbers for all blocks.
if (!calcGlobalEqNumbers(adm, sim))
ok = 0;
#ifdef HAVE_MPI
if (!adm.isParallel())
return true;
std::vector<int> nEqs(blocks.size());
for (size_t i = 0; i < blocks.size(); ++i)
nEqs[i] = getMaxEq(i);
MPI_Bcast(&nEqs[0], nEqs.size(), MPI_INT, adm.getNoProcs()-1,
*adm.getCommunicator());
IFEM::cout << "\n >>> Domain decomposition summary <<<"
<< "\nNumber of domains " << adm.getNoProcs();
IFEM::cout << "\nNumber of equations " << nEqs[0] << " (" << getMaxEq()-getMinEq()+1 << " on process)";
for (size_t i = 1; i < blocks.size(); ++i)
IFEM::cout << "\n Block " << i << " " << nEqs[i] << " (" << getMaxEq(i)-getMinEq(i)+1 << " on process)";
IFEM::cout << std::endl;
// sanity check the established domain decomposition
for (size_t i = 0; i < blocks.size(); ++i) {
if (getMinEq(i) > getMaxEq(i)) {
std::cerr << "Process " << adm.getProcId() << " owns no equations";
if (i > 0)
std::cerr << " in block " << i;
std::cerr << "." << std::endl;
ok = 0;
}
}
lok = ok;
MPI_Allreduce(&lok, &ok, 1, MPI_INT, MPI_SUM, *adm.getCommunicator());
if (ok < adm.getNoProcs())
return false;
#endif
return true;
}
int DomainDecomposition::getPatchOwner(size_t p) const
{
auto it = patchOwner.find(p);
if (it == patchOwner.end())
return -1;
return it->second;
}

View File

@ -0,0 +1,210 @@
// $Id$
//==============================================================================
//!
//! \file DomainDecomposition.h
//!
//! \date Feb 23 2016
//!
//! \author Arne Morten Kvarving / SINTEF
//!
//! \brief Domain decomposition related partitioning for structured models.
//!
//==============================================================================
#ifndef _DOMAIN_DECOMPOSITION_H
#define _DOMAIN_DECOMPOSITION_H
#include <map>
#include <set>
#include <vector>
#include <cstddef>
class ProcessAdm;
class SAMpatch;
class SIMbase;
/*!
\brief Class containing domain decomposition related partitioning.
*/
class DomainDecomposition
{
public:
//! \brief Struct defining a domain interface.
struct Interface {
int master; //!< Master patch (global number).
int slave; //!< Slave patch (global number).
int midx; //!< Index of boundary on master:
int sidx; //!< Index of boundary on slave.
int orient; //!< Orientation.
int dim; //!< Dimension of boundary.
};
//! \brief Functor to order ghost connections.
class SlaveOrder {
public:
//! \brief The constructor initializes the DomainDecomposition reference.
SlaveOrder(const DomainDecomposition& dd_) : dd(dd_) {}
//! \brief Hide ill-formed default assignment operator.
SlaveOrder& operator=(const SlaveOrder&) { return *this; }
//! \brief Compare interfaces.
bool operator()(const Interface& A, const Interface& B) const
{
// order by master owner id first
if (dd.getPatchOwner(A.master) != dd.getPatchOwner(B.master))
return dd.getPatchOwner(A.master) < dd.getPatchOwner(B.master);
// then by lower slave owner id
if (dd.getPatchOwner(A.slave) != dd.getPatchOwner(B.slave))
return dd.getPatchOwner(A.slave) < dd.getPatchOwner(B.slave);
// then by slave id
if (A.slave != B.slave)
return A.slave < B.slave;
// finally by index on master
return A.midx < B.midx;
}
protected:
const DomainDecomposition& dd;
};
std::set<Interface, SlaveOrder> ghostConnections; //!< Connections to other processes.
//! \brief Default constructor.
DomainDecomposition() : ghostConnections(SlaveOrder(*this)), blocks(1) {}
//! \brief Setup domain decomposition.
bool setup(const ProcessAdm& adm, const SIMbase& sim);
//! \brief Obtain local subdomains for an equation block.
//! \param nx Number of domains in x
//! \param ny Number of domains in y
//! \param nz Number of domains in z
//! \param overlap Overlap
//! \param block Block to obtain equations for
//! \return Vector with equations on each subdomain
std::vector<std::set<int>> getSubdomains(int nx, int ny, int nz, int overlap, size_t block) const;
//! \brief Calculates subdomains with a given overlap.
//! \param[in] nel1 Number of knot-spans in first parameter direction.
//! \param[in] nel2 Number of knot-spans in second parameter direction.
//! \param[in] nel3 Number of knot-spans in third parameter direction.
//! \param[in] g1 Number of subdomains in first parameter direction.
//! \param[in] g2 Number of subdomains in second parameter direction.
//! \param[in] g3 Number of subdomains in third parameter direction.
//! \param[in] overlap Overlap of subdomains.
//! \details nel values determine the dimensionality.
static std::vector<std::vector<int>> calcSubdomains(size_t nel1, size_t nel2, size_t nel3,
size_t g1, size_t g2, size_t g3, size_t overlap);
//! \brief Get first equation owned by this process.
int getMinEq(size_t idx = 0) const { return blocks[idx].minEq; }
//! \brief Get last equation owned by this process.
int getMaxEq(size_t idx = 0) const { return blocks[idx].maxEq; }
//! \brief Get first node owned by this process.
int getMinNode() const { return minNode; }
//! \brief Get last node owned by this process.
int getMaxNode() const { return maxNode; }
//! \brief Get first DOF owned by this process.
int getMinDOF() const { return minDof; }
//! \brief Get last DOF owned by this process.
int getMaxDOF() const { return maxDof; }
//! \brief Set owner for a patch.
void setPatchOwner(size_t p, size_t owner) { patchOwner[p] = owner; }
//! \brief Get process owning patch p.
int getPatchOwner(size_t p) const;
//! \brief Get global equation number
//! \param lEq Local equation number
//! \param idx Block to get index for
int getGlobalEq(int lEq, size_t idx=0) const;
//! \brief Obtain local-to-global equation mapping.
const std::vector<int>& getMLGEQ(size_t idx = 0) const { return blocks[idx].MLGEQ; }
//! \brief Obtain local-to-global equation mapping.
//! \param idx Block equation index (global block not included).
const std::set<int>& getBlockEqs(size_t idx) const { return blocks[idx+1].localEqs; }
//! \brief Obtain global-to-local equation mapping.
//! \param idx Block equation index (global block not included).
const std::map<int,int>& getG2LEQ(size_t idx) const { return blocks[idx+1].G2LEQ; }
//! \brief Obtain local-to-global node mapping.
const std::vector<int>& getMLGN() const { return MLGN; }
//! \brief Returns associated SAM
const SAMpatch* getSAM() const { return sam; }
//! \brief Returns number of matrix blocks.
size_t getNoBlocks() const { return blocks.size()-1; }
private:
//! \brief Calculates a 1D partitioning with a given overlap.
//! \param[in] nel1 Number of knot-spans in first parameter direction.
//! \param[in] g1 Number of subdomains in first parameter direction.
//! \param[in] overlap Overlap of subdomains.
static std::vector<std::vector<int>> calcSubdomains1D(size_t nel1, size_t g1, size_t overlap);
//! \brief Calculates 2D subdomains with a given overlap.
//! \param[in] nel1 Number of knot-spans in first parameter direction.
//! \param[in] nel2 Number of knot-spans in second parameter direction.
//! \param[in] g1 Number of subdomains in first parameter direction.
//! \param[in] g2 Number of subdomains in second parameter direction.
//! \param[in] overlap Overlap of subdomains.
static std::vector<std::vector<int>> calcSubdomains2D(size_t nel1, size_t nel2,
size_t g1, size_t g2, size_t overlap);
//! \brief Calculates 3D subdomains with a given overlap.
//! \param[in] nel1 Number of knot-spans in first parameter direction.
//! \param[in] nel2 Number of knot-spans in second parameter direction.
//! \param[in] nel2 Number of knot-spans in third parameter direction.
//! \param[in] g1 Number of subdomains in first parameter direction.
//! \param[in] g2 Number of subdomains in second parameter direction.
//! \param[in] g3 Number of subdomains in third parameter direction.
//! \param[in] overlap Overlap of subdomains.
static std::vector<std::vector<int>> calcSubdomains3D(size_t nel1, size_t nel2, size_t nel3,
size_t g1, size_t g2, size_t g3, size_t overlap);
//! \brief Setup equation numbers for all blocks on a boundary.
//! \param sim Simulator with patches and linear solver block information
//! \param pidx Patch index
//! \param lidx Boundary index on patch
std::vector<int> setupEquationNumbers(const SIMbase& sim,
int pidx, int lidx);
//! \brief Calculate the global node numbers for given finite element model.
bool calcGlobalNodeNumbers(const ProcessAdm& adm, const SIMbase& sim);
//! \brief Calculate the global equation numbers for given finite element model.
bool calcGlobalEqNumbers(const ProcessAdm& adm, const SIMbase& sim);
std::map<int,int> patchOwner; //!< Process that owns a particular patch
//! \brief Struct with information per matrix block.
struct BlockInfo {
int basis; //!< Bases for block
int components; //!< Components in block
std::vector<int> MLGEQ; //!< Process-local-to-global equation numbers for block.
int minEq; //!< First equation we own in block.
int maxEq; //!< Last equation we own in block.
std::set<int> localEqs; //!< Local equations belonging to the block.
std::map<int,int> G2LEQ; //!< Maps from local total matrix index to local block index
};
std::vector<int> MLGN; //!< Process-local-to-global node numbers
std::vector<BlockInfo> blocks; //!< Equation mappings for all matrix blocks.
int minDof; //!< First DOF we own
int maxDof; //!< Last DOF we own
int minNode; //!< First node we own
int maxNode; //!< Last node we own
const SAMpatch* sam; //!< The assembly handler the DD is constructed for.
};
#endif

View File

@ -18,6 +18,8 @@
bool SAMpatch::init (const ASMVec& model, int numNod)
{
patches = model;
// Initialize some model size parameters
nnod = numNod;
for (size_t i = 0; i < model.size(); i++)

View File

@ -45,6 +45,13 @@ public:
bool updateConstraintEqs(const std::vector<ASMbase*>& model,
const Vector* prevSol = 0);
//! \brief Start iterator for patches
std::vector<ASMbase*>::const_iterator begin() const { return patches.begin(); }
//! \brief End iterator for patches
std::vector<ASMbase*>::const_iterator end() const { return patches.end(); }
//! \brief Number of patches in model
size_t getNoPatches() const { return patches.size(); }
protected:
//! \brief Initializes the nodal arrays \a MINEX, \a MADOF and \a MSC.
bool initNodeDofs(const std::vector<ASMbase*>& model);
@ -54,6 +61,8 @@ protected:
//! \a MPMCEQ, \a MMCEQ and \a TTCC.
virtual bool initConstraintEqs(const std::vector<ASMbase*>& model);
std::vector<ASMbase*> patches; //!< The spline patches
private:
//! \brief Recursive helper method used by \a initConstraintEqs.
bool initConstraintEqMaster(const MPC::DOF& master, const MPC::DOF& slave,

View File

@ -0,0 +1,381 @@
//==============================================================================
//!
//! \file TestDomainDecomposition.C
//!
//! \date Mar 29 2016
//!
//! \author Arne Morten Kvarving / SINTEF
//!
//! \brief Tests for domain decomposition related partitioning for structured models.
//!
//==============================================================================
#include "DomainDecomposition.h"
#include "SAM.h"
#include "ASMbase.h"
#include "SIM2D.h"
#include "SIM3D.h"
#include "IFEM.h"
#include "gtest/gtest.h"
#include <fstream>
class TestGlobalLMSIM : public SIM2D {
public:
TestGlobalLMSIM(unsigned char n1 = 2, bool check = false) :
SIM2D(n1, check) {}
TestGlobalLMSIM(const std::vector<unsigned char>& nf, bool check = false) :
SIM2D(nf, check) {}
protected:
bool preprocessBeforeAsmInit(int& nnod)
{
++nnod;
for (int p = 1; p <= this->getNoPatches(); ++p) {
int idx = this->getLocalPatchIndex(p);
if (idx > 0)
this->getPatch(idx)->addGlobalLagrangeMultipliers({nnod}, 1);
}
return true;
}
};
typedef std::vector<int> IntVec;
static IntVec readIntVector(const std::string& file)
{
std::vector<int> result;
std::ifstream f(file);
size_t size;
f >> size;
result.resize(size);
for (size_t j=0;j<size;++j)
f >> result[j];
return result;
}
auto&& check_intvectors_equal = [](const IntVec& A,
const IntVec& B)
{
ASSERT_EQ(A.size(), B.size());
auto it = B.begin();
for (auto& it2 : A) {
ASSERT_EQ(it2, *it);
++it;
}
};
class TestDomainDecomposition2D : public testing::Test,
public testing::WithParamInterface<int>
{
};
class TestDomainDecomposition3D : public testing::Test,
public testing::WithParamInterface<int>
{
};
TEST_P(TestDomainDecomposition2D, SetupSingleBasis)
{
SIM2D sim(2);
std::stringstream str;
str << "src/ASM/Test/refdata/DomainDecomposition_MPI_2D_4_orient";
str << GetParam() << ".xinp";
sim.read(str.str().c_str());
sim.preprocess();
const ProcessAdm& adm = sim.getProcessAdm();
// TODO: unnecessary cast and setup call after integration.
DomainDecomposition& dd = const_cast<DomainDecomposition&>(adm.dd);
dd.setup(adm, sim);
const SAM* sam = sim.getSAM();
str.str("");
str << "src/ASM/Test/refdata/DomainDecomposition_MPI_2D_4_orient";
str << GetParam() << "_nodes" << adm.getProcId() << ".ref";
IntVec B = readIntVector(str.str());
check_intvectors_equal(dd.getMLGN(), B);
ASSERT_EQ(sam->getNoNodes(), 9);
const std::vector<int> maxeqs {16, 26, 36, 44};
ASSERT_EQ(dd.getMaxEq(), maxeqs[adm.getProcId()]);
str.str("");
str << "src/ASM/Test/refdata/DomainDecomposition_MPI_2D_4_orient";
str << GetParam() << "_eqs" << adm.getProcId() << ".ref";
B = readIntVector(str.str());
check_intvectors_equal(dd.getMLGEQ(), B);
ASSERT_EQ(dd.getMaxDOF(), 2*dd.getMaxNode());
}
TEST_P(TestDomainDecomposition2D, SetupSingleBasisGlobalLM)
{
TestGlobalLMSIM sim(2);
std::stringstream str;
str << "src/ASM/Test/refdata/DomainDecomposition_MPI_2D_4_orient";
str << GetParam() << ".xinp";
sim.read(str.str().c_str());
sim.preprocess();
const ProcessAdm& adm = sim.getProcessAdm();
// TODO: unnecessary cast and setup call after integration.
DomainDecomposition& dd = const_cast<DomainDecomposition&>(adm.dd);
dd.setup(adm, sim);
str.str("");
str << "src/ASM/Test/refdata/DomainDecomposition_MPI_2D_4_orient";
str << GetParam() << "_eqs" << adm.getProcId() << ".ref";
IntVec B = readIntVector(str.str());
if (adm.getProcId() == 0)
B.push_back(17);
else {
for (auto& it : B)
if (it > 16)
++it;
B.push_back(17);
}
check_intvectors_equal(dd.getMLGEQ(), B);
}
TEST_P(TestDomainDecomposition2D, SetupSingleBasisBlockEqsComponent)
{
SIM2D sim(3);
std::stringstream str;
str << "src/ASM/Test/refdata/DomainDecomposition_MPI_2D_4_blocks_components_orient";
str << GetParam() << ".xinp";
sim.read(str.str().c_str());
sim.preprocess();
const ProcessAdm& adm = sim.getProcessAdm();
// TODO: unnecessary cast and setup call after integration.
DomainDecomposition& dd = const_cast<DomainDecomposition&>(adm.dd);
dd.setup(adm, sim);
str.str("");
str << "src/ASM/Test/refdata/DomainDecomposition_MPI_2D_4_orient";
str << GetParam() << "_eqs" << adm.getProcId() << ".ref";
IntVec B = readIntVector(str.str());
check_intvectors_equal(dd.getMLGEQ(1), B);
str.str("");
str << "src/ASM/Test/refdata/DomainDecomposition_MPI_2D_4_blocks_components_orient";
str << GetParam() << "_block2_eqs" << adm.getProcId() << ".ref";
B = readIntVector(str.str());
check_intvectors_equal(dd.getMLGEQ(2), B);
}
TEST_P(TestDomainDecomposition2D, SetupMixedBasis)
{
SIM2D sim({2,2});
std::stringstream str;
str << "src/ASM/Test/refdata/DomainDecomposition_MPI_2D_4_orient";
str << GetParam() << ".xinp";
sim.read(str.str().c_str());
sim.preprocess();
const ProcessAdm& adm = sim.getProcessAdm();
// TODO: unnecessary cast and setup call after integration.
DomainDecomposition& dd = const_cast<DomainDecomposition&>(adm.dd);
dd.setup(adm, sim);
const SAM* sam = sim.getSAM();
str.str("");
str << "src/ASM/Test/refdata/DomainDecomposition_MPI_2D_4_mixed_orient";
str << GetParam() << "_nodes" << adm.getProcId() << ".ref";
IntVec B = readIntVector(str.str());
check_intvectors_equal(dd.getMLGN(), B);
ASSERT_EQ(sam->getNoNodes(), 25);
ASSERT_EQ(sam->getNoDOFs(), 50);
const std::vector<int> maxeqs {48, 81, 114, 140};
ASSERT_EQ(dd.getMaxEq(), maxeqs[adm.getProcId()]);
str.str("");
str << "src/ASM/Test/refdata/DomainDecomposition_MPI_2D_4_mixed_orient";
str << GetParam() << "_eqs" << adm.getProcId() << ".ref";
B = readIntVector(str.str());
check_intvectors_equal(dd.getMLGEQ(), B);
ASSERT_EQ(dd.getMinDOF(), 2*(dd.getMinNode()-1)+1);
ASSERT_EQ(dd.getMaxDOF(), 2*dd.getMaxNode());
}
TEST_P(TestDomainDecomposition2D, SetupMixedBasisBlockEqsBasis)
{
SIM2D sim({2,2});
std::stringstream str;
str << "src/ASM/Test/refdata/DomainDecomposition_MPI_2D_4_blocks_basis_orient";
str << GetParam() << ".xinp";
sim.read(str.str().c_str());
sim.preprocess();
const ProcessAdm& adm = sim.getProcessAdm();
// TODO: unnecessary cast and setup call after integration.
DomainDecomposition& dd = const_cast<DomainDecomposition&>(adm.dd);
dd.setup(adm, sim);
str.str("");
str << "src/ASM/Test/refdata/DomainDecomposition_MPI_2D_4_mixed_orient";
str << GetParam() << "_eqs" << adm.getProcId() << ".ref";
IntVec B = readIntVector(str.str());
check_intvectors_equal(dd.getMLGEQ(0), B);
str.str("");
str << "src/ASM/Test/refdata/DomainDecomposition_MPI_2D_4_blocks_basis_orient";
str << GetParam() << "_block1_eqs" << adm.getProcId() << ".ref";
B = readIntVector(str.str());
check_intvectors_equal(dd.getMLGEQ(1), B);
str.str("");
str << "src/ASM/Test/refdata/DomainDecomposition_MPI_2D_4_blocks_basis_orient";
str << GetParam() << "_block2_eqs" << adm.getProcId() << ".ref";
B = readIntVector(str.str());
check_intvectors_equal(dd.getMLGEQ(2), B);
}
TEST_P(TestDomainDecomposition2D, SetupMixedBasisBlockEqsBasisGlobalLM)
{
TestGlobalLMSIM sim({2,2});
std::stringstream str;
str << "src/ASM/Test/refdata/DomainDecomposition_MPI_2D_4_blocks_basis_orient";
str << GetParam() << ".xinp";
sim.read(str.str().c_str());
sim.preprocess();
const ProcessAdm& adm = sim.getProcessAdm();
// TODO: unnecessary cast and setup call after integration.
DomainDecomposition& dd = const_cast<DomainDecomposition&>(adm.dd);
dd.setup(adm, sim);
str.str("");
str << "src/ASM/Test/refdata/DomainDecomposition_MPI_2D_4_mixed_orient";
str << GetParam() << "_eqs" << adm.getProcId() << ".ref";
IntVec B = readIntVector(str.str());
if (adm.getProcId() == 0)
B.push_back(49);
else {
for (auto& it : B)
if (it > 48)
++it;
B.push_back(49);
}
check_intvectors_equal(dd.getMLGEQ(0), B);
str.str("");
str << "src/ASM/Test/refdata/DomainDecomposition_MPI_2D_4_blocks_basis_orient";
str << GetParam() << "_block1_eqs" << adm.getProcId() << ".ref";
B = readIntVector(str.str());
check_intvectors_equal(dd.getMLGEQ(1), B);
str.str("");
str << "src/ASM/Test/refdata/DomainDecomposition_MPI_2D_4_blocks_basis_orient";
str << GetParam() << "_block2_eqs" << adm.getProcId() << ".ref";
B = readIntVector(str.str());
if (adm.getProcId() == 0)
B.push_back(19);
else {
for (auto& it : B)
if (it > 18)
++it;
B.push_back(19);
}
check_intvectors_equal(dd.getMLGEQ(2), B);
}
TEST_P(TestDomainDecomposition3D, SetupSingleBasis)
{
SIM3D sim(3);
std::stringstream str;
str << "src/ASM/Test/refdata/DomainDecomposition_MPI_3D_4_orient";
str << GetParam() << ".xinp";
sim.read(str.str().c_str());
sim.preprocess();
const ProcessAdm& adm = sim.getProcessAdm();
// TODO: unnecessary cast and setup call after integration.
DomainDecomposition& dd = const_cast<DomainDecomposition&>(adm.dd);
dd.setup(adm, sim);
const SAM* sam = sim.getSAM();
str.str("");
str << "src/ASM/Test/refdata/DomainDecomposition_MPI_3D_4_orient";
str << GetParam() << "_nodes" << adm.getProcId() << ".ref";
IntVec B = readIntVector(str.str());
check_intvectors_equal(dd.getMLGN(), B);
ASSERT_EQ(sam->getNoNodes(), 45);
const std::vector<int> maxeqs {111, 195, 254, 300};
ASSERT_EQ(dd.getMaxEq(), maxeqs[adm.getProcId()]);
str.str("");
str << "src/ASM/Test/refdata/DomainDecomposition_MPI_3D_4_orient";
str << GetParam() << "_eqs" << adm.getProcId() << ".ref";
B = readIntVector(str.str());
check_intvectors_equal(dd.getMLGEQ(), B);
ASSERT_EQ(dd.getMaxDOF(), 3*dd.getMaxNode());
}
TEST_P(TestDomainDecomposition3D, SetupSingleBasisBlockEqsComponent)
{
if (GetParam() > 0)
return;
SIM3D sim(4);
std::stringstream str;
str << "src/ASM/Test/refdata/DomainDecomposition_MPI_3D_4_blocks_components_orient";
str << GetParam() << ".xinp";
sim.read(str.str().c_str());
sim.preprocess();
const ProcessAdm& adm = sim.getProcessAdm();
// TODO: unnecessary cast and setup call after integration.
DomainDecomposition& dd = const_cast<DomainDecomposition&>(adm.dd);
dd.setup(adm, sim);
str.str("");
str << "src/ASM/Test/refdata/DomainDecomposition_MPI_3D_4_orient";
str << GetParam() << "_eqs" << adm.getProcId() << ".ref";
IntVec B = readIntVector(str.str());
check_intvectors_equal(dd.getMLGEQ(1), B);
str.str("");
str << "src/ASM/Test/refdata/DomainDecomposition_MPI_3D_4_orient";
str << GetParam() << "_nodes" << adm.getProcId() << ".ref";
B = readIntVector(str.str());
check_intvectors_equal(dd.getMLGEQ(2), B);
}
TEST_P(TestDomainDecomposition3D, SetupMixedBasis)
{
if (GetParam() > 0)
return;
SIM3D sim({3,1});
std::stringstream str;
str << "src/ASM/Test/refdata/DomainDecomposition_MPI_3D_4_orient";
str << GetParam() << ".xinp";
sim.read(str.str().c_str());
sim.preprocess();
const ProcessAdm& adm = sim.getProcessAdm();
// TODO: unnecessary cast and setup call after integration.
DomainDecomposition& dd = const_cast<DomainDecomposition&>(adm.dd);
dd.setup(adm, sim);
const SAM* sam = sim.getSAM();
str.str("");
str << "src/ASM/Test/refdata/DomainDecomposition_MPI_3D_4_mixed_orient";
str << GetParam() << "_nodes" << adm.getProcId() << ".ref";
IntVec B = readIntVector(str.str());
check_intvectors_equal(dd.getMLGN(), B);
ASSERT_EQ(sam->getNoNodes(), 157);
const std::vector<int> maxeqs {337, 607, 828, 1007};
ASSERT_EQ(dd.getMaxEq(), maxeqs[adm.getProcId()]);
str.str("");
str << "src/ASM/Test/refdata/DomainDecomposition_MPI_3D_4_mixed_orient";
str << GetParam() << "_eqs" << adm.getProcId() << ".ref";
B = readIntVector(str.str());
check_intvectors_equal(dd.getMLGEQ(), B);
}
const std::vector<int> orientations2D = {0,1};
INSTANTIATE_TEST_CASE_P(TestDomainDecomposition2D, TestDomainDecomposition2D, testing::ValuesIn(orientations2D));
const std::vector<int> orientations3D = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16};
INSTANTIATE_TEST_CASE_P(TestDomainDecomposition3D, TestDomainDecomposition3D, testing::ValuesIn(orientations3D));

View File

@ -0,0 +1,120 @@
//==============================================================================
//!
//! \file TestDomainDecomposition.C
//!
//! \date Mar 29 2016
//!
//! \author Arne Morten Kvarving / SINTEF
//!
//! \brief Tests for domain decomposition related partitioning for structured models.
//!
//==============================================================================
#include "DomainDecomposition.h"
#include "SAM.h"
#include "SIM2D.h"
#include "gtest/gtest.h"
#include <fstream>
typedef std::vector< std::vector<int> > IntMat;
static IntMat readIntMatrix(size_t r, const std::string& file)
{
std::vector< std::vector<int> > result;
result.resize(r);
std::ifstream f(file);
for (size_t i=0;i<r;++i) {
size_t size;
f >> size;
result[i].resize(size);
for (size_t j=0;j<size;++j)
f >> result[i][j];
}
return result;
}
auto&& check_intmatrices_equal = [](const std::vector<std::vector<int>>& subdomains,
const std::string& path)
{
IntMat B = readIntMatrix(subdomains.size(), path);
for (size_t i = 0; i < subdomains.size(); ++i) {
size_t j = 0;
for (const auto& it2 : subdomains[i])
ASSERT_EQ(it2, B[i][j++]);
}
};
TEST(TestDomainDecomposition, LocalGroups1DO1)
{
auto domains = DomainDecomposition::calcSubdomains(7, 0, 0, 3, 0, 0, 1);
check_intmatrices_equal(domains, "src/ASM/Test/refdata/DomainDecomposition_1D_O1.ref");
}
TEST(TestDomainDecomposition, LocalGroups1DO2)
{
auto domains = DomainDecomposition::calcSubdomains(7, 0, 0, 3, 0, 0, 2);
check_intmatrices_equal(domains, "src/ASM/Test/refdata/DomainDecomposition_1D_O2.ref");
}
TEST(TestDomainDecomposition, LocalGroups2DO1)
{
auto domains = DomainDecomposition::calcSubdomains(7, 7, 0, 3, 3, 0, 1);
check_intmatrices_equal(domains, "src/ASM/Test/refdata/DomainDecomposition_2D_O1.ref");
}
TEST(TestDomainDecomposition, LocalGroups2DO2)
{
auto domains = DomainDecomposition::calcSubdomains(7, 7, 0, 3, 3, 0, 2);
check_intmatrices_equal(domains, "src/ASM/Test/refdata/DomainDecomposition_2D_O2.ref");
}
TEST(TestDomainDecomposition, LocalGroups3DO1)
{
auto domains = DomainDecomposition::calcSubdomains(7, 7, 7, 3, 3, 3, 1);
check_intmatrices_equal(domains, "src/ASM/Test/refdata/DomainDecomposition_3D_O1.ref");
}
TEST(TestDomainDecomposition, LocalGroups3DO2)
{
auto domains = DomainDecomposition::calcSubdomains(7, 7, 7, 3, 3, 3, 2);
check_intmatrices_equal(domains, "src/ASM/Test/refdata/DomainDecomposition_3D_O2.ref");
}
TEST(TestDomainDecomposition, Setup)
{
SIM2D sim(1);
sim.read("src/ASM/Test/refdata/DomainDecomposition_2D_1P.xinp");
sim.preprocess();
DomainDecomposition dd;
// TODO: Remove after integration
dd.setup(sim.getProcessAdm(), sim);
const SAM* sam = sim.getSAM();
ASSERT_EQ(dd.getMinEq(), 1);
ASSERT_EQ(dd.getMaxEq(), sam->getNoEquations());
ASSERT_EQ(dd.getMinNode(), 1);
ASSERT_EQ(dd.getMaxNode(), sam->getNoNodes());
ASSERT_EQ(dd.getMinDOF(), 1);
ASSERT_EQ(dd.getMaxDOF(), sam->getNoDOFs());
for (int i = 1; i <= sam->getNoEquations(); ++i)
ASSERT_EQ(dd.getGlobalEq(i), i);
ASSERT_EQ(dd.getGlobalEq(sam->getNoEquations()+1), 0);
// disabled until integration in the SIM class is added
// ASSERT_EQ(dd.getPatchOwner(1), 0);
// ASSERT_EQ(dd.getPatchOwner(2), -1);
ASSERT_TRUE(dd.getMLGEQ().empty());
ASSERT_TRUE(dd.getMLGN().empty());
}

View File

@ -0,0 +1,6 @@
3
0 1 2
3
2 3 4
3
4 5 6

View File

@ -0,0 +1,6 @@
3
0 1 2
3
1 2 3
5
2 3 4 5 6

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<simulation>
<geometry>
<partitioning procs="1" nperproc="1"/>
<refine type="uniform" patch="1" u="1" v="1"/>
</geometry>
</simulation>

View File

@ -0,0 +1,18 @@
9
0 1 2 7 8 9 14 15 16
9
2 3 4 9 10 11 16 17 18
9
4 5 6 11 12 13 18 19 20
9
14 15 16 21 22 23 28 29 30
9
16 17 18 23 24 25 30 31 32
9
18 19 20 25 26 27 32 33 34
9
28 29 30 35 36 37 42 43 44
9
30 31 32 37 38 39 44 45 46
9
32 33 34 39 40 41 46 47 48

View File

@ -0,0 +1,18 @@
9
0 1 2 7 8 9 14 15 16
9
1 2 3 8 9 10 15 16 17
15
2 3 4 5 6 9 10 11 12 13 16 17 18 19 20
9
7 8 9 14 15 16 21 22 23
9
8 9 10 15 16 17 22 23 24
15
9 10 11 12 13 16 17 18 19 20 23 24 25 26 27
15
14 15 16 21 22 23 28 29 30 35 36 37 42 43 44
15
15 16 17 22 23 24 29 30 31 36 37 38 43 44 45
25
16 17 18 19 20 23 24 25 26 27 30 31 32 33 34 37 38 39 40 41 44 45 46 47 48

View File

@ -0,0 +1,54 @@
27
0 1 2 7 8 9 14 15 16 49 50 51 56 57 58 63 64 65 98 99 100 105 106 107 112 113 114
27
2 3 4 9 10 11 16 17 18 51 52 53 58 59 60 65 66 67 100 101 102 107 108 109 114 115 116
27
4 5 6 11 12 13 18 19 20 53 54 55 60 61 62 67 68 69 102 103 104 109 110 111 116 117 118
27
14 15 16 21 22 23 28 29 30 63 64 65 70 71 72 77 78 79 112 113 114 119 120 121 126 127 128
27
16 17 18 23 24 25 30 31 32 65 66 67 72 73 74 79 80 81 114 115 116 121 122 123 128 129 130
27
18 19 20 25 26 27 32 33 34 67 68 69 74 75 76 81 82 83 116 117 118 123 124 125 130 131 132
27
28 29 30 35 36 37 42 43 44 77 78 79 84 85 86 91 92 93 126 127 128 133 134 135 140 141 142
27
30 31 32 37 38 39 44 45 46 79 80 81 86 87 88 93 94 95 128 129 130 135 136 137 142 143 144
27
32 33 34 39 40 41 46 47 48 81 82 83 88 89 90 95 96 97 130 131 132 137 138 139 144 145 146
27
98 99 100 105 106 107 112 113 114 147 148 149 154 155 156 161 162 163 196 197 198 203 204 205 210 211 212
27
100 101 102 107 108 109 114 115 116 149 150 151 156 157 158 163 164 165 198 199 200 205 206 207 212 213 214
27
102 103 104 109 110 111 116 117 118 151 152 153 158 159 160 165 166 167 200 201 202 207 208 209 214 215 216
27
112 113 114 119 120 121 126 127 128 161 162 163 168 169 170 175 176 177 210 211 212 217 218 219 224 225 226
27
114 115 116 121 122 123 128 129 130 163 164 165 170 171 172 177 178 179 212 213 214 219 220 221 226 227 228
27
116 117 118 123 124 125 130 131 132 165 166 167 172 173 174 179 180 181 214 215 216 221 222 223 228 229 230
27
126 127 128 133 134 135 140 141 142 175 176 177 182 183 184 189 190 191 224 225 226 231 232 233 238 239 240
27
128 129 130 135 136 137 142 143 144 177 178 179 184 185 186 191 192 193 226 227 228 233 234 235 240 241 242
27
130 131 132 137 138 139 144 145 146 179 180 181 186 187 188 193 194 195 228 229 230 235 236 237 242 243 244
27
196 197 198 203 204 205 210 211 212 245 246 247 252 253 254 259 260 261 294 295 296 301 302 303 308 309 310
27
198 199 200 205 206 207 212 213 214 247 248 249 254 255 256 261 262 263 296 297 298 303 304 305 310 311 312
27
200 201 202 207 208 209 214 215 216 249 250 251 256 257 258 263 264 265 298 299 300 305 306 307 312 313 314
27
210 211 212 217 218 219 224 225 226 259 260 261 266 267 268 273 274 275 308 309 310 315 316 317 322 323 324
27
212 213 214 219 220 221 226 227 228 261 262 263 268 269 270 275 276 277 310 311 312 317 318 319 324 325 326
27
214 215 216 221 222 223 228 229 230 263 264 265 270 271 272 277 278 279 312 313 314 319 320 321 326 327 328
27
224 225 226 231 232 233 238 239 240 273 274 275 280 281 282 287 288 289 322 323 324 329 330 331 336 337 338
27
226 227 228 233 234 235 240 241 242 275 276 277 282 283 284 289 290 291 324 325 326 331 332 333 338 339 340
27
228 229 230 235 236 237 242 243 244 277 278 279 284 285 286 291 292 293 326 327 328 333 334 335 340 341 342

View File

@ -0,0 +1,54 @@
27
0 1 2 7 8 9 14 15 16 49 50 51 56 57 58 63 64 65 98 99 100 105 106 107 112 113 114
27
1 2 3 8 9 10 15 16 17 50 51 52 57 58 59 64 65 66 99 100 101 106 107 108 113 114 115
45
2 3 4 5 6 9 10 11 12 13 16 17 18 19 20 51 52 53 54 55 58 59 60 61 62 65 66 67 68 69 100 101 102 103 104 107 108 109 110 111 114 115 116 117 118
27
7 8 9 14 15 16 21 22 23 56 57 58 63 64 65 70 71 72 105 106 107 112 113 114 119 120 121
27
8 9 10 15 16 17 22 23 24 57 58 59 64 65 66 71 72 73 106 107 108 113 114 115 120 121 122
45
9 10 11 12 13 16 17 18 19 20 23 24 25 26 27 58 59 60 61 62 65 66 67 68 69 72 73 74 75 76 107 108 109 110 111 114 115 116 117 118 121 122 123 124 125
45
14 15 16 21 22 23 28 29 30 35 36 37 42 43 44 63 64 65 70 71 72 77 78 79 84 85 86 91 92 93 112 113 114 119 120 121 126 127 128 133 134 135 140 141 142
45
15 16 17 22 23 24 29 30 31 36 37 38 43 44 45 64 65 66 71 72 73 78 79 80 85 86 87 92 93 94 113 114 115 120 121 122 127 128 129 134 135 136 141 142 143
75
16 17 18 19 20 23 24 25 26 27 30 31 32 33 34 37 38 39 40 41 44 45 46 47 48 65 66 67 68 69 72 73 74 75 76 79 80 81 82 83 86 87 88 89 90 93 94 95 96 97 114 115 116 117 118 121 122 123 124 125 128 129 130 131 132 135 136 137 138 139 142 143 144 145 146
27
49 50 51 56 57 58 63 64 65 98 99 100 105 106 107 112 113 114 147 148 149 154 155 156 161 162 163
27
50 51 52 57 58 59 64 65 66 99 100 101 106 107 108 113 114 115 148 149 150 155 156 157 162 163 164
45
51 52 53 54 55 58 59 60 61 62 65 66 67 68 69 100 101 102 103 104 107 108 109 110 111 114 115 116 117 118 149 150 151 152 153 156 157 158 159 160 163 164 165 166 167
27
56 57 58 63 64 65 70 71 72 105 106 107 112 113 114 119 120 121 154 155 156 161 162 163 168 169 170
27
57 58 59 64 65 66 71 72 73 106 107 108 113 114 115 120 121 122 155 156 157 162 163 164 169 170 171
45
58 59 60 61 62 65 66 67 68 69 72 73 74 75 76 107 108 109 110 111 114 115 116 117 118 121 122 123 124 125 156 157 158 159 160 163 164 165 166 167 170 171 172 173 174
45
63 64 65 70 71 72 77 78 79 84 85 86 91 92 93 112 113 114 119 120 121 126 127 128 133 134 135 140 141 142 161 162 163 168 169 170 175 176 177 182 183 184 189 190 191
45
64 65 66 71 72 73 78 79 80 85 86 87 92 93 94 113 114 115 120 121 122 127 128 129 134 135 136 141 142 143 162 163 164 169 170 171 176 177 178 183 184 185 190 191 192
75
65 66 67 68 69 72 73 74 75 76 79 80 81 82 83 86 87 88 89 90 93 94 95 96 97 114 115 116 117 118 121 122 123 124 125 128 129 130 131 132 135 136 137 138 139 142 143 144 145 146 163 164 165 166 167 170 171 172 173 174 177 178 179 180 181 184 185 186 187 188 191 192 193 194 195
45
98 99 100 105 106 107 112 113 114 147 148 149 154 155 156 161 162 163 196 197 198 203 204 205 210 211 212 245 246 247 252 253 254 259 260 261 294 295 296 301 302 303 308 309 310
45
99 100 101 106 107 108 113 114 115 148 149 150 155 156 157 162 163 164 197 198 199 204 205 206 211 212 213 246 247 248 253 254 255 260 261 262 295 296 297 302 303 304 309 310 311
75
100 101 102 103 104 107 108 109 110 111 114 115 116 117 118 149 150 151 152 153 156 157 158 159 160 163 164 165 166 167 198 199 200 201 202 205 206 207 208 209 212 213 214 215 216 247 248 249 250 251 254 255 256 257 258 261 262 263 264 265 296 297 298 299 300 303 304 305 306 307 310 311 312 313 314
45
105 106 107 112 113 114 119 120 121 154 155 156 161 162 163 168 169 170 203 204 205 210 211 212 217 218 219 252 253 254 259 260 261 266 267 268 301 302 303 308 309 310 315 316 317
45
106 107 108 113 114 115 120 121 122 155 156 157 162 163 164 169 170 171 204 205 206 211 212 213 218 219 220 253 254 255 260 261 262 267 268 269 302 303 304 309 310 311 316 317 318
75
107 108 109 110 111 114 115 116 117 118 121 122 123 124 125 156 157 158 159 160 163 164 165 166 167 170 171 172 173 174 205 206 207 208 209 212 213 214 215 216 219 220 221 222 223 254 255 256 257 258 261 262 263 264 265 268 269 270 271 272 303 304 305 306 307 310 311 312 313 314 317 318 319 320 321
75
112 113 114 119 120 121 126 127 128 133 134 135 140 141 142 161 162 163 168 169 170 175 176 177 182 183 184 189 190 191 210 211 212 217 218 219 224 225 226 231 232 233 238 239 240 259 260 261 266 267 268 273 274 275 280 281 282 287 288 289 308 309 310 315 316 317 322 323 324 329 330 331 336 337 338
75
113 114 115 120 121 122 127 128 129 134 135 136 141 142 143 162 163 164 169 170 171 176 177 178 183 184 185 190 191 192 211 212 213 218 219 220 225 226 227 232 233 234 239 240 241 260 261 262 267 268 269 274 275 276 281 282 283 288 289 290 309 310 311 316 317 318 323 324 325 330 331 332 337 338 339
125
114 115 116 117 118 121 122 123 124 125 128 129 130 131 132 135 136 137 138 139 142 143 144 145 146 163 164 165 166 167 170 171 172 173 174 177 178 179 180 181 184 185 186 187 188 191 192 193 194 195 212 213 214 215 216 219 220 221 222 223 226 227 228 229 230 233 234 235 236 237 240 241 242 243 244 261 262 263 264 265 268 269 270 271 272 275 276 277 278 279 282 283 284 285 286 289 290 291 292 293 310 311 312 313 314 317 318 319 320 321 324 325 326 327 328 331 332 333 334 335 338 339 340 341 342

View File

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<simulation>
<!-- General - geometry definitions !-->
<geometry>
<partitioning procs="4" nperproc="1"/>
<patchfile>src/ASM/Test/refdata/square-4-orient0.g2</patchfile>
<refine patch="1" u="1" v="1"/>
<refine patch="2" u="1" v="1"/>
<refine patch="3" u="1" v="1"/>
<refine patch="4" u="1" v="1"/>
<topology>
<connection master="1" medge="4" slave="2" sedge="3"/>
<connection master="1" medge="2" slave="3" sedge="1"/>
<connection master="2" medge="2" slave="4" sedge="1"/>
<connection master="3" medge="4" slave="4" sedge="3"/>
</topology>
<topologysets>
<set name="dir" type="vertex">
<item patch="1">2</item>
<item patch="1">3</item>
</set>
<set name="dir" type="edge">
<item patch="2">1</item>
<item patch="3">3</item>
</set>
</topologysets>
</geometry>
<boundaryconditions>
<dirichlet set="dir" basis="1" comp="1"/>
</boundaryconditions>
<linearsolver>
<block basis="1"/>
<block basis="2"/>
</linearsolver>
</simulation>

View File

@ -0,0 +1,2 @@
30
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30

View File

@ -0,0 +1,2 @@
28
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51

View File

@ -0,0 +1,2 @@
28
7 52 53 54 14 15 55 56 57 58 59 60 22 23 61 62 63 64 65 66 29 30 67 68 69 70 71 72

View File

@ -0,0 +1,2 @@
32
29 30 67 68 69 70 71 72 36 37 73 74 75 76 77 78 43 44 79 80 81 82 83 84 50 51 85 86 87 88 89 90

View File

@ -0,0 +1,2 @@
18
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18

View File

@ -0,0 +1,2 @@
18
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30

View File

@ -0,0 +1,2 @@
18
5 6 31 32 33 34 11 12 35 36 37 38 17 18 39 40 41 42

View File

@ -0,0 +1,2 @@
18
17 18 39 40 41 42 23 24 43 44 45 46 29 30 47 48 49 50

View File

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<simulation>
<!-- General - geometry definitions !-->
<geometry>
<partitioning procs="4" nperproc="1"/>
<patchfile>src/ASM/Test/refdata/square-4-orient1.g2</patchfile>
<refine patch="1" u="1" v="1"/>
<refine patch="2" u="1" v="1"/>
<refine patch="3" u="1" v="1"/>
<refine patch="4" u="1" v="1"/>
<topology>
<connection master="1" medge="4" slave="2" sedge="3"/>
<connection master="1" medge="2" slave="3" sedge="3" reverse="true"/>
<connection master="2" medge="2" slave="4" sedge="1"/>
<connection master="3" medge="1" slave="4" sedge="3"/>
</topology>
<topologysets>
<set name="dir" type="vertex">
<item patch="1">2</item>
<item patch="1">3</item>
</set>
<set name="dir" type="edge">
<item patch="2">1</item>
<item patch="3">2</item>
</set>
</topologysets>
</geometry>
<boundaryconditions>
<dirichlet set="dir" basis="1" comp="1"/>
</boundaryconditions>
<linearsolver>
<block basis="1"/>
<block basis="2"/>
</linearsolver>
</simulation>

View File

@ -0,0 +1,2 @@
30
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30

View File

@ -0,0 +1,2 @@
28
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51

View File

@ -0,0 +1,2 @@
28
29 30 22 23 14 15 7 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72

View File

@ -0,0 +1,2 @@
32
29 30 52 53 59 60 66 67 36 37 73 74 75 76 77 78 43 44 79 80 81 82 83 84 50 51 85 86 87 88 89 90

View File

@ -0,0 +1,2 @@
18
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18

View File

@ -0,0 +1,2 @@
18
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30

View File

@ -0,0 +1,2 @@
18
17 18 11 12 5 6 31 32 33 34 35 36 37 38 39 40 41 42

View File

@ -0,0 +1,2 @@
18
17 18 31 32 37 38 23 24 43 44 45 46 29 30 47 48 49 50

View File

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<simulation>
<postprocessing>
<logging output_prefix="foo"/>
</postprocessing>
<!-- General - geometry definitions !-->
<geometry>
<partitioning procs="4" nperproc="1"/>
<patchfile>src/ASM/Test/refdata/square-4-orient0.g2</patchfile>
<refine patch="1" u="1" v="1"/>
<refine patch="2" u="1" v="1"/>
<refine patch="3" u="1" v="1"/>
<refine patch="4" u="1" v="1"/>
<topology>
<connection master="1" medge="4" slave="2" sedge="3"/>
<connection master="1" medge="2" slave="3" sedge="1"/>
<connection master="2" medge="2" slave="4" sedge="1"/>
<connection master="3" medge="4" slave="4" sedge="3"/>
</topology>
<topologysets>
<set name="dir" type="vertex">
<item patch="1">2</item>
<item patch="1">3</item>
</set>
<set name="dir" type="edge">
<item patch="2">1</item>
<item patch="3">3</item>
</set>
</topologysets>
</geometry>
<boundaryconditions>
<dirichlet set="dir" basis="1" comp="1"/>
</boundaryconditions>
<linearsolver>
<block basis="1" components="12"/>
<block basis="1" components="3"/>
</linearsolver>
</simulation>

View File

@ -0,0 +1,2 @@
9
1 2 3 4 5 6 7 8 9

View File

@ -0,0 +1,2 @@
9
7 8 9 10 11 12 13 14 15

View File

@ -0,0 +1,2 @@
9
3 16 17 6 18 19 9 20 21

View File

@ -0,0 +1,2 @@
9
9 20 21 12 22 23 15 24 25

View File

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<simulation>
<!-- General - geometry definitions !-->
<geometry>
<partitioning procs="4" nperproc="1"/>
<patchfile>src/ASM/Test/refdata/square-4-orient1.g2</patchfile>
<refine patch="1" u="1" v="1"/>
<refine patch="2" u="1" v="1"/>
<refine patch="3" u="1" v="1"/>
<refine patch="4" u="1" v="1"/>
<topology>
<connection master="1" medge="4" slave="2" sedge="3"/>
<connection master="1" medge="2" slave="3" sedge="3" reverse="true"/>
<connection master="2" medge="2" slave="4" sedge="1"/>
<connection master="3" medge="1" slave="4" sedge="3"/>
</topology>
<topologysets>
<set name="dir" type="vertex">
<item patch="1">2</item>
<item patch="1">3</item>
</set>
<set name="dir" type="edge">
<item patch="2">1</item>
<item patch="3">2</item>
</set>
</topologysets>
</geometry>
<boundaryconditions>
<dirichlet set="dir" basis="1" comp="1"/>
</boundaryconditions>
<linearsolver>
<block basis="1" components="12"/>
<block basis="1" components="3"/>
</linearsolver>
</simulation>

View File

@ -0,0 +1,2 @@
9
1 2 3 4 5 6 7 8 9

View File

@ -0,0 +1,2 @@
9
7 8 9 10 11 12 13 14 15

View File

@ -0,0 +1,2 @@
9
9 6 3 16 17 18 19 20 21

View File

@ -0,0 +1,2 @@
9
9 16 19 12 22 23 15 24 25

View File

@ -0,0 +1,2 @@
48
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48

View File

@ -0,0 +1,2 @@
46
24 25 26 27 28 29 30 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 43 44 45 46 47 48 70 71 72 73 74 75 76 77 78 79 80 81

View File

@ -0,0 +1,2 @@
46
7 82 83 84 14 15 85 86 87 88 89 90 22 23 91 92 93 94 95 96 29 30 97 98 99 100 101 102 35 36 103 104 105 106 41 42 107 108 109 110 47 48 111 112 113 114

View File

@ -0,0 +1,2 @@
50
29 30 97 98 99 100 101 102 54 55 115 116 117 118 119 120 61 62 121 122 123 124 125 126 68 69 127 128 129 130 131 132 47 48 111 112 113 114 74 75 133 134 135 136 80 81 137 138 139 140

View File

@ -0,0 +1,2 @@
25
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

View File

@ -0,0 +1,2 @@
25
13 14 15 16 26 27 28 29 30 31 32 33 34 35 36 37 23 24 25 38 39 40 41 42 43

View File

@ -0,0 +1,2 @@
25
4 44 45 46 8 47 48 49 12 50 51 52 16 53 54 55 19 56 57 22 58 59 25 60 61

View File

@ -0,0 +1,2 @@
25
16 53 54 55 29 62 63 64 33 65 66 67 37 68 69 70 25 60 61 40 71 72 43 73 74

View File

@ -0,0 +1,2 @@
48
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48

View File

@ -0,0 +1,2 @@
46
24 25 26 27 28 29 30 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 43 44 45 46 47 48 70 71 72 73 74 75 76 77 78 79 80 81

View File

@ -0,0 +1,2 @@
46
29 30 22 23 14 15 7 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 47 48 41 42 35 36 103 104 105 106 107 108 109 110 111 112 113 114

View File

@ -0,0 +1,2 @@
50
29 30 82 83 89 90 96 97 54 55 115 116 117 118 119 120 61 62 121 122 123 124 125 126 68 69 127 128 129 130 131 132 47 48 103 104 109 110 74 75 133 134 135 136 80 81 137 138 139 140

View File

@ -0,0 +1,2 @@
25
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

View File

@ -0,0 +1,2 @@
25
13 14 15 16 26 27 28 29 30 31 32 33 34 35 36 37 23 24 25 38 39 40 41 42 43

View File

@ -0,0 +1,2 @@
25
16 12 8 4 44 45 46 47 48 49 50 51 52 53 54 55 25 22 19 56 57 58 59 60 61

View File

@ -0,0 +1,2 @@
25
16 44 48 52 29 62 63 64 33 65 66 67 37 68 69 70 25 56 59 40 71 72 43 73 74

View File

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<simulation>
<!-- General - geometry definitions !-->
<geometry>
<partitioning procs="4" nperproc="1"/>
<patchfile>src/ASM/Test/refdata/square-4-orient0.g2</patchfile>
<refine patch="1" u="1" v="1"/>
<refine patch="2" u="1" v="1"/>
<refine patch="3" u="1" v="1"/>
<refine patch="4" u="1" v="1"/>
<topology>
<connection master="1" medge="4" slave="2" sedge="3"/>
<connection master="1" medge="2" slave="3" sedge="1"/>
<connection master="2" medge="2" slave="4" sedge="1"/>
<connection master="3" medge="4" slave="4" sedge="3"/>
</topology>
<topologysets>
<set name="dir" type="vertex">
<item patch="1">2</item>
<item patch="1">3</item>
</set>
<set name="dir" type="edge">
<item patch="2">1</item>
<item patch="3">3</item>
</set>
</topologysets>
</geometry>
<boundaryconditions>
<dirichlet set="dir" basis="1" comp="1"/>
</boundaryconditions>
</simulation>

View File

@ -0,0 +1,2 @@
16
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

View File

@ -0,0 +1,2 @@
15
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26

View File

@ -0,0 +1,2 @@
15
5 27 28 10 11 29 30 31 32 15 16 33 34 35 36

View File

@ -0,0 +1,2 @@
18
15 16 33 34 35 36 20 21 37 38 39 40 25 26 41 42 43 44

View File

@ -0,0 +1,2 @@
9
1 2 3 4 5 6 7 8 9

View File

@ -0,0 +1,2 @@
9
7 8 9 10 11 12 13 14 15

View File

@ -0,0 +1,2 @@
9
3 16 17 6 18 19 9 20 21

View File

@ -0,0 +1,2 @@
9
9 20 21 12 22 23 15 24 25

View File

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<simulation>
<!-- General - geometry definitions !-->
<geometry>
<partitioning procs="4" nperproc="1"/>
<patchfile>src/ASM/Test/refdata/square-4-orient1.g2</patchfile>
<refine patch="1" u="1" v="1"/>
<refine patch="2" u="1" v="1"/>
<refine patch="3" u="1" v="1"/>
<refine patch="4" u="1" v="1"/>
<topology>
<connection master="1" medge="4" slave="2" sedge="3"/>
<connection master="1" medge="2" slave="3" sedge="3" reverse="true"/>
<connection master="2" medge="2" slave="4" sedge="1"/>
<connection master="3" medge="1" slave="4" sedge="3"/>
</topology>
<topologysets>
<set name="dir" type="vertex">
<item patch="1">2</item>
<item patch="1">3</item>
</set>
<set name="dir" type="edge">
<item patch="2">1</item>
<item patch="3">2</item>
</set>
</topologysets>
</geometry>
<boundaryconditions>
<dirichlet set="dir" basis="1" comp="1"/>
</boundaryconditions>
</simulation>

View File

@ -0,0 +1,2 @@
16
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

View File

@ -0,0 +1,2 @@
15
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26

View File

@ -0,0 +1,2 @@
15
15 16 10 11 5 27 28 29 30 31 32 33 34 35 36

View File

@ -0,0 +1,2 @@
18
15 16 27 28 32 33 20 21 37 38 39 40 25 26 41 42 43 44

View File

@ -0,0 +1,2 @@
9
1 2 3 4 5 6 7 8 9

View File

@ -0,0 +1,2 @@
9
7 8 9 10 11 12 13 14 15

View File

@ -0,0 +1,2 @@
9
9 6 3 16 17 18 19 20 21

View File

@ -0,0 +1,2 @@
9
9 16 19 12 22 23 15 24 25

View File

@ -0,0 +1,72 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<simulation>
<!-- General - geometry definitions !-->
<geometry>
<partitioning procs="4" nperproc="2"/>
<patchfile>src/ASM/Test/refdata/cube-8-orient0.g2</patchfile>
<refine patch="1" u="1" v="1" w="1"/>
<refine patch="2" u="1" v="1" w="1"/>
<refine patch="3" u="1" v="1" w="1"/>
<refine patch="4" u="1" v="1" w="1"/>
<refine patch="5" u="1" v="1" w="1"/>
<refine patch="6" u="1" v="1" w="1"/>
<refine patch="7" u="1" v="1" w="1"/>
<refine patch="8" u="1" v="1" w="1"/>
<topology>
<connection master="1" mface="2" slave="2" sface="1"/>
<connection master="1" mface="4" slave="3" sface="3"/>
<connection master="1" mface="6" slave="5" sface="5"/>
<connection master="2" mface="4" slave="4" sface="3"/>
<connection master="2" mface="6" slave="6" sface="5"/>
<connection master="3" mface="2" slave="4" sface="1"/>
<connection master="3" mface="6" slave="7" sface="5"/>
<connection master="4" mface="6" slave="8" sface="5"/>
<connection master="5" mface="2" slave="6" sface="1"/>
<connection master="5" mface="4" slave="7" sface="3"/>
<connection master="6" mface="4" slave="8" sface="3"/>
<connection master="7" mface="2" slave="8" sface="1"/>
</topology>
<topologysets>
<set name="fixX" type="face">
<item patch="1">3</item>
<item patch="2">3</item>
<item patch="5">3</item>
<item patch="6">3</item>
</set>
<set name="fixY" type="face">
<item patch="5">6</item>
<item patch="6">6</item>
<item patch="7">6</item>
<item patch="8">6</item>
</set>
<set name="fixZ" type="face">
<item patch="2">2</item>
<item patch="4">2</item>
<item patch="6">2</item>
<item patch="8">2</item>
</set>
</topologysets>
</geometry>
<boundaryconditions>
<dirichlet set="fixX" comp="1" basis="1"/>
<dirichlet set="fixY" comp="2" basis="1"/>
<dirichlet set="fixZ" comp="3" basis="1"/>
</boundaryconditions>
<linearsolver>
<block basis="1" components="123"/>
<block basis="1" components="4"/>
</linearsolver>
</simulation>

View File

@ -0,0 +1,2 @@
337
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337

View File

@ -0,0 +1,2 @@
365
33 34 35 36 37 38 39 40 41 42 43 44 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 77 78 79 80 81 82 83 84 85 86 87 88 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 121 122 123 124 125 126 127 128 129 130 131 132 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 165 166 167 168 169 170 171 172 173 174 175 176 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 183 184 185 482 483 484 485 486 487 192 193 194 488 489 490 491 492 493 201 202 203 494 495 496 497 498 499 225 226 227 228 229 230 231 232 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 254 255 256 257 258 259 260 261 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 283 284 285 286 287 288 289 290 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 312 313 314 315 316 317 318 319 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 324 325 596 597 598 599 330 331 600 601 602 603 336 337 604 605 606 607

View File

@ -0,0 +1,2 @@
309
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 195 196 197 198 199 200 201 202 203 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 332 333 334 335 336 337 817 818 819 820 821 822 823 824 825 826 827 828

View File

@ -0,0 +1,2 @@
337
165 166 167 168 169 170 171 172 173 174 175 176 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 640 641 642 643 644 645 646 647 648 649 650 651 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 684 685 686 687 688 689 690 691 692 693 694 695 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 716 717 718 719 720 721 722 723 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 201 202 203 494 495 496 497 498 499 730 731 732 925 926 927 928 929 930 739 740 741 931 932 933 934 935 936 312 313 314 315 316 317 318 319 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 763 764 765 766 767 768 769 770 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 792 793 794 795 796 797 798 799 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 812 813 814 815 816 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 336 337 604 605 606 607 821 822 1000 1001 1002 1003 827 828 1004 1005 1006 1007

View File

@ -0,0 +1,2 @@
157
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157

View File

@ -0,0 +1,2 @@
157
13 14 15 16 158 159 160 161 162 163 164 165 166 167 168 169 29 30 31 32 170 171 172 173 174 175 176 177 178 179 180 181 45 46 47 48 182 183 184 185 186 187 188 189 190 191 192 193 61 62 63 64 194 195 196 197 198 199 200 201 202 203 204 205 71 72 73 206 207 208 209 210 211 80 81 82 212 213 214 215 216 217 89 90 91 218 219 220 221 222 223 101 102 103 224 225 226 227 228 229 230 231 232 113 114 115 233 234 235 236 237 238 239 240 241 125 126 127 242 243 244 245 246 247 248 249 250 137 138 139 251 252 253 254 255 256 257 258 259 144 145 260 261 262 263 150 151 264 265 266 267 156 157 268 269 270 271

View File

@ -0,0 +1,2 @@
157
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 83 84 85 86 87 88 89 90 91 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 128 129 130 131 132 133 134 135 136 137 138 139 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 152 153 154 155 156 157 374 375 376 377 378 379 380 381 382 383 384 385

View File

@ -0,0 +1,2 @@
157
61 62 63 64 194 195 196 197 198 199 200 201 202 203 204 205 284 285 286 287 386 387 388 389 390 391 392 393 394 395 396 397 300 301 302 303 398 399 400 401 402 403 404 405 406 407 408 409 316 317 318 319 410 411 412 413 414 415 416 417 418 419 420 421 89 90 91 218 219 220 221 222 223 326 327 328 422 423 424 425 426 427 335 336 337 428 429 430 431 432 433 137 138 139 251 252 253 254 255 256 257 258 259 347 348 349 434 435 436 437 438 439 440 441 442 359 360 361 443 444 445 446 447 448 449 450 451 371 372 373 452 453 454 455 456 457 458 459 460 156 157 268 269 270 271 378 379 461 462 463 464 384 385 465 466 467 468

View File

@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<simulation>
<!-- General - geometry definitions !-->
<geometry>
<partitioning procs="4" nperproc="2"/>
<patchfile>src/ASM/Test/refdata/cube-8-orient0.g2</patchfile>
<refine patch="1" u="1" v="1" w="1"/>
<refine patch="2" u="1" v="1" w="1"/>
<refine patch="3" u="1" v="1" w="1"/>
<refine patch="4" u="1" v="1" w="1"/>
<refine patch="5" u="1" v="1" w="1"/>
<refine patch="6" u="1" v="1" w="1"/>
<refine patch="7" u="1" v="1" w="1"/>
<refine patch="8" u="1" v="1" w="1"/>
<topology>
<connection master="1" mface="2" slave="2" sface="1"/>
<connection master="1" mface="4" slave="3" sface="3"/>
<connection master="1" mface="6" slave="5" sface="5"/>
<connection master="2" mface="4" slave="4" sface="3"/>
<connection master="2" mface="6" slave="6" sface="5"/>
<connection master="3" mface="2" slave="4" sface="1"/>
<connection master="3" mface="6" slave="7" sface="5"/>
<connection master="4" mface="6" slave="8" sface="5"/>
<connection master="5" mface="2" slave="6" sface="1"/>
<connection master="5" mface="4" slave="7" sface="3"/>
<connection master="6" mface="4" slave="8" sface="3"/>
<connection master="7" mface="2" slave="8" sface="1"/>
</topology>
<topologysets>
<set name="fixX" type="face">
<item patch="1">3</item>
<item patch="2">3</item>
<item patch="5">3</item>
<item patch="6">3</item>
</set>
<set name="fixY" type="face">
<item patch="5">6</item>
<item patch="6">6</item>
<item patch="7">6</item>
<item patch="8">6</item>
</set>
<set name="fixZ" type="face">
<item patch="2">2</item>
<item patch="4">2</item>
<item patch="6">2</item>
<item patch="8">2</item>
</set>
</topologysets>
</geometry>
<boundaryconditions>
<dirichlet set="fixX" comp="1" basis="1"/>
<dirichlet set="fixY" comp="2" basis="1"/>
<dirichlet set="fixZ" comp="3" basis="1"/>
</boundaryconditions>
</simulation>

View File

@ -0,0 +1,2 @@
111
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111

View File

@ -0,0 +1,2 @@
126
16 17 18 19 20 21 22 23 24 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 40 41 42 43 44 45 46 47 48 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 64 65 66 67 68 69 70 71 72 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 81 82 83 84 85 166 167 168 169 170 171 172 173 174 175 94 95 96 97 98 176 177 178 179 180 181 182 183 184 185 107 108 109 110 111 186 187 188 189 190 191 192 193 194 195

View File

@ -0,0 +1,2 @@
96
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 99 100 101 102 103 104 105 106 107 108 109 110 111 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254

View File

@ -0,0 +1,2 @@
111
64 65 66 67 68 69 70 71 72 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 211 212 213 214 215 216 217 218 219 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 229 230 231 232 233 234 273 274 275 276 277 278 279 280 281 282 283 284 107 108 109 110 111 186 187 188 189 190 191 192 193 194 195 243 244 245 246 247 285 286 287 288 289 290 291 292 293 294 252 253 254 295 296 297 298 299 300

View File

@ -0,0 +1,2 @@
45
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45

View File

@ -0,0 +1,2 @@
45
7 8 9 46 47 48 49 50 51 16 17 18 52 53 54 55 56 57 25 26 27 58 59 60 61 62 63 32 33 64 65 66 67 38 39 68 69 70 71 44 45 72 73 74 75

View File

@ -0,0 +1,2 @@
45
19 20 21 22 23 24 25 26 27 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 40 41 42 43 44 45 94 95 96 97 98 99 100 101 102 103 104 105

View File

@ -0,0 +1,2 @@
45
25 26 27 58 59 60 61 62 63 82 83 84 106 107 108 109 110 111 91 92 93 112 113 114 115 116 117 44 45 72 73 74 75 98 99 118 119 120 121 104 105 122 123 124 125

View File

@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<simulation>
<!-- General - geometry definitions !-->
<geometry>
<partitioning procs="4" nperproc="2"/>
<patchfile>src/ASM/Test/refdata/cube-8-orient1.g2</patchfile>
<refine patch="1" u="1" v="1" w="1"/>
<refine patch="2" u="1" v="1" w="1"/>
<refine patch="3" u="1" v="1" w="1"/>
<refine patch="4" u="1" v="1" w="1"/>
<refine patch="5" u="1" v="1" w="1"/>
<refine patch="6" u="1" v="1" w="1"/>
<refine patch="7" u="1" v="1" w="1"/>
<refine patch="8" u="1" v="1" w="1"/>
<topology>
<connection master="1" mface="2" slave="2" sface="1" orient="3"/>
<connection master="1" mface="4" slave="3" sface="3"/>
<connection master="1" mface="6" slave="5" sface="5"/>
<connection master="2" mface="3" slave="4" sface="3" orient="1"/>
<connection master="2" mface="5" slave="6" sface="5" orient="1"/>
<connection master="3" mface="2" slave="4" sface="1"/>
<connection master="3" mface="6" slave="7" sface="5"/>
<connection master="4" mface="6" slave="8" sface="5"/>
<connection master="5" mface="2" slave="6" sface="1"/>
<connection master="5" mface="4" slave="7" sface="3"/>
<connection master="6" mface="4" slave="8" sface="3"/>
<connection master="7" mface="2" slave="8" sface="1"/>
</topology>
<topologysets>
<set name="fixX" type="face">
<item patch="1">3</item>
<item patch="2">4</item>
<item patch="5">3</item>
<item patch="6">3</item>
</set>
<set name="fixY" type="face">
<item patch="5">6</item>
<item patch="6">6</item>
<item patch="7">6</item>
<item patch="8">6</item>
</set>
<set name="fixZ" type="face">
<item patch="2">2</item>
<item patch="4">2</item>
<item patch="6">2</item>
<item patch="8">2</item>
</set>
</topologysets>
</geometry>
<boundaryconditions>
<dirichlet set="fixX" comp="1" basis="1"/>
<dirichlet set="fixY" comp="2" basis="1"/>
<dirichlet set="fixZ" comp="3" basis="1"/>
</boundaryconditions>
</simulation>

View File

@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<simulation>
<!-- General - geometry definitions !-->
<geometry>
<partitioning procs="4" nperproc="2"/>
<patchfile>src/ASM/Test/refdata/cube-8-orient10.g2</patchfile>
<refine patch="1" u="1" v="1" w="1"/>
<refine patch="2" u="1" v="1" w="1"/>
<refine patch="3" u="1" v="1" w="1"/>
<refine patch="4" u="1" v="1" w="1"/>
<refine patch="5" u="1" v="1" w="1"/>
<refine patch="6" u="1" v="1" w="1"/>
<refine patch="7" u="1" v="1" w="1"/>
<refine patch="8" u="1" v="1" w="1"/>
<topology>
<connection master="1" mface="6" slave="2" sface="5"/>
<connection master="1" mface="4" slave="3" sface="3"/>
<connection master="1" mface="2" slave="5" sface="1"/>
<connection master="2" mface="4" slave="4" sface="3" orient="5"/>
<connection master="2" mface="2" slave="6" sface="1"/>
<connection master="3" mface="6" slave="4" sface="1" orient="5"/>
<connection master="3" mface="2" slave="7" sface="1"/>
<connection master="4" mface="5" slave="8" sface="1" orient="4"/>
<connection master="5" mface="6" slave="6" sface="5"/>
<connection master="5" mface="4" slave="7" sface="3"/>
<connection master="6" mface="4" slave="8" sface="3"/>
<connection master="7" mface="6" slave="8" sface="5"/>
</topology>
<topologysets>
<set name="fixX" type="face">
<item patch="1">3</item>
<item patch="2">3</item>
<item patch="5">3</item>
<item patch="6">3</item>
</set>
<set name="fixY" type="face">
<item patch="2">6</item>
<item patch="4">2</item>
<item patch="6">6</item>
<item patch="8">6</item>
</set>
<set name="fixZ" type="face">
<item patch="5">2</item>
<item patch="6">2</item>
<item patch="7">2</item>
<item patch="8">2</item>
</set>
</topologysets>
</geometry>
<boundaryconditions>
<dirichlet set="fixX" comp="1" basis="1"/>
<dirichlet set="fixY" comp="2" basis="1"/>
<dirichlet set="fixZ" comp="3" basis="1"/>
</boundaryconditions>
</simulation>

View File

@ -0,0 +1,2 @@
111
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111

View File

@ -0,0 +1,2 @@
126
16 17 18 19 20 21 22 23 24 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 40 41 42 43 44 45 46 47 48 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 64 65 66 67 68 69 70 71 72 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 94 95 96 110 111 166 167 168 169 170 171 172 173 174 175 91 92 93 108 109 176 177 178 179 180 181 182 183 184 185 88 89 90 106 107 186 187 188 189 190 191 192 193 194 195

View File

@ -0,0 +1,2 @@
96
5 6 196 197 198 13 14 15 199 200 201 202 203 22 23 24 204 205 206 207 208 29 30 209 210 211 37 38 39 212 213 214 215 216 46 47 48 217 218 219 220 221 53 54 222 223 224 61 62 63 225 226 227 228 229 70 71 72 230 231 232 233 234 77 78 235 236 237 85 86 87 238 239 240 241 242 94 95 96 243 244 245 246 247 99 248 104 105 249 250 251 110 111 252 253 254

Some files were not shown because too many files have changed in this diff Show More