C_GetFatigueOutput

Call C_GetFatigueOutput to obtain the results of a fatigue analysis.

void C_GetFatigueOutput(

TOrcFxAPIHandle FatigueHandle,

int OutputType

int *lpOutputSize

void *lpOutput

int *lpStatus

);

Parameters

FatigueHandle (IN)

The fatigue analysis handle returned by C_CreateFatigue.

OutputType (IN)

Specifies which type of output is obtained. The available output types are listed below.

lpOutputSize (IN/OUT)

Points to a variable containing the output buffer size. On input this must be set to the size of output buffer provided by the caller in lpOutput. On output the function sets this variable to the required size of the output buffer.

If the results are not available, usually because the calculation data meant they have not been calculated, the output size is set to 0.

lpOutput (OUT)

Pointer to the output buffer, which is allocated by the caller. To determine the required size of the output buffer, make two calls C_GetFatigueOutput:

int OutputSize = 0;

int Status;

C_GetFatigueOutput(FatigueHandle, OutputType, &OutputSize, NULL, &Status);

unsigned char *lpOutput = new unsigned char[OutputSize];

C_GetFatigueOutput(FatigueHandle, OutputType, &OutputSize, lpOutput, &Status);

// use lpOutput

delete[] lpOutput;

Note that, for the sake of brevity, error checking has been omitted from the above code.

lpStatus (OUT)

Points to a variable in which the status result for the function call will be returned.

Remarks

Output format

The output is a multidimensional array, in row-major order. Each output type is listed in the table below, together with the array base type and dimensions.

Output type Base type Dimensions Description / notes
fotOutputPointCount int 1 The number of output points, No.
foTFatigueHomogeneousPipeOutputPointDetails TFatigueHomogeneousPipeOutputPointDetails No Details for each line output point of a homogeneous pipe damage calculation.
fotComponentOutputPointDetails TFatigueComponentOutputPointDetails No Details for each line output point of a stress factor damage calculation or an externally calculated stress damage calculation.
fotMooringOutputPointDetails TFatigueMooringOutputPointDetails No Details for each line output point of a mooring damage calculation.
fotShear7OutputPointDetails TFatigueShear7OutputPointDetails No Details for each line output point of a Shear7 damage calculation.
fotHistogramOutputPointDetails THistogramOutputPointDetails No Details for each line output point of a histogram calculation.
fotTheta double Nt The circumferential positions, in degrees, at which results are reported. Nt, the number of thetas, can be obtained using the "ThetaCount" data name. If the analysis is not performed at circumferential positions (e.g. for mooring fatigue, Shear7 fatigue and certain histogram variables) then Nt is defined to be zero.
fotDeterministicLoadCaseDamage TFatigueDeterministicLoadCaseDamage Nl, No, Nc, Nt Fatigue damage results for each load case, output point, component and theta. This output type is available for deterministic analysis types, regular and rainflow. Nl, the number of load cases, can be obtained using the "LoadCaseCount" data name. Nc, the number of components, can be obtained using the "ComponentCount" data name. If the analysis does not use components (stress factor and externally calculated stress damage calculations use components), or the analysis is not performed at circumferential positions, then the corresponding dimensions are omitted. For example, the homogeneous pipe stress damage calculation does not use components, and so the damage array has dimensions Nl, No, Nt. Similarly, the mooring damage calculation uses neither components nor circumferential positions, and so the damage array has dimensions Nl, No.
fotSpectralLoadCaseDamage TFatigueSpectralLoadCaseDamage Nl, No, Nc, Nt Fatigue damage results for each load case, output point, component and theta. This output type is available for spectral analysis types. The dimensions are handled in exactly the same way as for fotDeterministicLoadCaseDamage.
fotShear7LoadCaseDamage TFatigueShear7LoadCaseDamage Nl, No Fatigue damage results for each load case and output point. This output type is available for Shear7 analysis. Nl, the number of load cases, can be obtained using the "LoadCaseCount" data name.
fotOverallDamage TFatigueOverallDamage No, Nc, Nt Overall (i.e. summed over all load cases) fatigue damage results for each output point, component and theta. If the analysis does not use components (stress factor and externally calculated stress damage calculations use components), or the analysis is not performed at circumferential positions, then the corresponding dimensions are omitted.
fotHistogramBins double Nb The upper end point of the histogram bins. Nb is the number of bins.
fotHistogramLoadCaseCycleRate double Nl, No, Nt, Nb The cycle rates, in cycles per second, for each load case, output point and theta. If the analysis is not performed at circumferential positions, then the corresponding dimension is omitted. For example, if the selected variable is tension, because tension does not depend on circumferential position the dimensions would be Nl, No, Nb.
fotHistogramCombinedCycleRate double No, Nt, Nb The combined (i.e. summed over all load cases) cycle rates, in cycles per second, for each output point and theta. If the analysis is not performed at circumferential positions, then the corresponding dimension is omitted.

Dimensions

Unless an alternative method is documented above, the dimensions should be inferred from the required array size. For example, consider the fotHistogramLoadCaseCycleRate and fotHistogramCombinedCycleRate output types. The value of Nb can be inferred like this:

int OutputSize = 0;

int Status;

C_GetFatigueOutput(FatigueHandle, fotHistogramBins, &OutputSize, NULL, &Status);

int Nb = OutputSize / sizeof(double);

Note that, for the sake of brevity, error checking has been omitted from the above code.

Dimensions for output types with struct base types

Output types that are arrays of struct require special consideration. Because these structs may be extended in future release, your code should account for that possibility if it is to be compatible with future releases of the OrcFxAPI DLL. For these output types you must find the array length (N) as documented in the output format table, and the required array size (S). The struct size can then be determined as S / N.

For example consider For example, consider foTFatigueHomogeneousPipeOutputPointDetails (again with error checking omitted):

int No;

int OutputSize = sizeof(No);

int Status;

C_GetFatigueOutput(FatigueHandle, fotOutputPointCount, &OutputSize, &No, &Status);

OutputSize = 0;

C_GetFatigueOutput(FatigueHandle, foTFatigueHomogeneousPipeOutputPointDetails, &OutputSize, NULL, &Status);

int StructSize = OutputSize / No;

if (StructSize < sizeof(TFatigueHomogeneousPipeOutputPointDetails))

// incompatible version, handle error

 

unsigned char *lpOutput = new unsigned char[OutputSize];

C_GetDiffractionOutput(FatigueHandle, foTFatigueHomogeneousPipeOutputPointDetails, &OutputSize, lpOutput, &Status);

for (int i = 0; i < No; i++) {

TFatigueHomogeneousPipeOutputPointDetails* lpItem = static_cast<TFatigueHomogeneousPipeOutputPointDetails*>(lpOutput[i * StructSize]);

// use *lpItem

}

delete[] lpOutput;