Commit 58aa7090 authored by Thomas Witkowski's avatar Thomas Witkowski

FETI-DP matrices are assembled now.

parent 28eb4386
......@@ -262,7 +262,7 @@ namespace AMDiS {
*/
int getDOFIndex();
/// Frees index dof. Used by Mesh::getDof()
/// Frees index DOF. Used by Mesh::getDof()
void freeDofIndex(int dof);
///
......@@ -287,10 +287,10 @@ namespace AMDiS {
/// allocated size of managed vectors and matrices
int size;
/// number of used dof indices
/// number of used DOF indices
int usedCount;
/// number of FREED dof indices (NOT size-sizeUsed)
/// number of FREED DOF indices (NOT size - sizeUsed)
int holeCount;
/// > max. index of a used entry
......@@ -302,7 +302,7 @@ namespace AMDiS {
*/
DimVec<int> nDof;
/// Dofs from previous DOFAdmins
/// DOFs from previous DOFAdmins
DimVec<int> nPreDof;
/// List of all managed DOFIndexed objects.
......
......@@ -1685,42 +1685,35 @@ namespace AMDiS {
recvDofs.clear();
if (createBoundaryDofFlag.isSet(BOUNDARY_SUBOBJ_SORTED)) {
DofContainer dofs;
for (int geo = FACE; geo >= VERTEX; geo--)
boundaryDofInfo.geoDofs[static_cast<GeoIndex>(geo)].clear();
for (int geo = FACE; geo >= VERTEX; geo--) {
std::set<const DegreeOfFreedom*> &dofSet =
boundaryDofInfo.geoDofs[static_cast<GeoIndex>(geo)];
dofSet.clear();
for (InteriorBoundary::iterator it(myIntBoundary); !it.end(); ++it) {
if (it->rankObj.subObj == geo) {
dofs.clear();
DofContainer dofs;
it->rankObj.el->getAllDofs(feSpace, it->rankObj, dofs);
DofContainer& tmp = sendDofs[it.getRank()];
tmp.insert(tmp.end(), dofs.begin(), dofs.end());
if (createBoundaryDofFlag.isSet(BOUNDARY_FILL_INFO_SEND_DOFS))
dofSet.insert(dofs.begin(), dofs.end());
boundaryDofInfo.geoDofs[static_cast<GeoIndex>(geo)].insert(dofs.begin(), dofs.end());
}
}
}
for (int geo = FACE; geo >= VERTEX; geo--) {
std::set<const DegreeOfFreedom*> &dofSet =
boundaryDofInfo.geoDofs[static_cast<GeoIndex>(geo)];
dofSet.clear();
for (InteriorBoundary::iterator it(otherIntBoundary); !it.end(); ++it) {
if (it->rankObj.subObj == geo) {
dofs.clear();
DofContainer dofs;
it->rankObj.el->getAllDofs(feSpace, it->rankObj, dofs);
DofContainer& tmp = recvDofs[it.getRank()];
tmp.insert(tmp.end(), dofs.begin(), dofs.end());
if (createBoundaryDofFlag.isSet(BOUNDARY_FILL_INFO_RECV_DOFS))
dofSet.insert(dofs.begin(), dofs.end());
boundaryDofInfo.geoDofs[static_cast<GeoIndex>(geo)].insert(dofs.begin(), dofs.end());
}
}
}
......
......@@ -33,11 +33,17 @@ namespace AMDiS {
using namespace std;
/// Defines set of DOF indices.
typedef std::set<DegreeOfFreedom> DofIndexSet;
/// Defines a mapping type from DOFs to rank numbers.
typedef map<const DegreeOfFreedom*, int> DofToRank;
/// Defines a mapping type from DOFs to a set of rank numbers.
typedef map<const DegreeOfFreedom*, std::set<int> > DofToPartitions;
/// Defines a mapping type from DOF indices to a set of rank numbers.
typedef map<DegreeOfFreedom, std::set<int> > DofIndexToPartitions;
/// Defines a mapping type from rank numbers to sets of DOFs.
typedef map<int, DofContainer> RankToDofContainer;
......
......@@ -46,7 +46,8 @@ namespace AMDiS {
{
public:
PetscSolver()
: meshDistributor(NULL)
: meshDistributor(NULL),
mpiRank(-1)
{}
virtual ~PetscSolver() {}
......@@ -54,6 +55,7 @@ namespace AMDiS {
void setMeshDistributor(MeshDistributor *m)
{
meshDistributor = m;
mpiRank = meshDistributor->getMpiRank();
}
/** \brief
......@@ -81,6 +83,8 @@ namespace AMDiS {
protected:
MeshDistributor *meshDistributor;
int mpiRank;
/// Petsc's matrix structure.
Mat petscMatrix;
......
This diff is collapsed.
......@@ -51,14 +51,58 @@ namespace AMDiS {
MeshDistributor::BOUNDARY_FILL_INFO_RECV_DOFS;
}
protected:
void updateDofData(int nComponents);
void updateDofData();
void definePrimals();
void createPrimals();
void createDuals();
void createLagrange();
void createIndexB();
void createMatLagrange(int nComponents);
protected:
DofContainerSet primals;
DofIndexSet primals;
DofMapping globalPrimalIndex;
int nRankPrimals;
int nOverallPrimals;
DofIndexSet duals;
DofMapping globalDualIndex;
DofIndexToPartitions boundaryDofRanks;
DofMapping dofFirstLagrange;
int nRankLagrange;
int nOverallLagrange;
DofMapping globalIndexB;
int nRankB;
int nOverallB;
int rStartB;
Mat mat_b_b;
Mat mat_primal_primal;
Mat mat_b_primal, mat_primal_b;
Mat mat_lagrange;
Vec vec_b;
Vec vec_primal;
};
#endif
......
......@@ -195,7 +195,7 @@ namespace AMDiS {
TEST_EXIT(mat)("No DOFMatrix!\n");
using mtl::tag::row; using mtl::tag::nz; using mtl::begin; using mtl::end;
namespace traits= mtl::traits;
namespace traits = mtl::traits;
typedef DOFMatrix::base_matrix_type Matrix;
traits::col<Matrix>::type col(mat->getBaseMatrix());
......@@ -408,8 +408,11 @@ namespace AMDiS {
}
void PetscSolverGlobalMatrix::setDofVector(Vec& petscVec, DOFVector<double>* vec,
int dispMult, int dispAdd, bool rankOnly)
void PetscSolverGlobalMatrix::setDofVector(Vec& petscVec,
DOFVector<double>* vec,
int dispMult,
int dispAdd,
bool rankOnly)
{
FUNCNAME("PetscSolverGlobalMatrix::setDofVector()");
......
This diff is collapsed.
This diff is collapsed.
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