Skip to content

Commit f1bf754

Browse files
committed
update 1D
1 parent 8a0a096 commit f1bf754

File tree

2 files changed

+5
-22
lines changed

2 files changed

+5
-22
lines changed

criteriaModel/criteria1DCase.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ bool Crit1DCase::initializeNumericalFluxes(std::string &error)
154154

155155
float horizontalConductivityRatio = 10.0;
156156
soilFluxes3D::setHydraulicProperties(fittingOptions.waterRetentionCurve, MEAN_LOGARITHMIC, horizontalConductivityRatio);
157-
soilFluxes3D::setNumericalParameters(60, 3600, 100, 10, 12, 3);
157+
soilFluxes3D::setNumericalParameters(60, 3600, 100, 10, 10, 3);
158158

159159
// set soil properties (units of measurement: MKS)
160160
int soilIndex = 0;

soilFluxes3D/solver.cpp

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -137,26 +137,12 @@ double GaussSeidelIterationHeat()
137137
}
138138

139139

140-
double GaussSeidelIterationWater(short direction)
140+
double GaussSeidelIterationWater()
141141
{
142-
long firstIndex, lastIndex;
143-
144-
if (direction == UP)
145-
{
146-
firstIndex = 0;
147-
lastIndex = myStructure.nrNodes;
148-
}
149-
else
150-
{
151-
firstIndex = myStructure.nrNodes -1;
152-
lastIndex = -1;
153-
}
154-
155142
double currentNorm = 0.;
156143
double infinityNorm = 0.;
157-
long i = firstIndex;
158144

159-
while (i != lastIndex)
145+
for (long i = 0; i < myStructure.nrNodes; i++)
160146
{
161147
double newX = b[i];
162148
short j = 1;
@@ -173,6 +159,7 @@ double GaussSeidelIterationWater(short direction)
173159
}
174160

175161
currentNorm = fabs(newX - X[i]);
162+
X[i] = newX;
176163

177164
// water potential [m]
178165
double psi = fabs(newX - nodeList[i].z);
@@ -184,10 +171,6 @@ double GaussSeidelIterationWater(short direction)
184171

185172
if (currentNorm > infinityNorm)
186173
infinityNorm = currentNorm;
187-
188-
X[i] = newX;
189-
190-
(direction == UP)? i++ : i--;
191174
}
192175

193176
return infinityNorm;
@@ -383,7 +366,7 @@ bool solver (int approximation, double toleranceThreshold, int process)
383366
{
384367
if (myStructure.nrNodes < 1000)
385368
{
386-
currentNorm = GaussSeidelIterationWater(UP);
369+
currentNorm = GaussSeidelIterationWater();
387370
}
388371
else
389372
{

0 commit comments

Comments
 (0)