Jump to content

Sasha1296

Members
  • Content Count

    17
  • Joined

  • Last visited

About Sasha1296

  • Rank
    Beginner

Profile Information

  • Are you University user?
    Yes

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Thanks for the suggestion! I got it to work I actually didn't know anything about macros before, but now I realize it's a pretty useful tool
  2. Hello I am working on a project where this time there is an aluminum cube shell and an spiral antenna present in the FEKO model file. I am trying to simulate lots of configurations of a perfect electrically conductive cube inside the aluminum cube shell by generating a random cube (random length, random x, y, z coordinates). Before I had a different simulation where nothing was present originally in the model and I got it to run, however this time I am getting an error I suspect it has something to do with the objects present in the model before the cube is generated: "84: Error 16271: Empty expression is not allowed for Segment size. Error 16628: Error in expression at position 0 for expression: Segment size = " I'm not sure how to fix this All_Coil_200Hz_20_20_5_zN10.cfx aluminium_box_automating.lua
  3. Thank you MvdM it workes! I ran your script and it worked, the issue with my script looks like was in the line properties_m.TriangleEdgeLength = mesh_length not in any weird settings that I thought the issue might be in now I instead set the triangle edge length to = length_/5 it generates a fine mesh for all of the cubes!
  4. the for loop creates cubes one at a time I guess that's what I meant, Edit: I have a for loop: for i = 1, 6 do and buried inside of it is: temp_cube = project.Geometry:AddCuboid(cf.Point(x_pos_list-length_, y_pos_list, 0), length_, length_, length_) and after creating each cube I want to mesh it individually You wrote: "An alternative could be meshing the cubes one-by-one, which is what you initially set out to do. But then you have to change the mesh size for each cube if you want the cubes to have different mesh sizes! Either set local mesh sizes and mesh the whole model once (using Mesh), or mesh the cubes one-by-one (with MeshSelective) using different mesh sizes for each meshing operation." That's the issue I've been having, when I run the script in the many configurations I've tried, the script produces cubes but the meshing is not local to the cubes based on size. I've been trying to either set local mesh sizes and mesh the whole thing at the end, but the smallest cubes still don't have the mesh I wrote into the script (0.01) versus the mesh for the other cubes which is 0.2 this is what I tried when I tested: for key,value in pairs(temp_cube.Faces) do -- also tried temp_cuge.Edges value.LocalMeshSize = mesh_length_ end but it didn't produce cubes with different mesh sizes based on the length of the cubes when I ran it Also I tried the other method which is: MeshSettings = project.Mesher.Settings properties_m = MeshSettings:GetProperties() properties_m.MeshSizeOption = cf.Enums.MeshSizeOptionEnum.Custom properties_m.TriangleEdgeLength = mesh_length -- Based on cube size MeshSettings:SetProperties(properties_m) project.Mesher:MeshSelective({temp_cube} ,{}) But again the cubes don't seem to mesh differently depending on their length I can't seem to figure out why this is? Edit 2: perhaps I'm just missing a simple command like: project.Geometry.LocalMeshSizeEnabled = true but I can't figure out if that's the case or how to use this command
  5. Is there a way to do this via lua script? I am planning to generate about 1,000 to 10,000 .cfx files in the results folder with random cubes as defined in lua script in the last post Edit: Also just as a thought, could the issue be that I'm not using some variation of the command(I'm not sure how to use it): value.LocalMeshSizeEnabled = true in the for loop from the previous post: for key,value in pairs(temp_cube.Faces) do -- also tried temp_cuge.Edges value.LocalMeshSize = mesh_length_ end
  6. Ok The measurement attempt cfx file is mosty a blank file used to generate a lot of other files measurmen attempt 1 lua is the corresponding lua script the Cad_138_..... stuff.cfx is one of the output example files that gets generated in the results folder Cad_138_112_145_62_121_100_15_73_223_293_405_444_49_48_45_0_18_82_.cfx measurment_attempt_cadfeko.cfx measurment_attempt1.lua
  7. I tried these variations: -- for loop with index i that creates many cubes here mesh_length = "0.2" mesh_length_ = 0.2 if (length<0.25) then mesh_length = "0.01" mesh_length_ = 0.01 end cube_count = cube_count + 1 temp_cube = project.Geometry:AddCuboid(cf.Point(x_pos_list-length_, y_pos_list, 0), length_, length_, length_) for key,value in pairs(temp_cube.Faces) do -- also tried temp_cuge.Edges value.LocalMeshSize = mesh_length_ end project.Mesher:MeshSelective({temp_cube} ,{}) -- for loop with index i that enes here And a couple variations of the following: -- for loop with index i that creates many cubes here mesh_length = "0.2" mesh_length_ = 0.2 if (length<0.25) then mesh_length = "0.01" mesh_length_ = 0.01 end cube_count = cube_count + 1 temp_cube = project.Geometry:AddCuboid(cf.Point(x_pos_list-length_, y_pos_list, 0), length_, length_, length_) MeshSettings = project.Mesher.Settings properties_m = MeshSettings:GetProperties() properties_m.MeshSizeOption = cf.Enums.MeshSizeOptionEnum.Custom properties_m.TriangleEdgeLength = mesh_length MeshSettings:SetProperties(properties_m) project.Mesher:MeshSelective({temp_cube} ,{}) -- also tried with the previous project.Mesher:Mesh() -- for loop with index i that enes here Unfortunatly in all these cases it seems that the smallest cubes don't mesh finely though, the smallest cube in one simulation for example had only 12 triangles dspite it's length being 0.18. My goal is to get it so that each cube will mesh to at least 5 triangles per face
  8. Hello One thing I couldn't find in the manual is how to mesh different objects with different triangle edge lengths? What I am trying to do is mesh different objects differently because I have some large cubes that don't need a very fine mesh but I also have some cubes that are very small that need a much smaller mesh size What I am trying to do is something like this based on a previous post: -- for loop that will create many cubes here base on index i temp_cube = project.Geometry:AddCuboid(cf.Point(x_pos_list, y_pos_list, 0), length_, length_, length_) MeshSettings = project.Mesher.Settings properties_m = MeshSettings:GetProperties() properties_m.MeshSizeOption = cf.Enums.MeshSizeOptionEnum.Custom properties_m.TriangleEdgeLength = SOME_STRING_BASED_ON_CUBE_SIZE -- ex: "0.1" or "0.2", etc MeshSettings:SetProperties(properties_m) project.Mesher:Mesh(temp_cube) -- end of for loop where the last command project.Mesher:Mesh(temp_cube) only meshes the temp_cube in question and doesn't mesh any other objects also I have access to the cube number in this loop in case that is useful
  9. Thank you so much for your help Everything worked!
  10. Thank you! One more question, is there a way to close a CADFEKO project from script? I got the code to work to produce lots of .out files for different configurations of objects, however it seems that they are still open somehow If I try to delete everything in the "results" folder where I save the different iterations I looped through it says it cannot do so because these files are still open even though the generated CADFEKO files don't show up, only the original project seems to be actually open is there a way to do something like: --- loop the following many times --- create new setup/project --- save as new project in results folder project.Launcher:RunFEKO() project.Close() Except the last command doesn't work?
  11. Hello I've been having a difficulty with meshing cubes, when I run the command in lua script: project.Mesher.Settings.MeshSizeOption = cf.Enums.MeshSizeOptionEnum.Fine The mesh that is generated doesn't have enough triangles, I tried to fix this by writing: project.Mesher.Settings.MeshSizeOption = cf.Enums.MeshSizeOptionEnum.Custom project.Mesher.Settings.TriangleEdgeLength = 0.2 but I get an error: "Empty expression is not allowed for Edge size. Error 16628: Error in expression at position 0 for expression: Edge size = " How can I fix this error and set the triangle edge length to 0.2 using Lua?
  12. So when I look in help\feko\pdf these are the files that I see: "ExampleGuide.pdf" 7,281 Kb "GetStarted.pdf" 2,892 Kb "InstallationGuide.pdf" 3,486 Kb "QuickTips_CADFEKO.pdf" 806 Kb "QuickTips_POSTFEKO.pdf" 1,037 Kb Readme "ReleaseNotes.pdf" 1,548 Kb "UserManual.pdf" 52,236 Kb Is the pdf "Altair_Feko_Scripting_API_Reference_Guide.pdf" just named differently in my folder? Also I wrote a cadfeko script that I hope to use to create a bunch of .out files but for now it doesn't seem to be working: It doesn't generate .out files and I cant seem to get the project.Mesher.Settings.TriangleEdgeLength = 0.2 command to run because currently my cubes are not meshed fine enough by default. If I have the mentioned line uncommented I get an error "Unable to use the property as it is disabled" app = cf.GetApplication() project = app:OpenFile("C:/Users/an/Desktop/spiral antenna stuff/New folder/automating_data3/measurment_attempt_cadfeko.cfx") ---------corner = cf.Point(-0.25, -0.25, 0) ----------cube = project.Geometry:AddCuboid(corner, 0.5, 0.5, 10.25) x_pos_list = {-0.1, -0.5, -0.4} y_pos_list = {3.0, 5.0, 9.0} Length_list = {0.5, 1.0, 0.64} Xt = 3.05 Yt = -1.0 for i = 1, #x_pos_list do print("begining loop") project = app:OpenFile("C:/Users/an/Desktop/spiral antenna stuff/New folder/automating_data3/measurment_attempt_cadfeko.cfx") corner = cf.Point(x_pos_list, y_pos_list, 0.0) cube = project.Geometry:AddCuboid(corner, Length_list, Length_list, Length_list) StandardConfiguration1 = project.SolutionConfigurations["StandardConfiguration1"] --Freq = StandardConfiguration1.Frequency MagneticSource = StandardConfiguration1.Sources["MagneticPointSource1"] -- It is for magnetic source. It needs to match the name of the dipole in CADFEKO. properties = MagneticSource:GetProperties() properties.Position.U = Xt -- get the x location of the dipole from CADFEKO properties.Position.V = Yt -- get the y location properties.Position.N = 0.6 -- get the z location ---1 + y_incrament*iter MagneticSource:SetProperties(properties) --C:\Users\an\Desktop\spiral antenna stuff\New folder\automating_data3\results --project = app:OpenFile(savePath) --project.Mesher.Settings.MeshSize = 0.2 project.Mesher.Settings.Wi project.Mesher.Settings.WireRadius = "0.001" --project.Mesher.Settings.TriangleEdgeLength = 0.2 project.Mesher:Mesh() project.Launcher:RunFEKO() savePath = "C:/Users/an/Desktop/spiral antenna stuff/New folder/automating_data3/results/" savePath = savePath .."Cadfeko_test_" .. i .. ".cfx" -- save files for each cases app:SaveAs(savePath) print(i) end
  13. Thanks for replying! I apologize I'm not very experienced with FEKO, I can't seem to find the file you mentioned in the help folder Altair_Feko_Scripting_API_Reference_Guide.pdf I guess the thing that I am struggling the most is to figure out how to go from one version of FEKO to another through script. If simulation is done in CADFEKO and POSTFEKO basically analyzes the results(that's what I understand is how it woks), how can I launch postfeko(assuming I have to do so) from a Lua Script that was made in CADFEKO? Such that I run the simulation and record measurments using just a script and then repeat?
  14. I am trying to automate taking a lot of measurements with FEKO Basically what I am trying to do is create a large dataset for a neural network and do that by writing a Lua script that does the following: 1) generate a few random let's say for now perfect conductor objects(cubes, spheres,...etc) at random positions with random sizes constrained by some constraints 2) create a source let's say 7 feet from the objects and send a wave at the objects 3) run simulation and measure the Hy field component at 6 evenly spaced locations let's say 1 foot from the objects 4) repeat many times, changing the position of the source and the position of the 6 measurement points by an interval in a given direction 5) store measurements in a file 6) repeat 1-5 many times, generating a new set of random objects that are randomly placed and have random sizes and take a lot of measurements as described earler I've been trying to figure out how to do this for a while for a project, any help would be greatly appreciated Many thanks!
×
×
  • Create New...