Skip to content

Commit d199d70

Browse files
bnbailey-pslktrizzoIsmaelMayanjasmbanx
committed
[1.3.28] 2025-02-25
+++++ NEW PLUG-IN ++++++ - project builder plug-in added. GUI and XML interface for creating projects. This is still in beta testing. Credit to Sean Banks for this addition. ++Substantial expansion of self-tests for boundarylayerconductance, energybalance, photosynthesis, solarposition, stomatalconductance, syntheticannotation, and visualizer plug-ins ++New documentation theme *Context* - Many upgrades to substantially improve performance for CPU code. - Upgrades to OBJ file writing, including making Gazebo compatable and adding option to write normals to OBJ files. Credit to LeRoy Corentin for this addition. *Radiation* - Minor change in RadiationModel::runBand() to set all primitive data values in a single Context method call for efficiency. - Changed up logic for radiation property setting. If a spectrum is specified for reflectivity or transmissivity, this can be overridden for a single band by specifying the primitive data "reflectivity_[bandname]" or "transmissivity_[bandname]". *Plant Architecture* - cowpeaLeafPrototype_unifoliate_OBJ() asset function was incorrect in the last commit, and would cause an error if used. - The plugin now writes primitive data "object_label" for all organs it creates. - Some minor fixes to bean OBJ assets. - Removed erroneous organ labels in MaizeTassel.obj and TomatoFlower.obj assets. *Boundary-layer Conductance* - Corrected spelling of 'Pohlhausen'. This should still be backward compatible, as it also accepts the spelling "Polhausen". *Photosynthesis* - The way parameters are set for the FvCB model has been clarified to be more explicitly clear about how temperature response is being treated. Co-authored-by: Kyle Rizzo <ktrizzo@users.noreply.github.com> Co-authored-by: Ismael Mayanja <IsmaelMayanja@users.noreply.github.com> Co-authored-by: Sean Banks <smbanx@users.noreply.github.com>
1 parent 31feb26 commit d199d70

1,267 files changed

Lines changed: 264539 additions & 80518 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

core/CMake_project.txt

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ if ( WIN32 )
1818
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${OUTPUTCONFIG} "${CMAKE_BINARY_DIR}/lib" )
1919
endforeach(OUTPUTCONFIG)
2020
endif()
21-
if( CMAKE_BUILD_TYPE STREQUAL Debug )
22-
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DHELIOS_DEBUG" )
23-
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHELIOS_DEBUG")
24-
endif()
2521
cmake_policy(SET CMP0079 NEW)
2622
set(CMAKE_WARN_DEPRECATED OFF CACHE BOOL "" FORCE)
2723

@@ -50,17 +46,16 @@ foreach(PLUGIN ${PLUGINS})
5046
endforeach(PLUGIN)
5147
include_directories( "${PLUGIN_INCLUDE_PATHS};${CMAKE_CURRENT_SOURCE_DIRECTORY}" )
5248

