-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Synthesis for channels, inputs/outputs, T-junctions #3
Conversation
(and they're harder to read anyways)
import org.manifold.compiler.back.microfluidics.strategies.multiphase.TJunctionDeviceStrategy; | ||
import org.manifold.compiler.middle.Schematic; | ||
|
||
public class MultiPhaseStrategySet extends TranslationStrategy { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the name MultiPhaseStrategySet too general for this code? It seems to be restricted to a combination of DropletConstraintStrategy and TJunctionDeviceStrategy. I see a few possibilities here:
0. Everything is just fine.
- Rename the class to something more specific.
- Generalize the code using type parameters (but still a pair of strategies).
- Generalize the code using a collection to hold the strategies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea for this class is that as we create new strategies for different multi-phase devices, we add them here to isolate them from the single-phase devices.
I have a perhaps odd habit of declaring everything final, including method parameters and local variables. I think it's a good discipline to help focus on where mutation is happening. Of course, I think it would be better if this were the default, and variables that could be re-assigned needed to be declared as such. |
I didn't fully grasp how Divij's question about the area of nodes and channels is handled in this code. |
}; | ||
|
||
Schematic schematic = UtilSchematicConstruction | ||
.instantiateSchematic("test"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should change the name to something more specific instead of "test". In this case it could be tjunction_test or something. In the singlephase-electrophoresis branch I had to make this change explicitly because once there are multiple tests, it helps for this to be specified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is tjunction_test
more informative or specific than testTJunctionSynthesis
? I don't understand your comment about why it is necessary to specify this when there are multiple tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name of the function is fine, I am referring to the label used for instantiation in line 40. The label, which in this case is "test", used to instantiate the schematic also works as the prefix for the *.smt2 that is generated by the backend. When there are a number of tests being run, it creates multiple smt2 files, when it's useful to have labels that provide more information about the specific schematic the smt2 files describes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see the issue -- I'll fix this next commit.
Opened #5 |
…ckend-microfluidics into tjunction-synthesis Conflicts: src/test/java/org/manifold/compiler/back/microfluidics/TestMicrofluidicsBackend.java
(also, set epsilon=0 for sharp-edged T-junctions)
and worst-case droplet stuff
Okay, now this is ready to review; I disabled the experimental stuff and kept the version of the code that has it all in another branch. (The stuff is disabled selectively, so we can boolean-flag it back on if we want to revisit.) Closes #13. |
Two more things I have to do, are not run the multi-phase stuff for non-multi-phase devices and constrain input and output pressures to be strictly positive. |
Latest commit closes #14. |
This was signed off, so merging. |
Synthesis for channels, inputs/outputs, T-junctions
No description provided.