Macro Deodatis 1996 Wind Simulation Points: Difference between revisions
Jump to navigation
Jump to search
(Created page with "{{Macro |Name=Macro Deodatis 1996 Wind Simulation Points |Icon=Macro_Deodatis_1996_Wind_Simulation_Points.png |Description=This macro create simulation point according to G. Deodatis 1996. |Author=Koffi Daniel |Version=1.0 |Date=2024-04-15 |RPSVersion=All |Download=[https://wiki.freecad.org/images/f/f5/Macro_3D_Parametric_Curve.png ToolBar Icon] |SeeAlso=Macro Deodatis 1996 Mean Wind Profile }} ==Description== This macro create...") |
(→Script) |
||
(13 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{Macro | {{Macro | ||
|Name=Macro Deodatis 1996 Wind Simulation Points | |Name=Macro Deodatis 1996 Wind Simulation Points | ||
|Description=This macro create simulation point according to G. Deodatis 1996. | |Description=This macro create simulation point according to G. Deodatis 1996. | ||
|Author= | |Author=LabRPS | ||
|Version=1.0 | |Version=1.0 | ||
|Date=2024-04-15 | |Date=2024-04-15 | ||
|RPSVersion=All | |RPSVersion=All | ||
|SeeAlso=[[Macro_Deodatis_1996_Mean_Wind_Profile|Macro Deodatis 1996 Mean Wind Profile]] | |SeeAlso=[[Macro_Deodatis_1996_Mean_Wind_Profile|Macro Deodatis 1996 Mean Wind Profile]] | ||
}} | }} | ||
This macro create simulation point according to G. Deodatis 1996. There are three simulation points created with WindLabFeatureLocationDistribution feature. | |||
[[File:Deodatis1996WindSimulationPoints.png|1024px|center]] | |||
{{Caption|Simulation Point Distribution}} | |||
[[File:Macro_Deodatis_1996_Wind_Simulation_Points_Heighs.png|600px|Points Heights|center]] | |||
[[File: | |||
== | ==Script== | ||
You can find the | You can find the source code on the following Github repository: | ||
[https://github.com/LabRPS/LabRPS-macros/blob/master/WindLab/Deodatis1996/Deodatis1996_LocationDistribution.RPSMacro Get the code here!] | [https://github.com/LabRPS/LabRPS-macros/blob/master/WindLab/Deodatis1996/Deodatis1996_LocationDistribution.RPSMacro Get the code here!] | ||
'''Macro_Deodatis_1996_Wind_Simulation_Points.RPSMacro''' | |||
{{Code|code= | |||
{{ | |||
# -*- coding: utf-8 -*- | # -*- coding: utf-8 -*- | ||
# (c) Koffi Daniel 2024 | # (c) Koffi Daniel 2024 | ||
import WindLab | import WindLab | ||
import GeneralToolsGui | |||
import WindLabObjects | import WindLabObjects | ||
from LabRPS import Vector as vec | |||
import LabRPS | |||
import numpy | |||
def compute(): | |||
installResuslt = WindLab.installPlugin("WindLabPlugin") | installResuslt = WindLab.installPlugin("WindLabPlugin") | ||
doc = LabRPS.newDocument() | doc = LabRPS.ActiveDocument | ||
if not doc: | |||
doc = LabRPS.newDocument() | |||
# create | # create WindLab simulation called "Simulation" | ||
sim = WindLabObjects.makeSimulation(doc) | sim = WindLabObjects.makeSimulation(doc, "Simulation") | ||
# check if the simulation | # check if the simulation does really exist | ||
if not sim: | if not sim: | ||
LabRPS.Console.PrintError("The simulation does not exist.\n") | |||
# abord the computation | |||
featureType = "General Distribution" | |||
featureGroup = "Location Distribution" | |||
# create the feature and add it to the existing simulation (you may refer to the WindLab Workbench page in | |||
# case you don't understand the next line) | |||
genSimPoints= WindLabObjects.makeFeature("MyNewFeature", sim.Name, featureType, featureGroup) | |||
# | # check if the created feature is good | ||
if not genSimPoints: | |||
LabRPS.Console.PrintError("Error on creating the uniform points feature.\n") | |||
# abord the computation | |||
# create | # create the simulation points by their coordinates | ||
v1 = vec(0, 0, 35) | |||
v2 = vec(0, 0, 40) | |||
v3 = vec(0, 0, 140) | |||
# | # add the points to the locations | ||
genSimPoints.Locations = [v1, v2, v3] | |||
# | # compute the simulation points coordinates. WindLab will internally use the "genSimPoints" feature | ||
simPoints = sim.computeLocationCoordinateMatrixP3() | |||
# now you can convert the coordinate matrix to numpy array and use it for any other purposes | |||
arr = numpy.asarray(simPoints) | |||
# | # you can also show the result in a table, pass False as last argument to the function to ask | ||
# | # LabRPS to only show the data without plotting them | ||
GeneralToolsGui.GeneralToolsPyTool.showArray(sim.getSimulationData().numberOfSpatialPosition, 4, simPoints, False) | |||
compute() | |||
}} | }} | ||
{{clear}} | {{clear}} |
Latest revision as of 19:59, 17 January 2025
Description |
---|
This macro create simulation point according to G. Deodatis 1996. Macro version: 1.0 Last modified: 2024-04-15 LabRPS version: All Author: LabRPS |
Author |
LabRPS |
Download |
None |
Links |
How to install macros How to customize toolbars |
Macro Version |
1.0 |
Date last modified |
2024-04-15 |
LabRPS Version(s) |
All |
Default shortcut |
None |
See also |
Macro Deodatis 1996 Mean Wind Profile |
This macro create simulation point according to G. Deodatis 1996. There are three simulation points created with WindLabFeatureLocationDistribution feature.
Simulation Point Distribution
Script
You can find the source code on the following Github repository: Get the code here!
Macro_Deodatis_1996_Wind_Simulation_Points.RPSMacro
# -*- coding: utf-8 -*- # (c) Koffi Daniel 2024 import WindLab import GeneralToolsGui import WindLabObjects from LabRPS import Vector as vec import LabRPS import numpy def compute(): installResuslt = WindLab.installPlugin("WindLabPlugin") doc = LabRPS.ActiveDocument if not doc: doc = LabRPS.newDocument() # create WindLab simulation called "Simulation" sim = WindLabObjects.makeSimulation(doc, "Simulation") # check if the simulation does really exist if not sim: LabRPS.Console.PrintError("The simulation does not exist.\n") # abord the computation featureType = "General Distribution" featureGroup = "Location Distribution" # create the feature and add it to the existing simulation (you may refer to the WindLab Workbench page in # case you don't understand the next line) genSimPoints= WindLabObjects.makeFeature("MyNewFeature", sim.Name, featureType, featureGroup) # check if the created feature is good if not genSimPoints: LabRPS.Console.PrintError("Error on creating the uniform points feature.\n") # abord the computation # create the simulation points by their coordinates v1 = vec(0, 0, 35) v2 = vec(0, 0, 40) v3 = vec(0, 0, 140) # add the points to the locations genSimPoints.Locations = [v1, v2, v3] # compute the simulation points coordinates. WindLab will internally use the "genSimPoints" feature simPoints = sim.computeLocationCoordinateMatrixP3() # now you can convert the coordinate matrix to numpy array and use it for any other purposes arr = numpy.asarray(simPoints) # you can also show the result in a table, pass False as last argument to the function to ask # LabRPS to only show the data without plotting them GeneralToolsGui.GeneralToolsPyTool.showArray(sim.getSimulationData().numberOfSpatialPosition, 4, simPoints, False) compute()