use of org.vcell.vis.mapping.comsol.ComsolVtkFileWriter in project vcell by virtualcell.
the class DataSetControllerImpl method getEmptyVtuMeshFiles.
public VtuFileContainer getEmptyVtuMeshFiles(ComsolSimFiles comsolSimFiles, VCDataIdentifier vcdataID, int timeIndex) throws DataAccessException {
try {
if (timeIndex > 0) {
throw new RuntimeException("only time index 0 supported for comsol vtk mesh files");
}
ComsolVtkFileWriter comsolVTKFileWriter = new ComsolVtkFileWriter();
File primaryDirectory = getPrimaryUserDir(vcdataID.getOwner(), false);
VtuFileContainer vtuFiles = comsolVTKFileWriter.getEmptyVtuMeshFiles(comsolSimFiles, 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.comsol.ComsolVtkFileWriter in project vcell by virtualcell.
the class DataSetControllerImpl method getVtuMeshData.
public double[] getVtuMeshData(ComsolSimFiles comsolSimFiles, OutputContext outputContext, VCDataIdentifier vcdataID, VtuVarInfo var, double time) throws DataAccessException {
try {
double[] times = getVtuTimes(comsolSimFiles, 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);
}
ComsolVtkFileWriter comsolVTKFileWriter = new ComsolVtkFileWriter();
double[] vtuData = comsolVTKFileWriter.getVtuMeshData(comsolSimFiles, outputContext, getUserDataDirectory(vcdataID), time, var, timeIndex);
return vtuData;
} 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.comsol.ComsolVtkFileWriter in project vcell by virtualcell.
the class DataSetControllerImpl method getVtuTimes.
public double[] getVtuTimes(ComsolSimFiles comsolSimFiles, VCDataIdentifier vcdataID) throws DataAccessException, IOException {
ComsolVtkFileWriter comsolVTKFileWriter = new ComsolVtkFileWriter();
double[] times = comsolVTKFileWriter.getVtuTimes(comsolSimFiles, getUserDataDirectory(vcdataID));
return times;
}
Aggregations