简体   繁体   English

MEEP 中的金字塔和斜锥

[英]Pyramids and Oblique Cones in MEEP

Apologies if this is not the right place for this question.如果这不是这个问题的正确位置,我们深表歉意。

I've recently started using MIT's MEEP software (Python3, on Linux).我最近开始使用麻省理工学院的MEEP软件(Python3,在 Linux 上)。 I am quite new to it and would like to mostly use it for photovoltaics projects.我对它很陌生,想主要将它用于光伏项目。 Somewhat common shapes that show up here are "inverted pyramid" and slanted (oblique) cone structures.这里出现的有些常见的形状是“倒金字塔”和倾斜(斜)锥体结构。 Creating shapes in MEEP seems to generally be done with the GeometricObject class, but they don't seem to directly support either of these structures.在 MEEP 中创建形状似乎通常是通过GeometricObject类完成的,但它们似乎并不直接支持这些结构中的任何一种。 Is there any way around this or is my only real option simulating these structures by stacking small Block objects?有什么办法可以解决这个问题,还是我唯一真正的选择是通过堆叠小的 Block 对象来模拟这些结构?

As described in my own "answer" posted, it's not too difficult to just define these geometric objects myself, write a function to check if it's inside the object, and return the appropriate material.正如我自己发布的“答案”中所述,自己定义这些几何对象并编写一个函数来检查它是否在对象内部并返回适当的材料并不太难。 How would I go about converting this to a MEEP GeometricObject, instead of converting that to a material_func as I've done?我将如何将其转换为 MEEP GeometricObject,而不是像我所做的那样将其转换为 material_func?

No responses, so I thought I'd post my hacky way around it.没有回应,所以我想我会围绕它发布我的hacky方式。 There are two solutions: First is as mentioned in the question, just stacking MEEP's Block object.有两种解决方案:第一种是问题中提到的,只是堆叠MEEP的Block对象。 The other approach I did was define my own class Pyramid, which works basically the same way as described here .我所做的另一种方法是定义我自己的 Pyramid 类,它的工作方式与此处描述的基本相同。 Then, I convert a list of my class objects and MEEP's shape object to a function that takes a vector and returns a material, and this is fed as material_func in MEEP's Simulation object.然后,我将我的类对象列表和 MEEP 的形状对象转换为一个函数,该函数接受一个向量并返回一个材质,并将其作为 MEEP 的模拟对象中的 material_func 提供。 So far, it seems to work, hence I'm posting it as an answer.到目前为止,它似乎有效,因此我将其发布为答案。 However, It substantially slows down subpixel averaging (and maybe the rest of the simulation, though I haven't done an actual analysis), so I'm not very happy with it.然而,它大大减慢了子像素平均(可能还有模拟的其余部分,尽管我还没有进行实际分析),所以我对它不是很满意。

I'm not sure which is "better" but the second method does feel more precise, insofar that you have pyramids, not just a stack of Blocks.我不确定哪个“更好”,但第二种方法确实感觉更精确,只要你有金字塔,而不仅仅是一堆块。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM