OpenCMISS / iron

Source code repository for OpenCMISS-Iron
9 stars 62 forks source link

Data projection bug #149

Open PrasadBabarendaGamage opened 6 years ago

PrasadBabarendaGamage commented 6 years ago

A bug seems to have slipped through after the recent merge.

    # Create the data points
    dataPoints = iron.DataPoints()
    dataPointUserNumber = 1
    numberOfDataPoints = 1
    numberOfDimensions = 3
    dataPoints.CreateStart(dataPointUserNumber, region, numberOfDataPoints)
    dataPointLocations = np.zeros((numberOfDataPoints, numberOfDimensions))
    print("Number of data points: " + str(numberOfDataPoints))
    dataPointLocations[0,:] = np.array([1,1,1])
    dataList = [1]
    for dataPointIdx, dataPoint in enumerate(dataList):
        dataPoints.PositionSet(dataPoint,dataPointLocations[dataPointIdx,:])
    dataPoints.CreateFinish()

    # Set up data projection
    dataProjectionUserNumber = 1
    dataProjection = iron.DataProjection()
    dataProjection.CreateStart(dataProjectionUserNumber, dataPoints,
                               geometricField, iron.FieldVariableTypes.U)
    dataProjection.AbsoluteToleranceSet(1.0e-14)
    dataProjection.RelativeToleranceSet(1.0e-14)
    dataProjection.MaximumNumberOfIterationsSet(int(1e9))
    dataProjection.ProjectionTypeSet(
        iron.DataProjectionProjectionTypes.ALL_ELEMENTS)
    dataProjection.CreateFinish()

    # Evaluate data projection based on geometric field
    dataProjection.DataPointsProjectionEvaluate(
        iron.FieldParameterSetTypes.VALUES)
At line 324 of file /opencmiss/src/iron/src/data_projection_routines.f90
Fortran runtime error: Index '0' of dimension 1 of array 'closestdistances' below lower bound of 1

This error does not occur on Alys's mac build but it occurs on the linux GNU build. Likely because something is not initialised correctly.