Commit 371a9508 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

some small changes related to last AMDiS update

parent c5398967
......@@ -59,7 +59,7 @@ static double signedDist2D(const WorldVector<double> x, const WorldVector<double
TEST_EXIT(x.getSize() == 2)("Dimension of world must be 2 to use signedDist2D-function. Use signedDist3D instead!");
x_trans.fill(0.0);
x_trans.set(0.0);
for (int k = 0; k < x.getSize(); k++) {
x_trans[k] = x[k] - midPoint[k];
}
......@@ -89,7 +89,7 @@ static double signedDist3D(const WorldVector<double> x, const WorldVector<double
TEST_EXIT(x.getSize() == 3)("Dimension of world must be 3 to use signedDist3D-function. Use signedDist2D instead!");
x_trans.fill(0.0);
x_trans.set(0.0);
for (int k = 0; k < x.getSize(); k++) {
x_trans[k] = x[k] - midPoint[k];
}
......@@ -577,8 +577,8 @@ public:
{
double result = 1.e15;
for (size_t i = 0; i < vertices.size()-1; i++)
result = std::min(result, meshconv2::distance_point_line_2d(x.begin(), vertices[i].begin(), vertices[i+1].begin()));
return factor * result * (meshconv2::point_in_polygon(x.begin(), vertices) ? -1.0 : 1.0);
result = std::min(result, meshconv2::distance_point_line_2d(const_cast<double*>(x.begin()), const_cast<double*>(vertices[i].begin()), const_cast<double*>(vertices[i+1].begin())));
return factor * result * (meshconv2::point_in_polygon(const_cast<double*>(x.begin()), vertices) ? -1.0 : 1.0);
}
void refine(int np)
......
......@@ -46,7 +46,8 @@ namespace AMDiS { namespace extensions {
template<typename T>
const WorldVector<T>& operator*=(WorldVector<T>& v1, const WorldVector<T>& v2)
{
T* v1It, *v2It;
T* v1It;
T const* v2It;
for (v1It = v1.begin(), v2It = v2.begin();
v1It != v1.end();
v1It++, v2It++)
......
......@@ -124,7 +124,7 @@ void CahnHilliardNavierStokes_RB::transferInitialSolution(AdaptInfo *adaptInfo)
{
calcVelocity();
for (int i = 0; i < 2+dow; i++)
for (size_t i = 0; i < 2+dow; i++)
prob->setExactSolution(prob->getSolution()->getDOFVector(i), i);
fileWriter->writeFiles(adaptInfo, false);
......
......@@ -130,7 +130,7 @@ void CahnHilliardNavierStokes_TwoPhase::transferInitialSolution(AdaptInfo *adapt
{
calcVelocity();
for (int i = 0; i < 2+dow; i++)
for (size_t i = 0; i < 2+dow; i++)
prob->setExactSolution(prob->getSolution()->getDOFVector(i), i);
fileWriter->writeFiles(adaptInfo, false);
......
......@@ -24,27 +24,29 @@ namespace AMDiS { namespace base_problems {
CahnHilliardNavierStokes_TwoPhase_RB::CahnHilliardNavierStokes_TwoPhase_RB(const std::string &name_) :
super(name_),
velocity(NULL),
useMobility(false),
useConservationForm(false),
doubleWell(1),
gamma(1.0),
eps(0.1),
minusEps(-0.1),
epsInv(10.0),
minusEpsInv(-10.0),
epsSqr(0.01),
minusEpsSqr(-0.01),
dim(2),
laplaceType(0),
nonLinTerm(3),
doubleWell(1),
oldTimestep(0.0),
viscosity1(1.0),
viscosity2(1.0),
density1(1.0),
density2(1.0),
c(0.0),
gamma(1.0),
eps(0.1),
minusEps(-0.1),
epsInv(10.0),
minusEpsInv(-10.0),
epsSqr(0.01),
minusEpsSqr(-0.01),
sigma(1.0),
surfaceTension(1.0),
velocity(NULL),
surfaceTensionFactor(1.0),
fileWriter(NULL)
{
// parameters for CH
......@@ -126,7 +128,7 @@ void CahnHilliardNavierStokes_TwoPhase_RB::transferInitialSolution(AdaptInfo *ad
{
calcVelocity();
for (int i = 0; i < 2+dow; i++)
for (size_t i = 0; i < 2+dow; i++)
prob->setExactSolution(prob->getSolution()->getDOFVector(i), i);
fileWriter->writeFiles(adaptInfo, false);
......
Markdown is supported
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