use of org.vcell.vis.mapping.movingboundary.MovingBoundaryVtkFileWriter in project vcell by virtualcell.
the class DataSetControllerImpl method getEmptyVtuMeshFiles.
public VtuFileContainer getEmptyVtuMeshFiles(MovingBoundarySimFiles movingBoundarySimFiles, VCDataIdentifier vcdataID, int timeIndex) throws DataAccessException {
try {
MovingBoundaryVtkFileWriter movingBoundaryVtkFileWriter = new MovingBoundaryVtkFileWriter();
File primaryDirectory = PropertyLoader.getRequiredDirectory(PropertyLoader.primarySimDataDirInternalProperty);
VtuFileContainer vtuFiles = movingBoundaryVtkFileWriter.getEmptyVtuMeshFiles(movingBoundarySimFiles, timeIndex, primaryDirectory);
return vtuFiles;
} catch (Exception e) {
lg.error(e.getMessage(), e);
throw new DataAccessException("failed to retrieve VTK files: " + e.getMessage(), e);
}
}
use of org.vcell.vis.mapping.movingboundary.MovingBoundaryVtkFileWriter in project vcell by virtualcell.
the class DataSetControllerImpl method getVtuMeshData.
public double[] getVtuMeshData(MovingBoundarySimFiles movingBoundarySimFiles, OutputContext outputContext, VCDataIdentifier vcdataID, VtuVarInfo var, double time) throws DataAccessException {
try {
double[] times = getDataSetTimes(vcdataID);
int timeIndex = -1;
for (int i = 0; i < times.length; i++) {
if (times[i] == time) {
timeIndex = i;
break;
}
}
if (timeIndex < 0) {
throw new DataAccessException("data for dataset " + vcdataID + " not found at time " + time);
}
// VCData simulationData = getVCData(vcdataID);
SimDataBlock simDataBlock = getSimDataBlock(outputContext, vcdataID, var.name, time);
double[] volumeVarData = simDataBlock.getData();
MovingBoundaryVtkFileWriter movingBoundaryVtkFileWriter = new MovingBoundaryVtkFileWriter();
double[] vtuData = movingBoundaryVtkFileWriter.getVtuMeshData(movingBoundarySimFiles, volumeVarData, getUserDataDirectory(vcdataID), var, timeIndex);
return vtuData;
} catch (Exception e) {
lg.error(e.getMessage(), e);
throw new DataAccessException("failed to retrieve VTK files: " + e.getMessage(), e);
}
}
Aggregations