Exemplo n.º 1
0
bool DC_XYData::SetNDX(SC_SetupErr& err,
                       SC_DoubleArray& ndxData)const
{
    int n = 0;
    for (int i = 0; i < Size(); i++)
        {
            double x = xData[i];
            double y = yData[i];
            if (RealIsNull(x) || RealIsNull(y))
                {
                    err.SetConstantError("all x and y must be non null");
                    return false;
                }

            if ((x < 0.5) || (x > 999))
                {
                    err.SetConstantError("all x values must be integers > 0 and < 1000");
                    return false;
                }

            if (y < 1.0E-5)
                {
                    err.SetConstantError("all y values must be > 1E-5");
                    return false;
                }
            n += int(x);
        }

    if (n > 10000)
        {
            err.SetConstantError("total number of x/y ndx calculated nodes points be < 10000");
            return false;
        }

    ndxData.Alloc(n);
    for (int i = 0; i < Size(); i++)
        {
            n = int(xData[i]);
            double y = yData[i];
            for (int j = 0; j < n; j++)
                ndxData += y;
        }
    return true;

}
Exemplo n.º 2
0
void DataCaptureStaticSupport::SetToInitial()
{
  dataCaptureData.DeAlloc();
  dataCaptureData.Alloc(10);
  dataCaptureData.CreateIfNecessary(0);
  dataCaptureData.CreateIfNecessary(1);

  productionRestartTimes.DeAlloc();
  productionRestartTimes.Alloc(10);

  // start with a default TZ pressure
  {
    DataCaptureSpec& currRef = dataCaptureData.GetRef(0);
    currRef.SetUserDesig("DAT");
  }

  // and flows
  {
    DataCaptureSpec& currRef = dataCaptureData.GetRef(1);
    currRef.SetUserDesig("DAT");
    currRef.captureType = DataCaptureSpec::ctFlow;
    currRef.flowCapType = DataCaptureSpec::fctWell;
    currRef.SetOutputUnits();
  }
  dataCaptureData.SetSize(2);

  capturedDataXY.DeAlloc();
  capturedDataXY.AllocAndSetSize(2);
  capturedDataXY[0].SetEmpty();
  capturedDataXY[0].SetID("sPDAT");
  capturedDataXY[1].SetEmpty();
  capturedDataXY[1].SetID("sQDAT");

  capturedData.DeAlloc();
  capturedData.AllocAndSetSize(3);
  capturedData[0].SetResizable();
  capturedData[1].SetResizable();
  capturedData[2].SetResizable();

  capturedDataFO.DoStatusChk();
  dataCaptureData[0]->outputFO.DoStatusChk();
  dataCaptureData[1]->outputFO.DoStatusChk();
}
Exemplo n.º 3
0
void LayerStaticSupport::GetLayerDiscretization(SC_DoubleArray& layerNodeZ,
    SC_IntArray&   layerWellBoreZoneIndex,
    SC_IntArray&   layerGeologyIndex)
{
  if (!layerSpec.SetThicknesses())
  {
    layerNodeZ.Alloc(2);
    layerNodeZ[0] = 0.0;
    layerNodeZ[1] = 1.0;

    layerWellBoreZoneIndex.AllocAndFill(1, 0);
    layerGeologyIndex.AllocAndFill(1, 0);
    return;
  }

  SC_DoubleArray geoLayerZ(GetNGeoLayer() + 1), geoLayerDZ(GetNGeoLayer());
  geoLayerZ[0] = bottomLayerElevation.GetMetricVal();
  for (int i = 0; i < GetNGeoLayer(); i++)
  {
    GeologyLayer& currLayer = geologyLayers[i];
    geoLayerZ[i + 1] = geoLayerZ[i] + currLayer.currThickness;
    geoLayerDZ[i] = currLayer.currThickness / double(currLayer.nintervalNodes);
  }
  double maxZ = geoLayerZ.LastIndex();

  SC_DoubleArray wbzLayerZ(GetNWellboreZone() + 1);
  wbzLayerZ[0] = geoLayerZ[0];
  for (int i = 0; i < GetNWellboreZone(); i++)
  {



  }



}
Exemplo n.º 4
0
void SimulatedAnnealingOptimizer::GetExtraOutput(SC_DoubleArray& extraData) const
{
    extraData.Alloc(2);
    extraData += temperature;
    extraData += currSimplexSpan;
}