Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Backofen, Rainer
amdis
Commits
cd344056
Commit
cd344056
authored
Mar 24, 2009
by
Thomas Witkowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Nothing important
parent
41774d49
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
236 additions
and
457 deletions
+236
-457
AMDiS/src/ElementFileWriter.cc
AMDiS/src/ElementFileWriter.cc
+23
-14
AMDiS/src/ElementFileWriter.h
AMDiS/src/ElementFileWriter.h
+22
-50
AMDiS/src/FileWriter.h
AMDiS/src/FileWriter.h
+5
-5
AMDiS/src/Mesh.h
AMDiS/src/Mesh.h
+112
-307
AMDiS/src/ParMetisPartitioner.cc
AMDiS/src/ParMetisPartitioner.cc
+31
-37
AMDiS/src/ParMetisPartitioner.h
AMDiS/src/ParMetisPartitioner.h
+20
-19
AMDiS/src/ParallelProblem.cc
AMDiS/src/ParallelProblem.cc
+10
-8
AMDiS/src/ParallelProblem.h
AMDiS/src/ParallelProblem.h
+9
-5
AMDiS/src/VtkWriter.h
AMDiS/src/VtkWriter.h
+4
-12
No files found.
AMDiS/src/ElementFileWriter.cc
View file @
cd344056
...
...
@@ -8,7 +8,7 @@ namespace AMDiS {
ElementFileWriter
::
ElementFileWriter
(
const
std
::
string
&
name_
,
const
FiniteElemSpace
*
feSpace_
,
std
::
map
<
int
,
double
>
&
vec
_
)
std
::
map
<
int
,
double
>
&
map
vec
)
:
name
(
name_
),
tecplotExt
(
".plt"
),
amdisMeshDatExt
(
".elem.mesh"
),
...
...
@@ -23,20 +23,20 @@ namespace AMDiS {
timestepNumber
(
-
1
),
mesh
(
feSpace_
->
getMesh
()),
feSpace
(
feSpace_
),
vec
(
vec
_
)
vec
(
map
vec
)
{
GET_PARAMETER
(
0
,
name
+
"->output->filename"
,
&
filename
);
GET_PARAMETER
(
0
,
name
+
"->output->
TecPlot format"
,
"%d"
,
&
writeTecPlotFormat
);
GET_PARAMETER
(
0
,
name
+
"->output->TecPlot ext"
,
&
tecplotExt
);
GET_PARAMETER
(
0
,
name
+
"->output->AMDiS format"
,
"%d"
,
&
writeAMDiSFormat
);
GET_PARAMETER
(
0
,
name
+
"->output->AMDiS mesh-dat ext"
,
&
amdisMeshDatExt
);
GET_PARAMETER
(
0
,
name
+
"->output->ParaView format"
,
"%d"
,
&
writeVtkFormat
);
GET_PARAMETER
(
0
,
name
+
"->output->append index"
,
"%d"
,
&
appendIndex
);
GET_PARAMETER
(
0
,
name
+
"->output->index length"
,
"%d"
,
&
indexLength
);
GET_PARAMETER
(
0
,
name
+
"->output->index decimals"
,
"%d"
,
&
indexDecimals
);
GET_PARAMETER
(
0
,
name
+
"->output->write every i-th timestep"
,
"%d"
,
&
tsModulo
);
if
(
name
!=
""
)
{
GET_PARAMETER
(
0
,
name
+
"->output->
filename"
,
&
filename
);
GET_PARAMETER
(
0
,
name
+
"->output->TecPlot format"
,
"%d"
,
&
writeTecPlotFormat
);
GET_PARAMETER
(
0
,
name
+
"->output->TecPlot ext"
,
&
tecplotExt
);
GET_PARAMETER
(
0
,
name
+
"->output->AMDiS format"
,
"%d"
,
&
writeAMDiSFormat
);
GET_PARAMETER
(
0
,
name
+
"->output->AMDiS mesh-dat ext"
,
&
amdisMeshDatExt
);
GET_PARAMETER
(
0
,
name
+
"->output->ParaView format"
,
"%d"
,
&
writeVtkFormat
);
GET_PARAMETER
(
0
,
name
+
"->output->append index"
,
"%d"
,
&
appendIndex
);
GET_PARAMETER
(
0
,
name
+
"->output->index length"
,
"%d"
,
&
indexLength
);
GET_PARAMETER
(
0
,
name
+
"->output->index decimals"
,
"%d"
,
&
indexDecimals
);
GET_PARAMETER
(
0
,
name
+
"->output->write every i-th timestep"
,
"%d"
,
&
tsModulo
);
}
}
void
ElementFileWriter
::
writeFiles
(
AdaptInfo
*
adaptInfo
,
bool
force
,
...
...
@@ -93,6 +93,15 @@ namespace AMDiS {
}
}
void
ElementFileWriter
::
writeFile
(
std
::
map
<
int
,
double
>
&
vec
,
const
FiniteElemSpace
*
feSpace
,
const
std
::
string
&
filename
)
{
ElementFileWriter
efw
(
""
,
feSpace
,
vec
);
efw
.
writeVtkValues
(
filename
);
}
void
ElementFileWriter
::
writeTecPlotValues
(
const
std
::
string
&
filename
)
{
FUNCNAME
(
"ElementFileWriter::writeTecPlotValues()"
);
...
...
AMDiS/src/ElementFileWriter.h
View file @
cd344056
...
...
@@ -23,61 +23,46 @@ namespace AMDiS {
public:
MEMORY_MANAGED
(
ElementFileWriter
);
/**
* Constructor.
*/
/// Constructor.
ElementFileWriter
(
const
std
::
string
&
name
,
const
FiniteElemSpace
*
feSpace
,
std
::
map
<
int
,
double
>
&
vec
);
/**
* Implementation of FileWriterInterface::writeFiles().
*/
/// Implementation of FileWriterInterface::writeFiles().
void
writeFiles
(
AdaptInfo
*
adaptInfo
,
bool
force
,
int
level
=
-
1
,
Flag
traverseFlag
=
Mesh
::
CALL_LEAF_EL
,
bool
(
*
writeElem
)(
ElInfo
*
)
=
NULL
);
/// Simple writing procedure for one element map.
static
void
writeFile
(
std
::
map
<
int
,
double
>
&
vec
,
const
FiniteElemSpace
*
feSpace
,
const
std
::
string
&
filename
);
protected:
/**
* Writes element data in tecplot format.
*/
/// Writes element data in tecplot format.
void
writeTecPlotValues
(
const
std
::
string
&
filename
);
/**
* Writes element data in AMDiS format (1 file !).
*/
/// Writes element data in AMDiS format (1 file !).
void
writeMeshDatValues
(
const
std
::
string
&
filename
,
double
time
);
/**
* Writes element data in VTK format.
*/
/// Writes element data in VTK format.
void
writeVtkValues
(
const
std
::
string
&
filename
);
protected:
/** \brief
* Name.
*/
/// Name.
std
::
string
name
;
/** \brief
* Used filename prefix.
*/
/// Used filename prefix.
std
::
string
filename
;
/** \brief
* TecPlot file extension.
*/
/// TecPlot file extension.
std
::
string
tecplotExt
;
/** \brief
* AMDiS mesh-data-file extension.
*/
/// AMDiS mesh-data-file extension.
std
::
string
amdisMeshDatExt
;
/** \brief
* VTK file extension.
*/
/// VTK file extension.
std
::
string
vtkExt
;
/** \brief
...
...
@@ -104,38 +89,25 @@ namespace AMDiS {
*/
int
appendIndex
;
/** \brief
* Total length of appended time index.
*/
/// Total length of appended time index.
int
indexLength
;
/** \brief
* Number of decimals in time index.
*/
/// Number of decimals in time index.
int
indexDecimals
;
/** \brief
* Timestep modulo: write only every tsModulo-th timestep!
*/
/// Timestep modulo: write only every tsModulo-th timestep!
int
tsModulo
;
/**
*/
///
int
timestepNumber
;
/** \brief
* Mesh used for output.
*/
/// Mesh used for output.
Mesh
*
mesh
;
/** \brief
* fespace used for output.
*/
/// fespace used for output.
const
FiniteElemSpace
*
feSpace
;
/** \brief
* Vector that stores the solution.
*/
/// Vector that stores the solution.
std
::
map
<
int
,
double
>
vec
;
};
...
...
AMDiS/src/FileWriter.h
View file @
cd344056
...
...
@@ -63,9 +63,9 @@ namespace AMDiS {
traverseLevel
(
-
1
),
traverseFlag
(
Mesh
::
CALL_LEAF_EL
),
writeElement
(
NULL
)
{}
;
{}
virtual
~
FileWriterInterface
()
{}
;
virtual
~
FileWriterInterface
()
{}
/** \brief
* Interface. Must be overridden in subclasses.
...
...
@@ -84,15 +84,15 @@ namespace AMDiS {
traverseLevel
=
level
;
traverseFlag
|=
flag
;
writeElement
=
writeElem
;
}
;
}
std
::
string
getFilename
()
{
return
filename
;
}
;
}
void
setFilename
(
std
::
string
n
)
{
filename
=
n
;
}
;
}
protected:
/** \brief
...
...
AMDiS/src/Mesh.h
View file @
cd344056
...
...
@@ -86,38 +86,26 @@ namespace AMDiS {
public:
MEMORY_MANAGED
(
Mesh
);
/** \brief
* Creates a mesh with the given name of dimension dim
*/
/// Creates a mesh with the given name of dimension dim
Mesh
(
const
std
::
string
&
name
,
int
dim
);
/** \brief
* Destructor
*/
/// Destructor
virtual
~
Mesh
();
/** \brief
* Reads macro triangulation.
*/
/// Reads macro triangulation.
void
initialize
();
/** \brief
* Assignment operator
*/
/// Assignment operator
Mesh
&
operator
=
(
const
Mesh
&
);
/** \name static methods used while mesh traversal
* \{
*/
/** \brief
* Used while dof compress
*/
/// Used while dof compress
static
int
newDOFFct1
(
ElInfo
*
e
);
/** \brief
* Used while dof compress
*/
/// Used while dof compress
static
int
newDOFFct2
(
ElInfo
*
e
);
/** \} */
...
...
@@ -135,114 +123,82 @@ namespace AMDiS {
return
Global
::
getGeo
(
p
,
dim
);
}
/** \brief
* Returns \ref name of the mesh
*/
/// Returns \ref name of the mesh
inline
const
std
::
string
&
getName
()
const
{
return
name
;
}
/** \brief
* Returns \ref dim of the mesh
*/
/// Returns \ref dim of the mesh
inline
int
getDim
()
const
{
return
dim
;
}
/** \brief
* Returns \ref nDOFEl of the mesh
*/
/// Returns \ref nDOFEl of the mesh
inline
const
int
getNumberOfAllDOFs
()
const
{
return
nDOFEl
;
}
/** \brief
* Returns \ref nNodeEl of the mesh
*/
/// Returns \ref nNodeEl of the mesh
inline
const
int
getNumberOfNodes
()
const
{
return
nNodeEl
;
}
/** \brief
* Returns \ref nVertices of the mesh
*/
/// Returns \ref nVertices of the mesh
inline
const
int
getNumberOfVertices
()
const
{
return
nVertices
;
}
/** \brief
* Returns \ref nEdges of the mesh
*/
/// Returns \ref nEdges of the mesh
inline
const
int
getNumberOfEdges
()
const
{
return
nEdges
;
}
/** \brief
* Returns \ref nFaces of the mesh
*/
/// Returns \ref nFaces of the mesh
inline
const
int
getNumberOfFaces
()
const
{
return
nFaces
;
}
/** \brief
* Returns \ref nLeaves of the mesh
*/
/// Returns \ref nLeaves of the mesh
inline
const
int
getNumberOfLeaves
()
const
{
return
nLeaves
;
}
/** \brief
* Returns \ref nElements of the mesh
*/
/// Returns \ref nElements of the mesh
inline
const
int
getNumberOfElements
()
const
{
return
nElements
;
}
/** \brief
* Returns \ref maxEdgeNeigh of the mesh
*/
/// Returns \ref maxEdgeNeigh of the mesh
inline
const
int
getMaxEdgeNeigh
()
const
{
return
maxEdgeNeigh
;
}
/** \brief
* Returns \ref parametric of the mesh
*/
/// Returns \ref parametric of the mesh
inline
Parametric
*
getParametric
()
const
{
return
parametric
;
}
/** \brief
* Returns \ref diam of the mesh
*/
/// Returns \ref diam of the mesh
inline
const
WorldVector
<
double
>&
getDiameter
()
const
{
return
diam
;
}
/** \brief
* Returns nDOF[i] of the mesh
*/
/// Returns nDOF[i] of the mesh
inline
const
int
getNumberOfDOFs
(
int
i
)
const
{
return
nDOF
[
i
];
}
/** \brief
* Returns \ref elementPrototype of the mesh
*/
/// Returns \ref elementPrototype of the mesh
inline
Element
*
getElementPrototype
()
{
return
elementPrototype
;
}
/** \brief
* Returns \ref leafDataPrototype of the mesh
*/
/// Returns \ref leafDataPrototype of the mesh
inline
ElementData
*
getElementDataPrototype
()
{
return
elementDataPrototype
;
}
/** \brief
* Returns node[i] of the mesh
*/
/// Returns node[i] of the mesh
inline
int
getNode
(
int
i
)
const
{
return
node
[
i
];
}
...
...
@@ -255,9 +211,7 @@ namespace AMDiS {
*/
DegreeOfFreedom
*
getDOF
(
GeoIndex
position
);
/** \brief
* Returns *(\ref admin[i]) of the mesh
*/
/// Returns *(\ref admin[i]) of the mesh
inline
const
DOFAdmin
&
getDOFAdmin
(
int
i
)
const
{
return
*
(
admin
[
i
]);
}
...
...
@@ -285,41 +239,28 @@ namespace AMDiS {
return
macroElements
.
size
();
}
/** \brief
* Returns a DOFAdmin which at least manages vertex DOFs
*/
/// Returns a DOFAdmin which at least manages vertex DOFs
const
DOFAdmin
*
getVertexAdmin
()
const
;
/** \brief
* Allocates a array of DOF pointers. The array holds one pointer for
* each node.
*/
/// Allocates a array of DOF pointers. The array holds one pointer for each node.
DegreeOfFreedom
**
createDOFPtrs
();
/** \brief
* Returns \ref preserveCoarseDOFs of the mesh
*/
/// Returns \ref preserveCoarseDOFs of the mesh
inline
bool
queryCoarseDOFs
()
const
{
return
preserveCoarseDOFs
;
}
/** \brief
* Returns an iterator to the begin of \ref macroElements
*/
/// Returns an iterator to the begin of \ref macroElements
inline
std
::
deque
<
MacroElement
*>::
iterator
firstMacroElement
()
{
return
macroElements
.
begin
();
}
/** \brief
* Returns macroElements[i].
*/
/// Returns macroElements[i].
inline
MacroElement
*
getMacroElement
(
int
i
)
{
return
macroElements
[
i
];
}
/** \brief
* Returns an iterator to the end of \ref macroElements
*/
/// Returns an iterator to the end of \ref macroElements
inline
std
::
deque
<
MacroElement
*>::
iterator
endOfMacroElements
()
{
return
macroElements
.
end
();
}
...
...
@@ -331,132 +272,98 @@ namespace AMDiS {
* \{
*/
/** \brief
* Sets \ref name of the mesh
*/
/// Sets \ref name of the mesh
inline
void
setName
(
const
std
::
string
&
aName
)
{
name
=
aName
;
}
/** \brief
* Sets \ref nVertices of the mesh
*/
/// Sets \ref nVertices of the mesh
inline
void
setNumberOfVertices
(
int
n
)
{
nVertices
=
n
;
}
/** \brief
* Sets \ref nFaces of the mesh
*/
/// Sets \ref nFaces of the mesh
inline
void
setNumberOfFaces
(
int
n
)
{
nFaces
=
n
;
}
/** \brief
* Increments \ref nVertices by inc
*/
/// Increments \ref nVertices by inc
inline
void
incrementNumberOfVertices
(
int
inc
)
{
nVertices
+=
inc
;
}
/** \brief
* Sets \ref nEdges of the mesh
*/
/// Sets \ref nEdges of the mesh
inline
void
setNumberOfEdges
(
int
n
)
{
nEdges
=
n
;
}
/** \brief
* Increments \ref nEdges by inc
*/
/// Increments \ref nEdges by inc
inline
void
incrementNumberOfEdges
(
int
inc
)
{
nEdges
+=
inc
;
}
/** \brief
* Increments \ref nFaces by inc
*/
/// Increments \ref nFaces by inc
inline
void
incrementNumberOfFaces
(
int
inc
)
{
nFaces
+=
inc
;
}
/** \brief
* Sets \ref nLeaves of the mesh
*/
/// Sets \ref nLeaves of the mesh
inline
void
setNumberOfLeaves
(
int
n
)
{
nLeaves
=
n
;
}
/** \brief
* Increments \ref nLeaves by inc
*/
/// Increments \ref nLeaves by inc
inline
void
incrementNumberOfLeaves
(
int
inc
)
{
nLeaves
+=
inc
;
}
/** \brief
* Sets \ref nElements of the mesh
*/
/// Sets \ref nElements of the mesh
inline
void
setNumberOfElements
(
int
n
)
{
nElements
=
n
;
}
/** \brief
* Increments \ref nElements by inc
*/
/// Increments \ref nElements by inc
inline
void
incrementNumberOfElements
(
int
inc
)
{
nElements
+=
inc
;
}
/** \brief
* Sets *\ref diam to w
*/
/// Sets *\ref diam to w
void
setDiameter
(
const
WorldVector
<
double
>&
w
);
/** \brief
* Sets (*\ref diam)[i] to d
*/
/// Sets (*\ref diam)[i] to d
void
setDiameter
(
int
i
,
double
d
);
/** \brief
* Sets \ref preserveCoarseDOFs = true
*/
/// Sets \ref preserveCoarseDOFs = true
inline
void
retainCoarseDOFs
()
{
preserveCoarseDOFs
=
true
;
}
/** \brief
* Sets \ref preserveCoarseDOFs = b
*/
/// Sets \ref preserveCoarseDOFs = b
inline
void
setPreserveCoarseDOFs
(
bool
b
)
{
preserveCoarseDOFs
=
b
;
}
/** \brief
* Sets \ref preserveCoarseDOFs = false
*/
/// Sets \ref preserveCoarseDOFs = false
inline
void
noCoarseDOFs
()
{
preserveCoarseDOFs
=
false
;
}
/** \brief
* Sets \ref elementPrototype of the mesh
*/
/// Sets \ref elementPrototype of the mesh
inline
void
setElementPrototype
(
Element
*
prototype
)
{
elementPrototype
=
prototype
;
}
/** \brief
* Sets \ref elementDataPrototype of the mesh
*/
/// Sets \ref elementDataPrototype of the mesh
inline
void
setElementDataPrototype
(
ElementData
*
prototype
)
{
elementDataPrototype
=
prototype
;
}
///
inline
void
setParametric
(
Parametric
*
param
)
{
parametric
=
param
;
}
///
inline
void
setMaxEdgeNeigh
(
int
m
)
{
maxEdgeNeigh
=
m
;
}
...
...
@@ -464,34 +371,22 @@ namespace AMDiS {
/** \} */
// ==========================================================================
/** \brief
* Creates a new Element by cloning \ref elementPrototype
*/
/// Creates a new Element by cloning \ref elementPrototype
Element
*
createNewElement
(
Element
*
parent
=
NULL
);
/** \brief
* Creates a new ElInfo dependent of \ref dim of the mesh
*/
/// Creates a new ElInfo dependent of \ref dim of the mesh
ElInfo
*
createNewElInfo
();
/** \brief
* Frees DOFs at the given position pointed by dof
*/
/// Frees DOFs at the given position pointed by dof
void
freeDOF
(
DegreeOfFreedom
*
dof
,
GeoIndex
position
);
/** \brief
* Frees memory for the given element el
*/
/// Frees memory for the given element el
void
freeElement
(
Element
*
el
);
/** \brief
* Performs DOF compression for all DOFAdmins (see \ref DOFAdmin::compress)
*/
/// Performs DOF compression for all DOFAdmins (see \ref DOFAdmin::compress)
void
dofCompress
();
/** \brief
* Adds a DOFAdmin to the mesh
*/
/// Adds a DOFAdmin to the mesh
virtual
void
addDOFAdmin
(
DOFAdmin
*
admin
);
/** \brief
...
...
@@ -509,26 +404,18 @@ namespace AMDiS {
const
Flag
fillFlag
,
int
(
*
elFct
)(
ElInfo
*
));
/** \brief