Commit 8d8dbf02 authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

meshes from mlmc

parent ce10a42c
#
# Builds static libraries mpp_src and lib_ps
# Builds static libraries mpp_src and lib_ps and contains static library superlu
#
......@@ -39,6 +39,7 @@ find_package(LAPACK REQUIRED)
# Manage folder structure build folder
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/data/vtk)
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/data/gp)
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/log)
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/data/dual)
#---------------------------------------------------------------------------------------#
......
// $Header: https://svn.math.kit.edu/svn/M++/trunk/src/Mesh.C 294 2015-03-16 15:09:36Z wieners $
#include "Mesh.h"
#include "Meshfile.h"
#include "Distribution.h"
......@@ -474,7 +476,8 @@ void Meshes::Init() {
else Point_3d();
if (plevel > finelevel) {
plevel = finelevel;
mout << "plevel set to " << plevel << endl;
if (MuteLevel != -1)
mout << "plevel set to " << plevel << endl;
}
dout (10) << *M[0];
M.resize(1 + finelevel);
......@@ -509,8 +512,10 @@ void Meshes::Init() {
ReadConfig(Settings, "phi", slip_phi);
slip_phi = Pi * (slip_phi / 180);
vector<Point> N(2);
N[0] = Point(-sin(slip_phi), cos(slip_phi));
N[0] = Point(-sin(slip_phi), cos(slip_phi)); // pull x
N[1] = Point(-sin(slip_phi), -cos(slip_phi));
// Point N(-1,1);
// Point N1(-1,-1);
if (createedgegraph) M[finelevel]->CreateFaceEdges2d(0, N[0]);
if (createedgegraph) M[finelevel]->CreateFaceSlips2d(0, N[0]);
if (createedgegraph) M[finelevel]->CreateFaceEdges2d(1, N[1]);
......@@ -533,10 +538,31 @@ Meshes::Meshes(const char *name, int pL, int L) : M(1) {
M[0] = new Mesh;
CoarseMesh(name, *M[0]);
finelevel = L;
plevel = 0;
Init();
}
Meshes::Meshes(int pL, int L) : M(1) {
M[0] = new Mesh;
string name;
ReadConfig(Settings, "Mesh", name);
CoarseMesh(name, *M[0]);
finelevel = L;
plevel = pL;
Init();
}
Meshes::Meshes(int L) : M(1) {
M[0] = new Mesh;
string name;
ReadConfig(Settings, "Mesh", name);
CoarseMesh(name, *M[0]);
finelevel = L;
plevel = 0;
ReadConfig(Settings, "plevel", plevel);
Init();
}
Meshes::Meshes(const CoarseGeometry &CG,
map<string, list<int> > &bc_nodes,
map<string, int> &key_to_bc,
......@@ -767,8 +793,7 @@ void SpaceTimeMesh::InsertCell(cell &c, vector<double> ts) {
subtimesteps[a] = t(k) + double(a) / double(n - 1) * (t(k + 1) - t(k));
for (int a = 0; a < n - 1; ++a) {
tcell tc = TCells::Insert(c.Type(), 0, *c, subtimesteps[a],
subtimesteps[a + 1]);
tcell tc = TCells::Insert(c.Type(), 0, *c, subtimesteps[a], subtimesteps[a + 1]);
for (int i = 0; i < c.Corners(); ++i) {
Vertices::Insert(Point(c.Corner(i), subtimesteps[a]));
......@@ -849,8 +874,7 @@ void SpaceTimeMesh::InsertCell(tcell &c) {
// }
}
tcell SpaceTimeMesh::InsertCell(CELLTYPE tp, int sd, const vector<Point> &x, double a,
double b) {
tcell SpaceTimeMesh::InsertCell(CELLTYPE tp, int sd, const vector<Point> &x, double a, double b) {
tcell tc = TCells::Insert(tp, sd, x, a, b);
for (int i = 0; i < tc.Faces(); ++i)
Faces::Insert(tc.Face(i), tc());
......@@ -1110,8 +1134,7 @@ SpaceTimeMeshes::SpaceTimeMeshes(int _Scales, double _ScaleFactor) :
Init();
}
SpaceTimeMeshes::SpaceTimeMeshes(hash_map<Point, short, Hash> &Weights) : STM(1), M(1),
timesteps(1) {
SpaceTimeMeshes::SpaceTimeMeshes(hash_map<Point, short, Hash> &Weights) : STM(1), M(1), timesteps(1) {
finelevel = 0;
plevel = finelevel;
max_tlevel = 0;
......@@ -1141,8 +1164,7 @@ SpaceTimeMeshes::SpaceTimeMeshes(hash_map<Point, short, Hash> &Weights) : STM(1)
Init(Weights);
}
SpaceTimeMeshes::SpaceTimeMeshes(int _Scales, double _ScaleFactor,
hash_map<Point, short, Hash> &Weights) :
SpaceTimeMeshes::SpaceTimeMeshes(int _Scales, double _ScaleFactor, hash_map<Point, short, Hash> &Weights) :
STM(1), M(1), timesteps(1), Scales(_Scales), ScaleFactor(_ScaleFactor) {
finelevel = 0;
plevel = finelevel;
......@@ -1230,84 +1252,45 @@ void SpaceTimeMeshes::ReadTimeSteps(string name) {
"%lf %lf %lf %lf %lf %lf %lf %lf %lf %lf"
"%lf %lf %lf %lf %lf %lf %lf %lf %lf %lf",
i, i + 1, i + 2, i + 3, i + 4, i + 5, i + 6, i + 7, i + 8, i + 9,
i + 10, i + 11, i + 12, i + 13, i + 14, i + 15, i + 16, i + 17, i + 18,
i + 19,
i + 20, i + 21, i + 22, i + 23, i + 24, i + 25, i + 26, i + 27, i + 28,
i + 29,
i + 30, i + 31, i + 32, i + 33, i + 34, i + 35, i + 36, i + 37, i + 38,
i + 39,
i + 40, i + 41, i + 42, i + 43, i + 44, i + 45, i + 46, i + 47, i + 48,
i + 49,
i + 50, i + 51, i + 52, i + 53, i + 54, i + 55, i + 56, i + 57, i + 58,
i + 59,
i + 60, i + 61, i + 62, i + 63, i + 64, i + 65, i + 66, i + 67, i + 68,
i + 69,
i + 70, i + 71, i + 72, i + 73, i + 74, i + 75, i + 76, i + 77, i + 78,
i + 79,
i + 80, i + 81, i + 82, i + 83, i + 84, i + 85, i + 86, i + 87, i + 88,
i + 89,
i + 90, i + 91, i + 92, i + 93, i + 94, i + 95, i + 96, i + 97, i + 98,
i + 99,
i + 100, i + 101, i + 102, i + 103, i + 104, i + 105, i + 106, i + 107,
i + 108, i + 109,
i + 110, i + 111, i + 112, i + 113, i + 114, i + 115, i + 116, i + 117,
i + 118, i + 119,
i + 120, i + 121, i + 122, i + 123, i + 124, i + 125, i + 126, i + 127,
i + 128, i + 129,
i + 130, i + 131, i + 132, i + 133, i + 134, i + 135, i + 136, i + 137,
i + 138, i + 139,
i + 140, i + 141, i + 142, i + 143, i + 144, i + 145, i + 146, i + 147,
i + 148, i + 149,
i + 150, i + 151, i + 152, i + 153, i + 154, i + 155, i + 156, i + 157,
i + 158, i + 159,
i + 160, i + 161, i + 162, i + 163, i + 164, i + 165, i + 166, i + 167,
i + 168, i + 169,
i + 170, i + 171, i + 172, i + 173, i + 174, i + 175, i + 176, i + 177,
i + 178, i + 179,
i + 180, i + 181, i + 182, i + 183, i + 184, i + 185, i + 186, i + 187,
i + 188, i + 189,
i + 190, i + 191, i + 192, i + 193, i + 194, i + 195, i + 196, i + 197,
i + 198, i + 199,
i + 200, i + 201, i + 202, i + 203, i + 204, i + 205, i + 206, i + 207,
i + 208, i + 209,
i + 210, i + 211, i + 212, i + 213, i + 214, i + 215, i + 216, i + 217,
i + 218, i + 219,
i + 220, i + 221, i + 222, i + 223, i + 224, i + 225, i + 226, i + 227,
i + 228, i + 229,
i + 230, i + 231, i + 232, i + 233, i + 234, i + 235, i + 236, i + 237,
i + 238, i + 239,
i + 240, i + 241, i + 242, i + 243, i + 244, i + 245, i + 246, i + 247,
i + 248, i + 249,
i + 250, i + 251, i + 252, i + 253, i + 254, i + 255, i + 256, i + 257,
i + 258, i + 259,
i + 260, i + 261, i + 262, i + 263, i + 264, i + 265, i + 266, i + 267,
i + 268, i + 269,
i + 270, i + 271, i + 272, i + 273, i + 274, i + 275, i + 276, i + 277,
i + 278, i + 279,
i + 280, i + 281, i + 282, i + 283, i + 284, i + 285, i + 286, i + 287,
i + 288, i + 289,
i + 290, i + 291, i + 292, i + 293, i + 294, i + 295, i + 296, i + 297,
i + 298, i + 299,
i + 300, i + 301, i + 302, i + 303, i + 304, i + 305, i + 306, i + 307,
i + 308, i + 309,
i + 310, i + 311, i + 312, i + 313, i + 314, i + 315, i + 316, i + 317,
i + 318, i + 319,
i + 320, i + 321, i + 322, i + 323, i + 324, i + 325, i + 326, i + 327,
i + 328, i + 329,
i + 330, i + 331, i + 332, i + 333, i + 334, i + 335, i + 336, i + 337,
i + 338, i + 339,
i + 340, i + 341, i + 342, i + 343, i + 344, i + 345, i + 346, i + 347,
i + 348, i + 349,
i + 350, i + 351, i + 352, i + 353, i + 354, i + 355, i + 356, i + 357,
i + 358, i + 359,
i + 360, i + 361, i + 362, i + 363, i + 364, i + 365, i + 366, i + 367,
i + 368, i + 369,
i + 370, i + 371, i + 372, i + 373, i + 374, i + 375, i + 376, i + 377,
i + 378, i + 379,
i + 380, i + 381, i + 382, i + 383, i + 384, i + 385, i + 386, i + 387,
i + 388, i + 389,
i + 390, i + 391, i + 392, i + 393, i + 394, i + 395, i + 396, i + 397,
i + 398
i + 10, i + 11, i + 12, i + 13, i + 14, i + 15, i + 16, i + 17, i + 18, i + 19,
i + 20, i + 21, i + 22, i + 23, i + 24, i + 25, i + 26, i + 27, i + 28, i + 29,
i + 30, i + 31, i + 32, i + 33, i + 34, i + 35, i + 36, i + 37, i + 38, i + 39,
i + 40, i + 41, i + 42, i + 43, i + 44, i + 45, i + 46, i + 47, i + 48, i + 49,
i + 50, i + 51, i + 52, i + 53, i + 54, i + 55, i + 56, i + 57, i + 58, i + 59,
i + 60, i + 61, i + 62, i + 63, i + 64, i + 65, i + 66, i + 67, i + 68, i + 69,
i + 70, i + 71, i + 72, i + 73, i + 74, i + 75, i + 76, i + 77, i + 78, i + 79,
i + 80, i + 81, i + 82, i + 83, i + 84, i + 85, i + 86, i + 87, i + 88, i + 89,
i + 90, i + 91, i + 92, i + 93, i + 94, i + 95, i + 96, i + 97, i + 98, i + 99,
i + 100, i + 101, i + 102, i + 103, i + 104, i + 105, i + 106, i + 107, i + 108, i + 109,
i + 110, i + 111, i + 112, i + 113, i + 114, i + 115, i + 116, i + 117, i + 118, i + 119,
i + 120, i + 121, i + 122, i + 123, i + 124, i + 125, i + 126, i + 127, i + 128, i + 129,
i + 130, i + 131, i + 132, i + 133, i + 134, i + 135, i + 136, i + 137, i + 138, i + 139,
i + 140, i + 141, i + 142, i + 143, i + 144, i + 145, i + 146, i + 147, i + 148, i + 149,
i + 150, i + 151, i + 152, i + 153, i + 154, i + 155, i + 156, i + 157, i + 158, i + 159,
i + 160, i + 161, i + 162, i + 163, i + 164, i + 165, i + 166, i + 167, i + 168, i + 169,
i + 170, i + 171, i + 172, i + 173, i + 174, i + 175, i + 176, i + 177, i + 178, i + 179,
i + 180, i + 181, i + 182, i + 183, i + 184, i + 185, i + 186, i + 187, i + 188, i + 189,
i + 190, i + 191, i + 192, i + 193, i + 194, i + 195, i + 196, i + 197, i + 198, i + 199,
i + 200, i + 201, i + 202, i + 203, i + 204, i + 205, i + 206, i + 207, i + 208, i + 209,
i + 210, i + 211, i + 212, i + 213, i + 214, i + 215, i + 216, i + 217, i + 218, i + 219,
i + 220, i + 221, i + 222, i + 223, i + 224, i + 225, i + 226, i + 227, i + 228, i + 229,
i + 230, i + 231, i + 232, i + 233, i + 234, i + 235, i + 236, i + 237, i + 238, i + 239,
i + 240, i + 241, i + 242, i + 243, i + 244, i + 245, i + 246, i + 247, i + 248, i + 249,
i + 250, i + 251, i + 252, i + 253, i + 254, i + 255, i + 256, i + 257, i + 258, i + 259,
i + 260, i + 261, i + 262, i + 263, i + 264, i + 265, i + 266, i + 267, i + 268, i + 269,
i + 270, i + 271, i + 272, i + 273, i + 274, i + 275, i + 276, i + 277, i + 278, i + 279,
i + 280, i + 281, i + 282, i + 283, i + 284, i + 285, i + 286, i + 287, i + 288, i + 289,
i + 290, i + 291, i + 292, i + 293, i + 294, i + 295, i + 296, i + 297, i + 298, i + 299,
i + 300, i + 301, i + 302, i + 303, i + 304, i + 305, i + 306, i + 307, i + 308, i + 309,
i + 310, i + 311, i + 312, i + 313, i + 314, i + 315, i + 316, i + 317, i + 318, i + 319,
i + 320, i + 321, i + 322, i + 323, i + 324, i + 325, i + 326, i + 327, i + 328, i + 329,
i + 330, i + 331, i + 332, i + 333, i + 334, i + 335, i + 336, i + 337, i + 338, i + 339,
i + 340, i + 341, i + 342, i + 343, i + 344, i + 345, i + 346, i + 347, i + 348, i + 349,
i + 350, i + 351, i + 352, i + 353, i + 354, i + 355, i + 356, i + 357, i + 358, i + 359,
i + 360, i + 361, i + 362, i + 363, i + 364, i + 365, i + 366, i + 367, i + 368, i + 369,
i + 370, i + 371, i + 372, i + 373, i + 374, i + 375, i + 376, i + 377, i + 378, i + 379,
i + 380, i + 381, i + 382, i + 383, i + 384, i + 385, i + 386, i + 387, i + 388, i + 389,
i + 390, i + 391, i + 392, i + 393, i + 394, i + 395, i + 396, i + 397, i + 398
);
vector<vector<double> > init_timesteps(Scales + 1);
init_timesteps[0].resize(m);
......@@ -1325,8 +1308,7 @@ void SpaceTimeMeshes::ReadTimeSteps(string name) {
init_timesteps[S][k * SF_inv + 1] = init_timesteps[S - 1][k + 1];
double dt = init_timesteps[S - 1][k + 2] - init_timesteps[S - 1][k + 1];
for (int l = 1; l < SF_inv; ++l)
init_timesteps[S][k * SF_inv + l + 1] =
init_timesteps[S - 1][k + 1] + dt * ScaleFactor * l;
init_timesteps[S][k * SF_inv + l + 1] = init_timesteps[S - 1][k + 1] + dt * ScaleFactor * l;
}
}
......@@ -1395,8 +1377,7 @@ void SpaceTimeMeshes::Init() {
++l;
timesteps[i + 1][l] = 0.5 * (timesteps[i][k] + timesteps[i][k + 1]);
}
timesteps[i + 1][timesteps[i + 1].size() - 1] = timesteps[i][timesteps[i].size() -
1];
timesteps[i + 1][timesteps[i + 1].size() - 1] = timesteps[i][timesteps[i].size() - 1];
STM[i + 1] = new SpaceTimeMesh(timesteps[i + 1]);
STM[i + 1]->SetTLevel(max_tlevel);
......@@ -1427,8 +1408,7 @@ void SpaceTimeMeshes::Init() {
++l;
timesteps[i + 1][l] = 0.5 * (timesteps[i][k] + timesteps[i][k + 1]);
}
timesteps[i + 1][timesteps[i + 1].size() - 1] = timesteps[i][timesteps[i].size() -
1];
timesteps[i + 1][timesteps[i + 1].size() - 1] = timesteps[i][timesteps[i].size() - 1];
STM[i + 1] = new SpaceTimeMesh(timesteps[i + 1]);
......@@ -1463,8 +1443,7 @@ void SpaceTimeMeshes::Init(hash_map<Point, short, Hash> &Weights) {
++l;
timesteps[i + 1][l] = 0.5 * (timesteps[i][k] + timesteps[i][k + 1]);
}
timesteps[i + 1][timesteps[i + 1].size() - 1] = timesteps[i][timesteps[i].size() -
1];
timesteps[i + 1][timesteps[i + 1].size() - 1] = timesteps[i][timesteps[i].size() - 1];
STM[i + 1] = new SpaceTimeMesh(timesteps[i + 1]);
STM[i + 1]->SetTLevel(max_tlevel);
......@@ -1495,8 +1474,7 @@ void SpaceTimeMeshes::Init(hash_map<Point, short, Hash> &Weights) {
++l;
timesteps[i + 1][l] = 0.5 * (timesteps[i][k] + timesteps[i][k + 1]);
}
timesteps[i + 1][timesteps[i + 1].size() - 1] = timesteps[i][timesteps[i].size() -
1];
timesteps[i + 1][timesteps[i + 1].size() - 1] = timesteps[i][timesteps[i].size() - 1];
STM[i + 1] = new SpaceTimeMesh(timesteps[i + 1]);
STM[i + 1]->SetTLevel(max_tlevel);
......@@ -1721,8 +1699,7 @@ inline void RefineSTMesh(const SpaceTimeMesh &M, SpaceTimeMesh &N) {
if (bnd_f[i] != -1) {
N.BoundaryFaces::Insert(C[k].Face(j), bnd_f[i]);
if (c().t() > 0)
N.BoundaryFaces::Insert(C[k + R.size()].Face(j),
bnd_f[i]);
N.BoundaryFaces::Insert(C[k + R.size()].Face(j), bnd_f[i]);
}
}
}
......
......@@ -53,14 +53,16 @@ ostream& operator << (ostream& s, const Mesh& M);
class CoarseGeometry;
class Meshes {
vector<Mesh*> M;
vector<Mesh*> M;
int finelevel;
int plevel;
void ReadLevel ();
public:
Meshes ();
Meshes (const char*, int, int);
Meshes (const char*, double s = 1);
Meshes(int pL, int L);
Meshes(int L);
explicit Meshes (const char*, double s = 1);
Meshes (const CoarseGeometry&, map<string, list<int> >&,
map<string, int>&, map<string, list<Point> >&,
map<string, int>&);
......
Supports Markdown
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