Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Importing odd shape (DEM and XYZ available)

Emily Montgomery-Brown

Please login with a confirmed email address before reporting spam

Hi All,

I'm trying to import an oddly shaped blob (a lat lon height description of a flow field). I have the data in both DEM (a square image with NoData values) and in a columnar ascii text file that only contains the data points that exist [lat lon H].

For the DEM, I import with Definitions->Functions->Elevation, but the nodata values result in my desired flow field surrounded by zeros (or whatever I put in for the missing data value). The Parametric Surface created from this includes all of these zero values instead of just the flow field (the flat blue part on the "interp" figure), and the parametric surface is thus *very* bad ("parametric" figure ... from 1000 knots). Is there a way to parameterize only the blob I am interested in?

NaNs as the "missing data" value make a nice plot in the Definitions Elevation Plot, but fail in the Parametric surface solver. I've tried to make missing data value a negative number, such that I could split the volume at zero, and delete the negative values later, but the Parametric surface is so bad with all the noData values that it won't be useful.

Importing with the ASCII file also interpolates in between the fingers of the flow field ...

How can a eliminate the area of NoData before making a Parametric Surface? (The flat blue part in the image).


2 Replies Last Post May 3, 2017, 12:33 p.m. EDT
Jeff Hiller COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 7 years ago May 3, 2017, 9:13 a.m. EDT
Updated: 7 years ago May 3, 2017, 9:38 a.m. EDT
Hello Emily,
I have seen one similar situation before where the DEM did not contain data over an entire rectangular area.

Speaking from memory, in those regions where the DEM file does not contain data, COMSOL by default fills in zeros when it imports the DEM file. You can change that and provide your own value with which COMSOL should extend the data.
When the DEM file is imported for the sake of creating a parametric surface, as you are doing here, extending the data with a value other than the default zero can help minimize oscillations in the parametric surface at the border between the regions with and without data.
There is only so much you can do with this approach though because you can only extend the data with a constant, not an expression of x and y.

An alternative approach consists in (outside of COMSOL) modifying your DEM file in the first place to fill in the region where you currently do not have data: you would add artificial data there to smoothly extend your actual data to where you have nice, continuous data over an entire rectangular region. You then proceed to import that modified DEM file into COMSOL and create a parametric surface from it. Since your new DEM file is smooth, the parametric surface will not have the sort of unwanted oscillations at the border between the regions with and without data that I mentioned above.

After following either of those two approaches, you will then remove the unneeded part of the parametric surface (corresponding to the part where you do not currently have any data), using the standard geometry tools - typically by intersecting the parametric surface with an extrusion.
Best regards,

Jeff
Hello Emily, I have seen one similar situation before where the DEM did not contain data over an entire rectangular area. Speaking from memory, in those regions where the DEM file does not contain data, COMSOL by default fills in zeros when it imports the DEM file. You can change that and provide your own value with which COMSOL should extend the data. When the DEM file is imported for the sake of creating a parametric surface, as you are doing here, extending the data with a value other than the default zero can help minimize oscillations in the parametric surface at the border between the regions with and without data. There is only so much you can do with this approach though because you can only extend the data with a constant, not an expression of x and y. An alternative approach consists in (outside of COMSOL) modifying your DEM file in the first place to fill in the region where you currently do not have data: you would add artificial data there to smoothly extend your actual data to where you have nice, continuous data over an entire rectangular region. You then proceed to import that modified DEM file into COMSOL and create a parametric surface from it. Since your new DEM file is smooth, the parametric surface will not have the sort of unwanted oscillations at the border between the regions with and without data that I mentioned above. After following either of those two approaches, you will then remove the unneeded part of the parametric surface (corresponding to the part where you do not currently have any data), using the standard geometry tools - typically by intersecting the parametric surface with an extrusion. Best regards, Jeff

Emily Montgomery-Brown

Please login with a confirmed email address before reporting spam

Posted: 7 years ago May 3, 2017, 12:33 p.m. EDT
Hi Jeff,

Thanks for your thorough reply.

I have tried making the default fill-in value -10, but the Parametric is still very bad (ie, any flat parts in the DEM are poorly fit by the parametric solution).

I will try outside of Comsol to make a smooth surface and import that. I should be able combine a land+flow DEM to make a smooth one, and then difference the two surfaces to leave just the flow remaining in Comsol.

Thanks,

Emily
Hi Jeff, Thanks for your thorough reply. I have tried making the default fill-in value -10, but the Parametric is still very bad (ie, any flat parts in the DEM are poorly fit by the parametric solution). I will try outside of Comsol to make a smooth surface and import that. I should be able combine a land+flow DEM to make a smooth one, and then difference the two surfaces to leave just the flow remaining in Comsol. Thanks, Emily

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.