added: method=none

use this to apply no periodicity approach. useful for debugging
This commit is contained in:
Arne Morten Kvarving 2012-11-20 11:14:09 +01:00
parent da7729c54f
commit 6f1e511531
2 changed files with 20 additions and 11 deletions

View File

@ -157,6 +157,11 @@ class ElasticityUpscale
const double* max, int n1, int n2,
int p1, int p2);
//! \brief Fix corner nodes
//! \param[in] min The minimum coordinates on the grid
//! \param[in] max The maximum coordinates on the grid
void fixCorners(const double* min, const double* max);
//! \brief Assemble (optionally) stiffness matrix A and load vector
//! \param[in] loadcase The strain load case. Set to -1 to skip
//! \param[in] matrix Whether or not to assemble the matrix
@ -213,11 +218,6 @@ class ElasticityUpscale
//! \brief Vector holding material parameters for each active grid cell
std::vector<Material*> materials;
//! \brief Fix corner nodes
//! \param[in] min The minimum coordinates on the grid
//! \param[in] max The maximum coordinates on the grid
void fixCorners(const double* min, const double* max);
//! \brief Extract the vertices on a given face
//! \param[in] dir The direction of the face normal
//! \param[in] coord The coordinate of the face plane

View File

@ -53,6 +53,7 @@ void syntax(char** argv)
enum UpscaleMethod {
UPSCALE_NONE = 0,
UPSCALE_MPC = 1,
UPSCALE_LLM = 2,
UPSCALE_MORTAR = 3
@ -102,12 +103,12 @@ struct Params {
void parseCommandLine(int argc, char** argv, Params& p)
{
Opm::parameter::ParameterGroup param(argc, argv);
p.max[0] = param.getDefault("xmax",-1);
p.max[1] = param.getDefault("ymax",-1);
p.max[2] = param.getDefault("zmax",-1);
p.min[0] = param.getDefault("xmin",-1);
p.min[1] = param.getDefault("ymin",-1);
p.min[2] = param.getDefault("zmin",-1);
p.max[0] = param.getDefault("xmax",-1);
p.max[1] = param.getDefault("ymax",-1);
p.max[2] = param.getDefault("zmax",-1);
p.min[0] = param.getDefault("xmin",-1);
p.min[1] = param.getDefault("ymin",-1);
p.min[2] = param.getDefault("zmin",-1);
p.lambda[0] = param.getDefault("lambdax", 1);
p.lambda[1] = param.getDefault("lambday", 1);
std::string method = param.getDefault<std::string>("method","mortar");
@ -117,6 +118,8 @@ void parseCommandLine(int argc, char** argv, Params& p)
p.method = UPSCALE_LLM;
if (!strcasecmp(method.c_str(),"mortar"))
p.method = UPSCALE_MORTAR;
if (!strcasecmp(method.c_str(),"none"))
p.method = UPSCALE_NONE;
p.Emin = param.getDefault<double>("Emin",0.0);
p.ctol = param.getDefault<double>("ctol",1.e-8);
p.ltol = param.getDefault<double>("ltol",1.e-10);
@ -162,6 +165,8 @@ void writeOutput(const Params& p, Opm::time::StopWatch& watch, int cells,
method = "llm";
if (p.method == UPSCALE_MPC)
method = "mpc";
if (p.method == UPSCALE_NONE)
method = "none";
// write log
std::ofstream f;
@ -264,6 +269,10 @@ int main(int argc, char** argv)
} else if (p.method == UPSCALE_MORTAR) {
std::cout << "using Mortar couplings.." << std::endl;
upscale.periodicBCsMortar(p.min,p.max,p.n1,p.n2,p.lambda[0], p.lambda[1]);
} else if (p.method == UPSCALE_NONE) {
std::cout << "no periodicity approach applied.." << std::endl;
upscale.fixCorners(p.min, p.max);
upscale.A.initForAssembly();
}
Dune::FieldMatrix<double,6,6> C;
Dune::VTKWriter<GridType::LeafGridView> vtkwriter(grid.leafView());