File indexing completed on 2026-04-09 07:49:47
0001 #pragma once
0002
0003 #if defined(__CUDACC__) || defined(__CUDABE__)
0004 #define SSTATE_METHOD __device__
0005 #else
0006 #define SSTATE_METHOD
0007 #endif
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025 struct sstate
0026 {
0027 float4 material1 ;
0028 float4 m1group2 ;
0029 float4 material2 ;
0030 float4 surface ;
0031
0032 uint4 optical ;
0033 uint4 index ;
0034
0035 #ifdef WAY_ENABLED
0036 float4 way0 ;
0037 float4 way1 ;
0038 #endif
0039
0040 #if defined(__CUDACC__) || defined(__CUDABE__)
0041 #else
0042 void save(const char* dir) const ;
0043 #endif
0044
0045
0046 };
0047
0048 #if defined(__CUDACC__) || defined(__CUDABE__)
0049 #else
0050 #include "NP.hh"
0051 inline void sstate::save(const char* dir) const
0052 {
0053 NP* st = NP::Make<float>(1, 6, 4 );
0054 st->read2( (float*)&material1.x );
0055 st->save(dir, "s.npy");
0056
0057 }
0058 #endif
0059
0060
0061
0062
0063
0064 #if defined(__CUDACC__) || defined(__CUDABE__)
0065 #else
0066 inline std::ostream& operator<<(std::ostream& os, const sstate& s )
0067 {
0068 os << "sstate"
0069 << std::endl
0070 << " material1 " << s.material1
0071 << " (refractive_index/absorption_length/scattering_length/reemission_prob) "
0072 << std::endl
0073 << " m1group2 " << s.m1group2
0074 << " (group_velocity/spare1/spare2/spare3) "
0075 << std::endl
0076 << " material2 " << s.material2
0077 << " (refractive_index/absorption_length/scattering_length/reemission_prob) "
0078 << std::endl
0079 << " surface " << s.surface
0080 << " (detect/absorb/reflect_specular/reflect_diffuse) "
0081 << std::endl
0082 << " optical " << s.optical
0083 << " (x/y/z/w index/type/finish/value) "
0084 << std::endl
0085 << " index " << s.index
0086 << " (indices of m1/m2/surf/sensor) "
0087 << std::endl
0088 ;
0089 return os;
0090 }
0091 #endif
0092
0093
0094
0095
0096
0097
0098
0099
0100
0101
0102
0103
0104
0105
0106
0107
0108
0109
0110
0111
0112
0113
0114
0115
0116
0117
0118
0119
0120
0121
0122
0123
0124
0125
0126
0127
0128
0129
0130
0131
0132
0133
0134
0135
0136
0137
0138
0139