49+
if( CMAKE_BUILD_TYPE STREQUAL Debug OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo" )
50+
target_compile_definitions(helios PRIVATE HELIOS_DEBUG)
51+
endif()
52+
5353
if( ENABLE_OPENMP )
5454
find_package(OpenMP)
5555
if (OpenMP_CXX_FOUND)
5656
message( "-- Enabling experimental OpenMP support" )
57-
target_link_libraries(${EXECUTABLE_NAME} OpenMP::OpenMP_CXX)
58-
target_compile_definitions(${EXECUTABLE_NAME} PRIVATE USE_OPENMP)
59-
if ( WIN32 )
60-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /openmp")
61-
else()
62-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
63-
endif()
57+
target_link_libraries(helios PUBLIC OpenMP::OpenMP_CXX)
58+
target_compile_definitions(helios PUBLIC USE_OPENMP)
6459
else()
6560
if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
6661
message(WARNING "You are using Apple Clang compiler, which does not support OpenMP. The program will compile without OpenMP support.")

core/include/Context.h

Lines changed: 117 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2539,86 +2539,185 @@ class Context{
25392539
* \param[in] label Name/label associated with data
25402540
* \param[in] data Primitive data value (scalar)
25412541
*/
2542-
void setPrimitiveData( const uint& UUID, const char* label, const int& data );
2542+
void setPrimitiveData( uint UUID, const char* label, const int& data );
2543+
2544+
//! Add data value (int) associated with a vector of primitive elements. Each element in UUIDs maps to each element in data.
2545+
/**
2546+
* \note the size of UUIDs and data must match
2547+
* \param[in] UUIDs Unique universal identifiers of Primitive elements
2548+
* \param[in] label Name/label associated with data
2549+
* \param[in] data Primitive data value (vector)
2550+
*/
2551+
void setPrimitiveData( const std::vector<uint> &UUIDs, const char* label, const std::vector<int> &data );
25432552

25442553
//! Add data value (uint) associated with a primitive element
25452554
/**
25462555
* \param[in] UUID Unique universal identifier of Primitive element
25472556
* \param[in] label Name/label associated with data
25482557
* \param[in] data Primitive data value (scalar)
25492558
*/
2550-
void setPrimitiveData( const uint& UUID, const char* label, const uint& data );
2559+
void setPrimitiveData( uint UUID, const char* label, const uint& data );
2560+
2561+
//! Add data value (uint) associated with a vector of primitive elements. Each element in UUIDs maps to each element in data.
2562+
/**
2563+
* \note the size of UUIDs and data must match
2564+
* \param[in] UUIDs Unique universal identifiers of Primitive elements
2565+
* \param[in] label Name/label associated with data
2566+
* \param[in] data Primitive data value (vector)
2567+
*/
2568+
void setPrimitiveData( const std::vector<uint> &UUIDs, const char* label, const std::vector<uint> &data );
25512569

25522570
//! Add data value (float) associated with a primitive element
25532571
/**
25542572
* \param[in] UUID Unique universal identifier of Primitive element
25552573
* \param[in] label Name/label associated with data
25562574
* \param[in] data Primitive data value (scalar)
25572575
*/
2558-
void setPrimitiveData( const uint& UUID, const char* label, const float& data );
2576+
void setPrimitiveData( uint UUID, const char* label, const float& data );
2577+
2578+
//! Add data value (float) associated with a vector of primitive elements. Each element in UUIDs maps to each element in data.
2579+
/**
2580+
* \note the size of UUIDs and data must match
2581+
* \param[in] UUIDs Unique universal identifiers of Primitive elements
2582+
* \param[in] label Name/label associated with data
2583+
* \param[in] data Primitive data value (vector)
2584+
*/
2585+
void setPrimitiveData( const std::vector<uint> &UUIDs, const char* label, const std::vector<float> &data );
25592586

25602587
//! Add data value (double) associated with a primitive element
25612588
/**
25622589
* \param[in] label Name/label associated with data
25632590
* \param[in] data Primitive data value (scalar)
25642591
*/
2565-
void setPrimitiveData( const uint& UUID, const char* label, const double& data );
2592+
void setPrimitiveData( uint UUID, const char* label, const double& data );
2593+
2594+
//! Add data value (double) associated with a vector of primitive elements. Each element in UUIDs maps to each element in data.
2595+
/**
2596+
* \note the size of UUIDs and data must match
2597+
* \param[in] UUIDs Unique universal identifiers of Primitive elements
2598+
* \param[in] label Name/label associated with data
2599+
* \param[in] data Primitive data value (vector)
2600+
*/
2601+
void setPrimitiveData( const std::vector<uint> &UUIDs, const char* label, const std::vector<double> &data );
25662602

25672603
//! Add data value (vec2) associated with a primitive element
25682604
/**
25692605
* \param[in] UUID Unique universal identifier of Primitive element
25702606
* \param[in] label Name/label associated with data
25712607
* \param[in] data Primitive data value (scalar)
25722608
*/
2573-
void setPrimitiveData( const uint& UUID, const char* label, const helios::vec2& data );
2609+
void setPrimitiveData( uint UUID, const char* label, const helios::vec2& data );
2610+
2611+
//! Add data value (vec2) associated with a vector of primitive elements. Each element in UUIDs maps to each element in data.
2612+
/**
2613+
* \note the size of UUIDs and data must match
2614+
* \param[in] UUIDs Unique universal identifiers of Primitive elements
2615+
* \param[in] label Name/label associated with data
2616+
* \param[in] data Primitive data value (vector)
2617+
*/
2618+
void setPrimitiveData( const std::vector<uint> &UUIDs, const char* label, const std::vector<vec2> &data );
25742619

25752620
//! Add data value (vec3) associated with a primitive element
25762621
/**
25772622
* \param[in] UUID Unique universal identifier of Primitive element
25782623
* \param[in] label Name/label associated with data
25792624
* \param[in] data Primitive data value (scalar)
25802625
*/
2581-
void setPrimitiveData( const uint& UUID, const char* label, const helios::vec3& data );
2626+
void setPrimitiveData( uint UUID, const char* label, const helios::vec3& data );
2627+
2628+
//! Add data value (vec3) associated with a vector of primitive elements. Each element in UUIDs maps to each element in data.
2629+
/**
2630+
* \note the size of UUIDs and data must match
2631+
* \param[in] UUIDs Unique universal identifiers of Primitive elements
2632+
* \param[in] label Name/label associated with data
2633+
* \param[in] data Primitive data value (vector)
2634+
*/
2635+
void setPrimitiveData( const std::vector<uint> &UUIDs, const char* label, const std::vector<vec3> &data );
25822636

25832637
//! Add data value (vec4) associated with a primitive element
25842638
/**
25852639
* \param[in] UUID Unique universal identifier of Primitive element
25862640
* \param[in] label Name/label associated with data
25872641
* \param[in] data Primitive data value (scalar)
25882642
*/
2589-
void setPrimitiveData( const uint& UUID, const char* label, const helios::vec4& data );
2643+
void setPrimitiveData( uint UUID, const char* label, const helios::vec4& data );
2644+
2645+
//! Add data value (vec4) associated with a vector of primitive elements. Each element in UUIDs maps to each element in data.
2646+
/**
2647+
* \note the size of UUIDs and data must match
2648+
* \param[in] UUIDs Unique universal identifiers of Primitive elements
2649+
* \param[in] label Name/label associated with data
2650+
* \param[in] data Primitive data value (vector)
2651+
*/
2652+
void setPrimitiveData( const std::vector<uint> &UUIDs, const char* label, const std::vector<vec4> &data );
25902653

25912654
//! Add data value (int2) associated with a primitive element
25922655
/**
25932656
* \param[in] UUID Unique universal identifier of Primitive element
25942657
* \param[in] label Name/label associated with data
25952658
* \param[in] data Primitive data value (scalar)
25962659
*/
2597-
void setPrimitiveData( const uint& UUID, const char* label, const helios::int2& data );
2660+
void setPrimitiveData( uint UUID, const char* label, const helios::int2& data );
2661+
2662+
//! Add data value (int2) associated with a vector of primitive elements. Each element in UUIDs maps to each element in data.
2663+
/**
2664+
* \note the size of UUIDs and data must match
2665+
* \param[in] UUIDs Unique universal identifiers of Primitive elements
2666+
* \param[in] label Name/label associated with data
2667+
* \param[in] data Primitive data value (vector)
2668+
*/
2669+
void setPrimitiveData( const std::vector<uint> &UUIDs, const char* label, const std::vector<int2> &data );
25982670

25992671
//! Add data value (int3) associated with a primitive element
26002672
/**
26012673
* \param[in] UUID Unique universal identifier of Primitive element
26022674
* \param[in] label Name/label associated with data
26032675
* \param[in] data Primitive data value (scalar)
26042676
*/
2605-
void setPrimitiveData( const uint& UUID, const char* label, const helios::int3& data );
2677+
void setPrimitiveData( uint UUID, const char* label, const helios::int3& data );
2678+
2679+
//! Add data value (int3) associated with a vector of primitive elements. Each element in UUIDs maps to each element in data.
2680+
/**
2681+
* \note the size of UUIDs and data must match
2682+
* \param[in] UUIDs Unique universal identifiers of Primitive elements
2683+
* \param[in] label Name/label associated with data
2684+
* \param[in] data Primitive data value (vector)
2685+
*/
2686+
void setPrimitiveData( const std::vector<uint> &UUIDs, const char* label, const std::vector<int3> &data );
26062687

26072688
//! Add data value (int4) associated with a primitive element
26082689
/**
26092690
* \param[in] UUID Unique universal identifier of Primitive element
26102691
* \param[in] label Name/label associated with data
26112692
* \param[in] data Primitive data value (scalar)
26122693
*/
2613-
void setPrimitiveData( const uint& UUID, const char* label, const helios::int4& data );
2694+
void setPrimitiveData( uint UUID, const char* label, const helios::int4& data );
2695+
2696+
//! Add data value (int4) associated with a vector of primitive elements. Each element in UUIDs maps to each element in data.
2697+
/**
2698+
* \note the size of UUIDs and data must match
2699+
* \param[in] UUIDs Unique universal identifiers of Primitive elements
2700+
* \param[in] label Name/label associated with data
2701+
* \param[in] data Primitive data value (vector)
2702+
*/
2703+
void setPrimitiveData( const std::vector<uint> &UUIDs, const char* label, const std::vector<int4> &data );
26142704

26152705
//! Add data value (string) associated with a primitive element
26162706
/**
26172707
* \param[in] UUID Unique universal identifier of Primitive element
26182708
* \param[in] label Name/label associated with data
26192709
* \param[in] data Primitive data value (scalar)
26202710
*/
2621-
void setPrimitiveData( const uint& UUID, const char* label, const std::string& data );
2711+
void setPrimitiveData( uint UUID, const char* label, const std::string& data );
2712+
2713+
//! Add data value (string) associated with a vector of primitive elements. Each element in UUIDs maps to each element in data.
2714+
/**
2715+
* \note the size of UUIDs and data must match
2716+
* \param[in] UUIDs Unique universal identifiers of Primitive elements
2717+
* \param[in] label Name/label associated with data
2718+
* \param[in] data Primitive data value (vector)
2719+
*/
2720+
void setPrimitiveData( const std::vector<uint> &UUIDs, const char* label, const std::vector<std::string> &data );
26222721

26232722
//! Add data associated with a primitive element
26242723
/**
@@ -2628,7 +2727,7 @@ class Context{
26282727
* \param[in] size Number of data elements
26292728
* \param[in] data Pointer to primitive data
26302729
*/
2631-
void setPrimitiveData( const uint& UUIDs, const char* label, HeliosDataType type, uint size, void* data );
2730+
void setPrimitiveData( uint UUID, const char* label, HeliosDataType type, uint size, void* data );
26322731

26332732
//! Add data value (int) associated with a primitive element
26342733
/**
@@ -5947,23 +6046,26 @@ class Context{
59476046
//! Write geometry in the Context to a Wavefront file (.obj)
59486047
/**
59496048
* \param[in] filename Base filename of .obj and .mtl file
6049+
* \param[in] write_normals true if we should write the normal vectors
59506050
*/
5951-
void writeOBJ( const std::string &filename ) const;
6051+
void writeOBJ( const std::string &filename, bool write_normals = false ) const;
59526052

59536053
//! Write geometry in the Context to a Wavefront file (.obj) for a subset of UUIDs
59546054
/**
59556055
* \param[in] filename Base filename of .obj and .mtl file
59566056
* \param[in] UUIDs Vector of UUIDs for which geometry should be written
6057+
* \param[in] write_normals true if we should write the normal vectors
59576058
*/
5958-
void writeOBJ( const std::string &filename, const std::vector<uint> &UUIDs ) const;
6059+
void writeOBJ( const std::string &filename, const std::vector<uint> &UUIDs, bool write_normals = false ) const;
59596060

59606061
//! Write geometry in the Context to a Wavefront file (.obj)
59616062
/**
59626063
* \param[in] filename Base filename of .obj and .mtl file
59636064
* \param[in] UUIDs Vector of UUIDs for which geometry should be written
59646065
* \param[in] primitive_dat_fields A .dat file will be written containing primitive data given in this vector (for Unity visualization)
6066+
* \param[in] write_normals true if we should write the normal vectors
59656067
*/
5966-
void writeOBJ( const std::string &filename, const std::vector<uint> &UUIDs, const std::vector<std::string> &primitive_dat_fields ) const;
6068+
void writeOBJ( const std::string &filename, const std::vector<uint> &UUIDs, const std::vector<std::string> &primitive_dat_fields, bool write_normals = false ) const;
59676069

59686070
//! Set simulation date by day, month, year
59696071
/**

core/include/global.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ constexpr float PI_F = 3.14159265358979323846f;
4545
#include <memory>
4646
#include <ctime>
4747
#include <map>
48+
#include <unordered_map>
4849
#include <algorithm>
4950
#include <ctime>
5051
#include <random>

0 commit comments

Comments
 (0)