How can I create a new xns11?
lj512lj512 opened this issue · 5 comments
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like
A clear and concise description of what you want to happen.
I want to use xns11 to create a new xns11
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
juli@env.dtu.dk
@mmfontana Any suggestions?
Hello @Rhadhi,
I have never created a .xns11 file using Python or C#, but it would be useful. I usually get .xns11 files from someone or I create it using MIKE Zero.
I was trying to better understand DHI.Mike1D.CrossSectionModule.CrossSectionData and DHI.Mike1D.CrossSectionModule.CrossSectionFactory. But I still need more time.
I did not find anything about create the file from scratch at "DHI.Mike1D.Examples/CrossSectionExamples.cs"
I will keep trying during the week.
We do have a lot of internal test code in C# which creates various cross sections and utilizes the CrossSectionFactory. If you are a bit more specific on what type of cross section is required, I may be able to find some code. One example copied in below here, which creates an open cross section, which is the default for river type modelling. Some documentation is available here:
private static ICrossSection CreateCrossSection()
{
CrossSectionPointList crsPoints = new CrossSectionPointList();
crsPoints.Add(new CrossSectionPoint(0,2) { DistributedResistance = 80 });
crsPoints.Add(new CrossSectionPoint(1,0) { DistributedResistance = 80 });
crsPoints.Add(new CrossSectionPoint(2,1) { DistributedResistance = 80 });
crsPoints.Add(new CrossSectionPoint(2.5,2) { DistributedResistance = 80 });
ZLocation location = new ZLocation("dummy", 0);
location.Z = 0;
CrossSectionFactory factory = new CrossSectionFactory();
factory.BuildOpen("info");
factory.SetLocation(location);
factory.SetResistanceDistribution(ResistanceDistribution.Uniform);
FlowResistance flowResistance = new FlowResistance();
flowResistance.Formulation = ResistanceFormulation.Manning_M;
flowResistance.ResistanceDistribution = ResistanceDistribution.Constant;
flowResistance.ResistanceValue = 80;
factory.SetFlowResistance(flowResistance);
factory.SetRadiusType(RadiusType.HydraulicRadiusTotalArea);
factory.SetRawPoints(crsPoints);
factory.SetDefaultMarkers();
return factory.GetCrossSection();
}
This will not be supported by MIKEIO in the foreseeable future.