@@ -16,7 +16,7 @@ constexpr auto acoustic = specfem::element::medium_tag::acoustic;
1616
1717struct input_holder {
1818 // Struct to hold temporary variables read from database file
19- type_real val0, val1, val2, val3, val4, val5, val6, val7, val8, val9, val10,
19+ double val0, val1, val2, val3, val4, val5, val6, val7, val8, val9, val10,
2020 val11, val12;
2121 int n, indic;
2222};
@@ -90,11 +90,12 @@ std::vector<specfem::mesh::materials::material_specification> read_materials(
9090
9191 // Acoustic Material
9292 if (read_values.val2 == 0 ) {
93- const type_real density = read_values.val0 ;
94- const type_real cp = read_values.val1 ;
95- const type_real compaction_grad = read_values.val3 ;
96- const type_real Qkappa = read_values.val5 ;
97- const type_real Qmu = read_values.val6 ;
93+ const type_real density = static_cast <type_real>(read_values.val0 );
94+ const type_real cp = static_cast <type_real>(read_values.val1 );
95+ const type_real compaction_grad =
96+ static_cast <type_real>(read_values.val3 );
97+ const type_real Qkappa = static_cast <type_real>(read_values.val5 );
98+ const type_real Qmu = static_cast <type_real>(read_values.val6 );
9899
99100 specfem::medium::material<acoustic, isotropic>
100101 acoustic_isotropic_holder (density, cp, Qkappa, Qmu,
@@ -113,12 +114,13 @@ std::vector<specfem::mesh::materials::material_specification> read_materials(
113114
114115 } else {
115116
116- const type_real density = read_values.val0 ;
117- const type_real cp = read_values.val1 ;
118- const type_real cs = read_values.val2 ;
119- const type_real compaction_grad = read_values.val3 ;
120- const type_real Qkappa = read_values.val5 ;
121- const type_real Qmu = read_values.val6 ;
117+ const type_real density = static_cast <type_real>(read_values.val0 );
118+ const type_real cp = static_cast <type_real>(read_values.val1 );
119+ const type_real cs = static_cast <type_real>(read_values.val2 );
120+ const type_real compaction_grad =
121+ static_cast <type_real>(read_values.val3 );
122+ const type_real Qkappa = static_cast <type_real>(read_values.val5 );
123+ const type_real Qmu = static_cast <type_real>(read_values.val6 );
122124
123125 specfem::medium::material<elastic, isotropic> elastic_isotropic_holder (
124126 density, cs, cp, Qkappa, Qmu, compaction_grad);
@@ -137,18 +139,18 @@ std::vector<specfem::mesh::materials::material_specification> read_materials(
137139 }
138140 // Ansotropic material
139141 else if (read_values.indic == 2 ) {
140- const type_real density = read_values.val0 ;
141- const type_real c11 = read_values.val1 ;
142- const type_real c13 = read_values.val2 ;
143- const type_real c15 = read_values.val3 ;
144- const type_real c33 = read_values.val4 ;
145- const type_real c35 = read_values.val5 ;
146- const type_real c55 = read_values.val6 ;
147- const type_real c12 = read_values.val7 ;
148- const type_real c23 = read_values.val8 ;
149- const type_real c25 = read_values.val9 ;
150- const type_real Qkappa = read_values.val11 ;
151- const type_real Qmu = read_values.val12 ;
142+ const type_real density = static_cast <type_real>( read_values.val0 ) ;
143+ const type_real c11 = static_cast <type_real>( read_values.val1 ) ;
144+ const type_real c13 = static_cast <type_real>( read_values.val2 ) ;
145+ const type_real c15 = static_cast <type_real>( read_values.val3 ) ;
146+ const type_real c33 = static_cast <type_real>( read_values.val4 ) ;
147+ const type_real c35 = static_cast <type_real>( read_values.val5 ) ;
148+ const type_real c55 = static_cast <type_real>( read_values.val6 ) ;
149+ const type_real c12 = static_cast <type_real>( read_values.val7 ) ;
150+ const type_real c23 = static_cast <type_real>( read_values.val8 ) ;
151+ const type_real c25 = static_cast <type_real>( read_values.val9 ) ;
152+ const type_real Qkappa = static_cast <type_real>( read_values.val11 ) ;
153+ const type_real Qmu = static_cast <type_real>( read_values.val12 ) ;
152154
153155 specfem::medium::material<elastic, anisotropic>
154156 elastic_anisotropic_holder (density, c11, c13, c15, c33, c35, c55, c12,
0 commit comments