Skip to content

Commit

Permalink
Mquezada/fix minor bugs in sw es (#640)
Browse files Browse the repository at this point in the history
* change the scale of the 1D paraboloid problem to match with literature

* change scale of 2D paraboloid prob to match literature

* add LINEAR_FRICTION as parameter. Note, the default value is 0

* change default parameters for 1D Riemann problem

* change defaults in dam break over bumps

* change default values for 2D paraboloid problem

* change default parameters for malpasset test

* TMP. Modify xi=10 to improve cfl

* use FE timeIntegration by default in malpasset test. I think I still have a bug here

* change some more defaults on 1D paraboloid prob

* fixed comparisons to None

* fixed setup files (dependencies for VOF and MCorr) and data

* updated for release 1.4.2

* Comment on parameter xi
  • Loading branch information
manuel-quezada authored and cekees committed Nov 4, 2017
1 parent efee57a commit 0f4b1b7
Show file tree
Hide file tree
Showing 22 changed files with 382 additions and 491 deletions.
3 changes: 2 additions & 1 deletion doc/source/_templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,12 @@
style="height:1in;"> A Python toolkit for computational methods and simulation</p>
<div class="btn-group" role="group">
<a class="btn btn-success"
href="https://github.com/erdc-cm/proteus/archive/1.4.1.tar.gz">
href="https://github.com/erdc-cm/proteus/archive/1.4.2.tar.gz">
<span class="glyphicon glyphicon-download"></span> Download
</a>
<button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></button>
<ul class="dropdown-menu">
<li><a https://github.com/erdc-cm/proteus/archive/1.4.2.tar.gz">Version 1.4.2</a></li>
<li><a https://github.com/erdc-cm/proteus/archive/1.4.1.tar.gz">Version 1.4.1</a></li>
<li><a https://github.com/erdc-cm/proteus/archive/1.4.0.tar.gz">Version 1.4.0</a></li>
<li><a https://github.com/erdc-cm/proteus/archive/1.3.3.tar.gz">Version 1.3.3</a></li>
Expand Down
200 changes: 73 additions & 127 deletions proteus/ModelFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@
#define MODELFACTORY_H
#include <iostream>

#define NO_INSTANCE std::cout<<"Constructing model object from template class:"<<std::endl \
<<"return static_cast<Model_Base*>(new ModelTemplate<CompKernelTemplate<" \
<<nSpaceIn<<"," \
<<nDOF_mesh_trial_elementIn<<"," \
<<nDOF_trial_elementIn<<"," \
<<nDOF_test_elementIn<<">," \
<<nSpaceIn<<"," \
<<nQuadraturePoints_elementIn<<"," \
<<nDOF_mesh_trial_elementIn<<"," \
<<nDOF_trial_elementIn<<"," \
<<nDOF_test_elementIn<<"," \
<<nQuadraturePoints_elementBoundaryIn<<">());" \
<<std::endl<<std::flush;

namespace proteus
{
template<class Model_Base,
Expand All @@ -26,22 +40,6 @@ namespace proteus
int nQuadraturePoints_elementBoundaryIn,
int CompKernelFlag)//0=Parametric
{
std::cout<<"Constructing model object from template class:"<<std::endl
<<"return static_cast<Model_Base*>(new ModelTemplate<CompKernelTemplate<"
<<nSpaceIn<<","
<<nDOF_mesh_trial_elementIn<<","
<<nDOF_trial_elementIn<<","
<<nDOF_test_elementIn<<">,"
<<nSpaceIn<<","
<<nQuadraturePoints_elementIn<<","
<<nDOF_mesh_trial_elementIn<<","
<<nDOF_trial_elementIn<<","
<<nDOF_test_elementIn<<","
<<nQuadraturePoints_elementBoundaryIn<<">());"
<<std::endl<<std::flush;

std::cout<<"this is chooseAndAllocateDiscretization"<<std::endl;

if (CompKernelFlag == 0)
{
if (nSpaceIn == 3)
Expand All @@ -55,7 +53,7 @@ namespace proteus
else if (nQuadraturePoints_elementIn == 4)
return static_cast<Model_Base*>(new ModelTemplate<CompKernelTemplate<3,4,4,4>,3,4,4,4,4,3>());
else
abort();
NO_INSTANCE
}
else if (nDOF_mesh_trial_elementIn == 8)
{
Expand All @@ -65,24 +63,24 @@ namespace proteus
else if ( nQuadraturePoints_elementBoundaryIn == 9)
return static_cast<Model_Base*>(new ModelTemplate<CompKernelTemplate<3,8,8,8>,3,8,8,8,8,9>());
else
abort();
NO_INSTANCE
else if (nQuadraturePoints_elementIn == 27)
if ( nQuadraturePoints_elementBoundaryIn == 4)
return static_cast<Model_Base*>(new ModelTemplate<CompKernelTemplate<3,8,8,8>,3,27,8,8,8,4>());
else if ( nQuadraturePoints_elementBoundaryIn == 9)
return static_cast<Model_Base*>(new ModelTemplate<CompKernelTemplate<3,8,8,8>,3,27,8,8,8,9>());
else
abort();
NO_INSTANCE
else

abort();
NO_INSTANCE
}
else if (nDOF_mesh_trial_elementIn == 10)
{
if (nQuadraturePoints_elementIn == 15)
return static_cast<Model_Base*>(new ModelTemplate<CompKernelTemplate<3,10,10,10>,3,15,10,10,10,7>());
else
abort();
NO_INSTANCE
}
else if (nDOF_mesh_trial_elementIn == 27)
{
Expand All @@ -92,19 +90,19 @@ namespace proteus
else if ( nQuadraturePoints_elementBoundaryIn == 9)
return static_cast<Model_Base*>(new ModelTemplate<CompKernelTemplate<3,27,27,27>,3,8,27,27,27,9>());
else
abort();
NO_INSTANCE
else if (nQuadraturePoints_elementIn == 27)
if ( nQuadraturePoints_elementBoundaryIn == 4)
return static_cast<Model_Base*>(new ModelTemplate<CompKernelTemplate<3,27,27,27>,3,27,27,27,27,4>());
else if ( nQuadraturePoints_elementBoundaryIn == 9)
return static_cast<Model_Base*>(new ModelTemplate<CompKernelTemplate<3,27,27,27>,3,27,27,27,27,9>());
else
abort();
NO_INSTANCE
else
abort();
NO_INSTANCE
}
else
abort();
NO_INSTANCE
}
else if (nDOF_mesh_trial_elementIn == 4)//sub-parametric tets
{
Expand Down Expand Up @@ -136,11 +134,11 @@ namespace proteus
}
else
{
abort();
NO_INSTANCE
}
}
else
abort();
NO_INSTANCE
}
else if (nDOF_mesh_trial_elementIn == 8)//sub-parametric hexes
{
Expand All @@ -149,13 +147,13 @@ namespace proteus
return static_cast<Model_Base*>(new ModelTemplate<CompKernelTemplate<3,8,27,27>,3,125,8,27,27,25>());
}
else
abort();
NO_INSTANCE
}
else
abort();
NO_INSTANCE
}
else
abort();
NO_INSTANCE
return NULL;
}
template<class Model_Base,
Expand All @@ -180,130 +178,78 @@ namespace proteus
int nQuadraturePoints_elementBoundaryIn,
int CompKernelFlag)//0=Parametric
{
std::cout<<"Constructing model object from template class:"<<std::endl
<<"return static_cast<Model_Base*>(new ModelTemplate<CompKernelTemplate<"
<<nSpaceIn<<","
<<nDOF_mesh_trial_elementIn<<","
<<nDOF_trial_elementIn<<","
<<nDOF_test_elementIn<<">,"
<<nSpaceIn<<","
<<nQuadraturePoints_elementIn<<","
<<nDOF_mesh_trial_elementIn<<","
<<nDOF_trial_elementIn<<","
<<nDOF_test_elementIn<<","
<<nQuadraturePoints_elementBoundaryIn<<">());"
<<std::endl<<std::flush;

std::cout<<"this is chooseAndAllocateDiscretization2D"
<<std::endl<<std::flush;


if (CompKernelFlag == 0)
{
if (nSpaceIn == 2)
{
if (nDOF_mesh_trial_elementIn == nDOF_trial_elementIn)//iso-parametric
{
std::cout<<"I am here"
<<std::endl<<std::flush;

if (nDOF_mesh_trial_elementIn == 3)
{
std::cout<<"3333333"
<<std::endl<<std::flush;


if (nQuadraturePoints_elementIn == 1)
{
std::cout<<"111111"
<<std::endl<<std::flush;

if (nQuadraturePoints_elementBoundaryIn == 1)
return static_cast<Model_Base*>(new ModelTemplate<CompKernelTemplate<2,3,3,3>,2,1,3,3,3,1>());
else
abort();
NO_INSTANCE
}
else if (nQuadraturePoints_elementIn == 3)
{
std::cout<<"3333333"
<<std::endl<<std::flush;

if (nQuadraturePoints_elementBoundaryIn == 2)
return static_cast<Model_Base*>(new ModelTemplate<CompKernelTemplate<2,3,3,3>,2,3,3,3,3,2>());
else
abort();
NO_INSTANCE
}
else if (nQuadraturePoints_elementIn == 4)
{
std::cout<<"444444444"
<<std::endl<<std::flush;

if (nQuadraturePoints_elementBoundaryIn == 3)
return static_cast<Model_Base*>(new ModelTemplate<CompKernelTemplate<2,3,3,3>,2,4,3,3,3,3>());
else
abort();
NO_INSTANCE
}
else if (nQuadraturePoints_elementIn == 6)
{
std::cout<<"666666666"
<<std::endl<<std::flush;

if (nQuadraturePoints_elementBoundaryIn == 4)
return static_cast<Model_Base*>(new ModelTemplate<CompKernelTemplate<2,3,3,3>,2,6,3,3,3,4>());
else
abort();
NO_INSTANCE
}
else if (nQuadraturePoints_elementIn == 7)
{
std::cout<<"777777777"
<<std::endl<<std::flush;

if (nQuadraturePoints_elementBoundaryIn == 5)
return static_cast<Model_Base*>(new ModelTemplate<CompKernelTemplate<2,3,3,3>,2,7,3,3,3,5>());
else
abort();
NO_INSTANCE
}
else if (nQuadraturePoints_elementIn == 16)//hk=0.5
{
std::cout<<"16-16-16-16-16-16-16"
<<std::endl<<std::flush;

if (nQuadraturePoints_elementBoundaryIn == 3)
{
std::cout<<"I am here"
<<std::endl<<std::flush;
return static_cast<Model_Base*>(new ModelTemplate<CompKernelTemplate<2,3,3,3>,2,16,3,3,3,3>());
}else
abort();
}
else if (nQuadraturePoints_elementIn == 36)//hk=0.3
{
std::cout<<"36-36-36-36-36-36-36"
<<std::endl<<std::flush;

if (nQuadraturePoints_elementBoundaryIn == 3)
{
std::cout<<"I am here"
<<std::endl<<std::flush;
return static_cast<Model_Base*>(new ModelTemplate<CompKernelTemplate<2,3,3,3>,2,36,3,3,3,3>());
}else
abort();
}
else if (nQuadraturePoints_elementIn == 100)//hk=0.2
{
std::cout<<"100-100-100-100-100"
<<std::endl<<std::flush;

if (nQuadraturePoints_elementBoundaryIn == 3)
{
std::cout<<"I am here"
<<std::endl<<std::flush;
return static_cast<Model_Base*>(new ModelTemplate<CompKernelTemplate<2,3,3,3>,2,100,3,3,3,3>());
}else
abort();
}
else if (nQuadraturePoints_elementIn == 16)//hk=0.5
{
if (nQuadraturePoints_elementBoundaryIn == 3)
{
return static_cast<Model_Base*>(new ModelTemplate<CompKernelTemplate<2,3,3,3>,2,16,3,3,3,3>());
}
else
NO_INSTANCE
}
else if (nQuadraturePoints_elementIn == 36)//hk=0.3
{
if (nQuadraturePoints_elementBoundaryIn == 3)
{
return static_cast<Model_Base*>(new ModelTemplate<CompKernelTemplate<2,3,3,3>,2,36,3,3,3,3>());
}
else
NO_INSTANCE
}
else if (nQuadraturePoints_elementIn == 100)//hk=0.2
{
if (nQuadraturePoints_elementBoundaryIn == 3)
{
return static_cast<Model_Base*>(new ModelTemplate<CompKernelTemplate<2,3,3,3>,2,100,3,3,3,3>());
}
else
NO_INSTANCE
}
else
abort();
NO_INSTANCE
}
else if(nDOF_mesh_trial_elementIn == 4)
{
Expand All @@ -312,13 +258,13 @@ namespace proteus
if (nQuadraturePoints_elementBoundaryIn == 2)
return static_cast<Model_Base*>(new ModelTemplate<CompKernelTemplate<2,4,4,4>,2,4,4,4,4,2>());
else
abort();
NO_INSTANCE
}
else
abort();
NO_INSTANCE
}
else
abort();
NO_INSTANCE
}
else if (nDOF_mesh_trial_elementIn == 3)
{
Expand All @@ -329,28 +275,28 @@ namespace proteus
if (nQuadraturePoints_elementBoundaryIn == 1)
return static_cast<Model_Base*>(new ModelTemplate<CompKernelTemplate<2,3,6,6>,2,1,3,6,6,1>());
else
abort();
NO_INSTANCE
}
else if (nQuadraturePoints_elementIn == 3)
{
if (nQuadraturePoints_elementBoundaryIn == 2)
return static_cast<Model_Base*>(new ModelTemplate<CompKernelTemplate<2,3,6,6>,2,3,3,6,6,2>());
else
abort();
NO_INSTANCE
}
else if (nQuadraturePoints_elementIn == 4)
{
if (nQuadraturePoints_elementBoundaryIn == 3)
return static_cast<Model_Base*>(new ModelTemplate<CompKernelTemplate<2,3,6,6>,2,4,3,6,6,3>());
else
abort();
NO_INSTANCE
}
else if (nQuadraturePoints_elementIn == 6)
{
if (nQuadraturePoints_elementBoundaryIn == 4)
return static_cast<Model_Base*>(new ModelTemplate<CompKernelTemplate<2,3,6,6>,2,6,3,6,6,4>());
else
abort();
NO_INSTANCE
}
else if (nQuadraturePoints_elementIn == 7)
{
Expand All @@ -359,21 +305,21 @@ namespace proteus
return static_cast<Model_Base*>(new ModelTemplate<CompKernelTemplate<2,3,6,6>,2,7,3,6,6,5>());
}
else
abort();
NO_INSTANCE
}
else
abort();
NO_INSTANCE
}
else
abort();
NO_INSTANCE
}
else
abort();
NO_INSTANCE
}
}
else
{
abort();
NO_INSTANCE
}
return NULL;
}
Expand Down
Loading

0 comments on commit 0f4b1b7

Please sign in to comment.