Commit 1829f405 authored by Thomas Witkowski's avatar Thomas Witkowski
Browse files

Deleted not used files. Moved compisteFEM to src directory. Work on Makefiles.

parent 1efe388f
......@@ -230,7 +230,7 @@ namespace AMDiS {
}
/// Returns \ref parametric
inline bool getParametric()
inline bool getParametric() const
{
return parametric;
}
......
......@@ -2,10 +2,8 @@ lib_LTLIBRARIES = libamdis.la libcompositeFEM.la
LIB_DIR = ../lib
PARALLEL_DIR = $(SOURCE_DIR)
PARMETIS_DIR = ../lib/ParMetis-3.1
AMDIS_INCLUDES = -I$(SOURCE_DIR)
AMDIS_INCLUDES =
libamdis_la_CXXFLAGS =
......@@ -14,18 +12,17 @@ PARALLEL_INCLUDES =
if USE_PARALLEL_DOMAIN_AMDIS
PARALLEL_AMDIS_SOURCES += \
parallel/StdMpi.h parallel/StdMpi.cc \
parallel/ParMetisPartitioner.h parallel/ParMetisPartitioner.cc \
parallel/ZoltanPartitioner.h parallel/ZoltanPartitioner.cc \
parallel/MeshDistributor.h parallel/MeshDistributor.cc \
parallel/MeshPartitioner.h parallel/MeshPartitioner.cc \
parallel/MeshManipulation.h parallel/MeshManipulation.cc \
parallel/ParallelDebug.h parallel/ParallelDebug.cc \
parallel/ParallelProblemStatBase.h \
parallel/ElementObjectData.cc \
parallel/MeshDistributor.cc \
parallel/MeshManipulation.cc \
parallel/MeshPartitioner.cc \
parallel/MpiHelper.cc \
parallel/ParallelDebug.cc \
parallel/ParallelProblemStatBase.cc \
parallel/PetscSolver.h parallel/PetscSolver.cc \
parallel/MpiHelper.h parallel/MpiHelper.cc \
parallel/ElementObjectData.h parallel/ElementObjectData.cc
parallel/ParMetisPartitioner.cc \
parallel/PetscSolver.cc \
parallel/StdMpi.cc \
parallel/ZoltanPartitioner.cc
libamdis_la_CXXFLAGS += -DHAVE_PARALLEL_DOMAIN_AMDIS=1
AMDIS_INCLUDES += -I$(PARMETIS_DIR)
AMDIS_INCLUDES += -I$(PETSC_DIR)/include -I$(PETSC_DIR)/$(PETSC_ARCH)/include
......@@ -136,7 +133,6 @@ MatrixVector.h \
Mesh.h \
MeshStructure.h \
MeshStructure_ED.h \
MpCCIAdapter.h \
Newton.h \
Newton.hh \
NewtonS.h \
......@@ -152,8 +148,6 @@ OperatorTerm.h \
OperatorTerm.hh \
Parameters.h \
Parametric.h \
PardisoSolver.h \
PardisoSolver.hh \
PeriodicBC.h \
PeriodicConnection.h \
PeriodicInfo.h \
......@@ -185,7 +179,6 @@ ResidualEstimator.h \
ResidualParallelEstimator.h \
RobinBC.h \
RobinBC.hh \
SMIAdapter.h \
ScalableQuadrature.h \
SecondOrderAssembler.h \
SecondOrderTerm.h \
......@@ -214,6 +207,17 @@ VertexInfo.h \
VertexVector.h \
ZeroOrderAssembler.h \
ZeroOrderTerm.h \
compositeFEM/CFE_Integration.h \
compositeFEM/CFE_NormAndErrorFcts.h \
compositeFEM/CompositeFEMMethods.h \
compositeFEM/CompositeFEMOperator.h \
compositeFEM/ElementLevelSet.h \
compositeFEM/LevelSetAdaptMesh.h \
compositeFEM/PenaltyOperator.h \
compositeFEM/SubElementAssembler.h \
compositeFEM/SubPolytope.h \
compositeFEM/TranslateLsFct.h \
compositeFEM/compositeFEM.h \
io/ArhReader.h \
io/ArhWriter.h \
io/DataCollector.h \
......@@ -228,141 +232,148 @@ io/MacroReader.h \
io/MacroWriter.h \
io/PngWriter.h \
io/PovrayWriter.h \
io/ValueReader.h \
io/ValueReader.h \
io/ValueWriter.h \
io/VtkWriter.h \
io/VtkWriter.hh \
itl/minres.hpp \
parallel/ElementObjectData.h \
parallel/InteriorBoundary.h \
parallel/MeshDistributor.h \
parallel/MeshManipulation.h \
parallel/MeshPartitioner.h \
parallel/MpiHelper.h \
parallel/ParallelDebug.h \
parallel/ParallelProblemStatBase.h \
parallel/ParMetisPartitioner.h \
parallel/PetscSolver.h \
parallel/StdMpi.h \
parallel/ZoltanPartitioner.h \
time/RosenbrockAdaptInstationary.h \
time/RosenbrockStationary.h \
time/RosenbrockMethod.h
libamdis_la_SOURCES = \
$(PARALLEL_AMDIS_SOURCES) \
DOFIndexed.cc \
io/GNUPlotWriter.cc \
VertexVector.cc \
PeriodicBC.cc \
Recovery.cc \
RecoveryEstimator.cc \
ResidualEstimator.cc \
Cholesky.cc \
AdaptBase.cc \
StandardProblemIteration.cc \
ProblemScal.cc \
ProblemVec.cc \
ProblemVecDbg.cc \
DualTraverse.cc \
ElementData.cc \
ComponentTraverseInfo.cc \
CreatorMap.cc \
ProblemInterpolScal.cc \
ProblemInterpolVec.cc \
Serializer.cc \
io/MacroInfo.cc \
io/MacroReader.cc \
io/ValueReader.cc \
Projection.cc \
SubAssembler.cc \
ZeroOrderAssembler.cc \
FirstOrderAssembler.cc \
SecondOrderAssembler.cc \
Assembler.cc \
AdaptInfo.cc \
Marker.cc \
SurfaceQuadrature.cc \
LeafData.cc \
BoundaryManager.cc \
DirichletBC.cc \
RobinBC.cc \
io/FileWriter.cc \
io/ElementFileWriter.cc \
ElInfo.cc \
ElInfoStack.cc \
OperatorTerm.cc \
ZeroOrderTerm.cc \
FirstOrderTerm.cc \
SecondOrderTerm.cc \
Operator.cc \
Mesh.cc \
MeshStructure.cc \
AdaptStationary.cc \
AdaptInstationary.cc \
DOFVector.cc \
Estimator.cc \
ProblemInstat.cc \
ProblemNonLin.cc \
NonLinUpdater.cc \
QPsiPhi.cc \
AdaptStationary.cc \
Assembler.cc \
BasisFunction.cc \
Boundary.cc \
BoundaryManager.cc \
Cholesky.cc \
CoarseningManager.cc \
CoarseningManager1d.cc \
CoarseningManager2d.cc \
CoarseningManager3d.cc \
ComponentTraverseInfo.cc \
CreatorMap.cc \
DOFAdmin.cc \
DOFIndexed.cc \
DOFMatrix.cc \
Element.cc \
DOFVector.cc \
Debug.cc \
DirichletBC.cc \
DualTraverse.cc \
ElInfo.cc \
ElInfo1d.cc \
ElInfo2d.cc \
ElInfo3d.cc \
ElInfoStack.cc \
Element.cc \
ElementData.cc \
ElementDofIterator.cc \
Estimator.cc \
FiniteElemSpace.cc \
FirstOrderAssembler.cc \
FirstOrderTerm.cc \
FixVec.cc \
Global.cc \
GlobalDOFNumbering.cc \
GlobalElementNumbering.cc \
Lagrange.cc \
LeafData.cc \
Line.cc \
MacroElement.cc \
io/MacroWriter.cc \
Marker.cc \
Mesh.cc \
MeshStructure.cc \
NonLinUpdater.cc \
Operator.cc \
OperatorTerm.cc \
Parameters.cc \
Parametric.cc \
PeriodicBC.cc \
ProblemImplicit.cc \
ProblemInstat.cc \
ProblemInterpolScal.cc \
ProblemInterpolVec.cc \
ProblemNonLin.cc \
ProblemScal.cc \
ProblemVec.cc \
ProblemVecDbg.cc \
Projection.cc \
QPInfo.cc \
QPsiPhi.cc \
Quadrature.cc \
RCNeighbourList.cc \
Recovery.cc \
RecoveryEstimator.cc \
RefinementManager.cc \
RefinementManager1d.cc \
RefinementManager2d.cc \
RefinementManager3d.cc \
ResidualEstimator.cc \
ResidualParallelEstimator.cc \
RobinBC.cc \
ScalableQuadrature.cc \
SecondOrderAssembler.cc \
SecondOrderTerm.cc \
Serializer.cc \
StandardProblemIteration.cc \
SubAssembler.cc \
SubElInfo.cc \
SubQuadrature.cc \
SurfaceQuadrature.cc \
Tetrahedron.cc \
Traverse.cc \
TraverseParallel.cc \
Triangle.cc \
io/ValueWriter.cc \
io/VtkWriter.cc \
VertexVector.cc \
ZeroOrderAssembler.cc \
ZeroOrderTerm.cc \
io/ArhReader.cc \
io/ArhWriter.cc \
io/DataCollector.cc \
io/DofWriter.cc \
io/ElementFileWriter.cc \
io/FileWriter.cc \
io/GNUPlotWriter.cc \
io/MacroInfo.cc \
io/MacroReader.cc \
io/MacroWriter.cc \
io/PngWriter.cc \
io/PovrayWriter.cc \
io/DataCollector.cc \
ScalableQuadrature.cc \
SubElInfo.cc \
ElementDofIterator.cc \
parallel/InteriorBoundary.cc \
Debug.cc \
io/ArhReader.cc \
io/ArhWriter.cc \
io/ValueReader.cc \
io/ValueWriter.cc \
io/VtkWriter.cc \
time/RosenbrockAdaptInstationary.cc \
time/RosenbrockStationary.cc \
time/RosenbrockMethod.cc
COMPOSITE_SOURCE_DIR = ../compositeFEM/src
time/RosenbrockMethod.cc \
time/RosenbrockStationary.cc
libcompositeFEM_la_CXXFLAGS = $(libamdis_la_CXXFLAGS)
libcompositeFEM_la_SOURCES = $(COMPOSITE_SOURCE_DIR)/CFE_Integration.h \
$(COMPOSITE_SOURCE_DIR)/CFE_Integration.cc \
$(COMPOSITE_SOURCE_DIR)/CFE_NormAndErrorFcts.h \
$(COMPOSITE_SOURCE_DIR)/CFE_NormAndErrorFcts.cc \
$(COMPOSITE_SOURCE_DIR)/CompositeFEMMethods.h \
$(COMPOSITE_SOURCE_DIR)/CompositeFEMMethods.cc \
$(COMPOSITE_SOURCE_DIR)/LevelSetAdaptMesh.h \
$(COMPOSITE_SOURCE_DIR)/LevelSetAdaptMesh.cc \
$(COMPOSITE_SOURCE_DIR)/PenaltyOperator.h \
$(COMPOSITE_SOURCE_DIR)/PenaltyOperator.cc \
$(COMPOSITE_SOURCE_DIR)/ElementLevelSet.h \
$(COMPOSITE_SOURCE_DIR)/ElementLevelSet.cc \
$(COMPOSITE_SOURCE_DIR)/CompositeFEMOperator.h \
$(COMPOSITE_SOURCE_DIR)/CompositeFEMOperator.cc \
$(COMPOSITE_SOURCE_DIR)/SubPolytope.h $(COMPOSITE_SOURCE_DIR)/SubPolytope.cc \
$(COMPOSITE_SOURCE_DIR)/SubElementAssembler.h \
$(COMPOSITE_SOURCE_DIR)/SubElementAssembler.cc \
$(COMPOSITE_SOURCE_DIR)/TranslateLsFct.h
libcompositeFEM_la_CXXFLAGS = $(libamdis_la_CXXFLAGS)
libcompositeFEM_la_SOURCES = \
compositeFEM/CFE_Integration.cc \
compositeFEM/CFE_NormAndErrorFcts.cc \
compositeFEM/CompositeFEMMethods.cc \
compositeFEM/CompositeFEMOperator.cc \
compositeFEM/ElementLevelSet.cc \
compositeFEM/LevelSetAdaptMesh.cc \
compositeFEM/PenaltyOperator.cc \
compositeFEM/SubElementAssembler.cc \
compositeFEM/SubPolytope.cc
This source diff could not be displayed because it is too large. You can view the blob instead.
//
// Software License for AMDiS
//
// Copyright (c) 2010 Dresden University of Technology
// All rights reserved.
// Authors: Simon Vey, Thomas Witkowski et al.
//
// This file is part of AMDiS
//
// See also license.opensource.txt in the distribution.
#include "MpCCIAdapter.h"
#include "FiniteElemSpace.h"
#include "SMIAdapter.h"
#include "DOFVector.h"
#include "mpi.h"
namespace AMDiS
{
MpCCIAdapter::MpCCIAdapter(int localComm,
int meshID,
int partitionID,
bool useMPI,
FiniteElemSpace *feSpace,
int elementRegion,
int surfaceRegion,
int numQuantities,
int *quantityIDs,
int *quantityDims,
DOFVector<double> **dofVectors,
int numSyncPoints,
int *syncPointIDs,
const char *idString,
bool (*elementFct)(ElInfo *elInfo),
bool (*surfaceFct)(ElInfo *elInfo, int side))
: localComm_(localComm),
feSpace_(feSpace),
applicationID_(1),
meshID_(meshID),
partitionID_(partitionID),
useMPI_(useMPI)
{
FUNCNAME("MpCCIAdapter::MpCCIAdapter()");
int i;
mpiRank_ = useMPI_ ? MPI::COMM_WORLD.Get_rank() : 0;
mpiSize_ = useMPI_ ? MPI::COMM_WORLD.Get_size() : 1;
TEST_EXIT(surfaceRegion == -1)("not yet for surface regions\n");
// create SMI adapter
smiAdapter_ = new SMIAdapter(applicationID_,
meshID_,
feSpace_,
elementRegion,
surfaceRegion,
elementFct,
surfaceFct);
// MpCCI initialize
//if(useMPI_) MPI::COMM_WORLD.Barrier();
//if(mpiRank_ == 0) {
int error;
if (idString) {
error = CCI_Init_with_id_string(NULL, NULL, idString);
TEST_EXIT(error == 0)
("CCI_Init_with_id_string() failed\n");
} else {
error = CCI_Init(NULL, NULL);
TEST_EXIT(error == 0)("CCI_Init() failed\n");
}
//}
//if(useMPI_) MPI::COMM_WORLD.Barrier();
//}
//if(useMPI_) MPI::COMM_WORLD.Barrier();
localCodeID_ = CCI_MYCODEID;
int remoteCodeID = (localCodeID_ == 1) ? 2 : 1;
// define communicator
int sendQuantities[CCI_MAX_NQUANTITIES];
int sendMeshes[CCI_MAX_NQUANTITIES];
int sendNQuantities;
int recvQuantities[CCI_MAX_NQUANTITIES];
int recvMeshes[CCI_MAX_NQUANTITIES];
int recvNQuantities;
if(localComm == -1) {
localComm_ = CCI_COMM_RCODE[remoteCodeID];
} else {
error = CCI_Comm_info(localComm_,
&remoteCodeID_,
&remoteComm_,
CCI_MAX_NQUANTITIES,
sendQuantities,
sendMeshes,
&sendNQuantities,
CCI_MAX_NQUANTITIES,
recvQuantities,
recvMeshes,
&recvNQuantities);
TEST_EXIT(error)("CCI_Comm_info() failed\n");
MSG("remote comm id: %d\n", remoteComm_);
error = CCI_Def_comm(localComm_,
remoteCodeID_,
remoteComm_,
numQuantities,
quantityIDs,
1,
&meshID_);
TEST_EXIT(error)("CCI_Def_comm() failed\n");
}
error = CCI_Def_partition(meshID_, partitionID_);
TEST_EXIT(error == 0)("CCI_Def_partition() failed\n");
transferMeshToMpCCI();
for (i = 0; i < numSyncPoints; i++) {
error = CCI_Sync_point_info(syncPointIDs[i],
CCI_MAX_NQUANTITIES,
sendQuantities,
sendMeshes,
&sendNQuantities,
CCI_MAX_NQUANTITIES,
recvQuantities,
recvMeshes,
&recvNQuantities);
TEST_EXIT(error == 0)("CCI_Sync_point_info() failed\n");
MSG("sync point id: %d\n", syncPointIDs[i]);
int j;
for(j = 0; j < sendNQuantities; j++) {
MSG("send quantity: %d\n", sendQuantities[j]);
}
for(j = 0; j < recvNQuantities; j++) {
MSG("recv quantity: %d\n", recvQuantities[j]);
}
error = CCI_Def_sync_point(syncPointIDs[i],
sendNQuantities,
sendQuantities,
sendNQuantities,
sendMeshes,
recvNQuantities,
recvQuantities,
recvNQuantities,
recvMeshes);
TEST_EXIT(error == 0)("CCI_Def_sync_point() failed\n");
}
// define quantities
DOFVector<double> **ptr = dofVectors;
for(i = 0; i < numQuantities; i++) {
int dim = quantityDims[i];
smiAdapter_->addQuantity(quantityIDs[i], dim, ptr);
ptr += dim;
}
// close MpCCI setup
int error = CCI_Close_setup(localCodeID_);
TEST_EXIT(error == 0)("CCI_Close_setup() failed\n");
}
MpCCIAdapter::~MpCCIAdapter()
{
delete smiAdapter_;
int error == CCI_Finalize();
TEST_EXIT(error == 0)("CCI_Finalize() failed\n");
}
void MpCCIAdapter::transferMeshToMpCCI()
{
// update SMI data
smiAdapter_->transferMeshToSMI();
// read SMI data
int error;
int dow = Global::getGeo(WORLD);
int dim = feSpace_->getMesh()->getDim();
int numNodes;
int *nodeIDs;
double *coords;
int numElems;
int *elemIDs;
int numElemNodeIDs;
int *elemNodeIDs;
int elemType;
int *nodesPerElem;
error = SMI_Begin_read_transaction(applicationID_, meshID_);
TEST_EXIT(error == SMI_OK)("SMI_Begin_read_transaction() failed\n");
error = SMI_Get_all_nodes(applicationID_,
meshID_,
&numNodes,
&nodeIDs);
TEST_EXIT(error == SMI_OK)("SMI_Get_all_nodes() failed\n");
coords = new double[numNodes * dow];
error = SMI_Get_nodes(applicationID_,
meshID_,
numNodes,
dow,
nodeIDs,
coords);
TEST_EXIT(error == SMI_OK)("SMI_Get_nodes() failed (%d)\n", error);
error = SMI_Get_all_elems(applicationID_,
meshID_,
&numElems,
&elemIDs);
TEST_EXIT(error == SMI_OK)("SMI_Get_all_elems() failed\n");
error = SMI_Get_elems(applicationID_,
meshID_,
numElems,
elemIDs,
&numElemNodeIDs,
&elemNodeIDs,
NULL,
NULL);
TEST_EXIT(error == SMI_OK)("SMI_Get_elems() failed\n");
switch(dim) {
case 1:
elemType = CCI_ELEM_LINE;
break;
case 2:
elemType = CCI_ELEM_TRIANGLE;
break;
case 3:
elemType = CCI_ELEM_TETRAHEDRON;
break;
default: ERROR_EXIT("invalid dim\n");
}
nodesPerElem = new int[numElems];
for (int i = 0; i < numElems; i++)
nodesPerElem[i] = dim + 1;
error = SMI_End_read_transaction(applicationID_, meshID_);
TEST_EXIT(error == SMI_OK)("SMI_End_read_transaction() failed\n");
// transfer data to MpCCI
error = CCI_Def_nodes(meshID_,
partitionID_,
dow,
numNodes,
numNodes,
nodeIDs,
CCI_DOUBLE,
coords);
TEST_EXIT(error == 0)("CCI_Def_nodes() failed\n");
error = CCI_Def_elems(meshID_,
partitionID_,
numElems,
numElems,
elemIDs,
1,
&elemType,
nodesPerElem,
elemNodeIDs);
TEST_EXIT(error == 0)("CCI_Def_elems() failed\n");
// free memory
delete [] coords;
delete [] nodesPerElem;
}
void MpCCIAdapter::remesh()
{
int error;
error = CCI_Remesh();
TEST_EXIT(error == 0)("CCI_Remesh() failed\n");
transferMeshToMpCCI();
int mode = CCI_TOTAL_REMESH;
error = CCI_Close_remesh(1, &meshID_, 1, &mode);
TEST_EXIT(error == 0)("CCI_Close_remesh() failed\n");
}
void MpCCIAdapter::checkConvergence(int myConvergence,