1035 * K_e = \mu\frac{3\lambda +2\mu}{\lambda+\mu}
1039 * double elastic_constant;
1042 * elastic_constant = 4 * mu * (lambda + mu) / (lambda + 2 * mu);
1044 * else if (dim == 3)
1046 * elastic_constant = mu * (3 * lambda + 2 * mu) / (lambda + mu);
1049 * DEAL_II_NOT_IMPLEMENTED();
1051 * const double material_a_speed_of_sound =
1052 * std::sqrt(elastic_constant / material_a_rho);
1053 * const double material_a_wavelength =
1054 * material_a_speed_of_sound / cavity_resonance_frequency;
1055 * const double material_b_speed_of_sound =
1056 * std::sqrt(elastic_constant / material_b_rho);
1057 * const double material_b_wavelength =
1058 * material_b_speed_of_sound / cavity_resonance_frequency;
1062 * The density @f$\rho@f$ takes the following form
1063 * <img alt="Phononic superlattice cavity"
1064 * src="https://www.dealii.org/images/steps/developer/step-62.04.svg"
1066 * where the brown color represents material_a and the green color
1067 * represents material_b.
1070 * for (unsigned int idx = 0; idx < nb_mirror_pairs; ++idx)
1072 * const double layer_transition_center =
1073 * material_a_wavelength / 2 +
1074 * idx * (material_b_wavelength / 4 + material_a_wavelength / 4);
1075 * if (std::abs(p[0]) >=
1076 * (layer_transition_center - average_rho_width / 2) &&
1077 * std::abs(p[0]) <= (layer_transition_center + average_rho_width / 2))
1079 * const double coefficient =
1081 * (layer_transition_center - average_rho_width / 2)) /
1082 * average_rho_width;
1083 * return (1 - coefficient) * material_a_rho +
1084 * coefficient * material_b_rho;
1090 * Here we define the
1092 * smoothing](https://meep.readthedocs.io/en/latest/Subpixel_Smoothing/)
1093 * which improves the precision of the simulation.
1096 * for (unsigned int idx = 0; idx < nb_mirror_pairs; ++idx)
1098 * const double layer_transition_center =
1099 * material_a_wavelength / 2 +
1100 * idx * (material_b_wavelength / 4 + material_a_wavelength / 4) +
1101 * material_b_wavelength / 4;
1102 * if (std::abs(p[0]) >=
1103 * (layer_transition_center - average_rho_width / 2) &&
1104 * std::abs(p[0]) <= (layer_transition_center + average_rho_width / 2))
1106 * const double coefficient =
1108 * (layer_transition_center - average_rho_width / 2)) /
1109 * average_rho_width;
1110 * return (1 - coefficient) * material_b_rho +
1111 * coefficient * material_a_rho;
1120 * if (std::abs(p[0]) <= material_a_wavelength / 2)
1122 * return material_a_rho;
1127 * the material_a layers
1130 * for (unsigned int idx = 0; idx < nb_mirror_pairs; ++idx)
1132 * const double layer_center =
1133 * material_a_wavelength / 2 +
1134 * idx * (material_b_wavelength / 4 + material_a_wavelength / 4) +
1135 * material_b_wavelength / 4 + material_a_wavelength / 8;
1136 * const double layer_width = material_a_wavelength / 4;
1137 * if (std::abs(p[0]) >= (layer_center - layer_width / 2) &&
1138 * std::abs(p[0]) <= (layer_center + layer_width / 2))
1140 * return material_a_rho;
1146 * the material_b layers
1149 * for (unsigned int idx = 0; idx < nb_mirror_pairs; ++idx)
1151 * const double layer_center =
1152 * material_a_wavelength / 2 +
1153 * idx * (material_b_wavelength / 4 + material_a_wavelength / 4) +
1154 * material_b_wavelength / 8;
1155 * const double layer_width = material_b_wavelength / 4;
1156 * if (std::abs(p[0]) >= (layer_center - layer_width / 2) &&
1157 * std::abs(p[0]) <= (layer_center + layer_width / 2))
1159 * return material_b_rho;
1165 * and finally the default is material_a.
1168 * return material_a_rho;
1176 * <a name="step_62-TheParametersclassimplementation"></a>
1177 * <h4>The `Parameters` class implementation</h4>
1181 * The constructor reads all the parameters from the HDF5::Group `data` using
1182 * the HDF5::Group::get_attribute() function.
1185 * template <int dim>
1186 * Parameters<dim>::Parameters(HDF5::Group &data)
1188 * , simulation_name(data.get_attribute<std::string>("simulation_name"))
1189 * , save_vtu_files(data.get_attribute<bool>("save_vtu_files"))
1190 * , start_frequency(data.get_attribute<double>("start_frequency"))
1191 * , stop_frequency(data.get_attribute<double>("stop_frequency"))
1192 * , nb_frequency_points(data.get_attribute<int>("nb_frequency_points"))
1193 * , lambda(data.get_attribute<double>("lambda"))
1194 * , mu(data.get_attribute<double>("mu"))
1195 * , dimension_x(data.get_attribute<double>("dimension_x"))
1196 * , dimension_y(data.get_attribute<double>("dimension_y"))
1197 * , nb_probe_points(data.get_attribute<int>("nb_probe_points"))
1198 * , grid_level(data.get_attribute<int>("grid_level"))
1199 * , probe_start_point(data.get_attribute<double>("probe_pos_x"),
1200 * data.get_attribute<double>("probe_pos_y") -
1201 * data.get_attribute<double>("probe_width_y") / 2)
1202 * , probe_stop_point(data.get_attribute<double>("probe_pos_x"),
1203 * data.get_attribute<double>("probe_pos_y") +
1204 * data.get_attribute<double>("probe_width_y") / 2)
1205 * , right_hand_side(data)
1215 * <a name="step_62-TheQuadratureCacheclassimplementation"></a>
1216 * <h4>The `QuadratureCache` class implementation</h4>
1220 * We need to reserve enough space for the mass and stiffness matrices and the
1221 * right hand side vector.
1224 * template <int dim>
1225 * QuadratureCache<dim>::QuadratureCache(const unsigned int dofs_per_cell)
1226 * : dofs_per_cell(dofs_per_cell)
1227 * , mass_coefficient(dofs_per_cell, dofs_per_cell)
1228 * , stiffness_coefficient(dofs_per_cell, dofs_per_cell)
1229 * , right_hand_side(dofs_per_cell)
1237 * <a name="step_62-ImplementationoftheElasticWaveclass"></a>
1238 * <h3>Implementation of the `ElasticWave` class</h3>
1243 * <a name="step_62-Constructor"></a>
1244 * <h4>Constructor</h4>
1248 * This is very similar to the constructor of @ref step_40 "step-40". In addition we create
1249 * the HDF5 datasets `frequency_dataset`, `position_dataset` and
1250 * `displacement`. Note the use of the `template` keyword for the creation of
1251 * the HDF5 datasets. It is a C++ requirement to use the `template` keyword in
1252 * order to treat `create_dataset` as a dependent template name.
1255 * template <int dim>
1256 * ElasticWave<dim>::ElasticWave(const Parameters<dim> ¶meters)
1257 * : parameters(parameters)
1258 * , mpi_communicator(MPI_COMM_WORLD)
1259 * , triangulation(mpi_communicator,
1260 * typename Triangulation<dim>::MeshSmoothing(
1261 * Triangulation<dim>::smoothing_on_refinement |
1262 * Triangulation<dim>::smoothing_on_coarsening))
1263 * , quadrature_formula(2)
1264 * , fe(FE_Q<dim>(1) ^ dim)
1265 * , dof_handler(triangulation)
1266 * , frequency(parameters.nb_frequency_points)
1267 * , probe_positions(parameters.nb_probe_points, dim)
1268 * , frequency_dataset(parameters.data.template create_dataset<double>(
1270 * std::vector<hsize_t>{parameters.nb_frequency_points}))
1271 * , probe_positions_dataset(parameters.data.template create_dataset<double>(
1273 * std::vector<hsize_t>{parameters.nb_probe_points, dim}))
1275 * parameters.data.template create_dataset<std::complex<double>>(
1277 * std::vector<hsize_t>{parameters.nb_probe_points,
1278 * parameters.nb_frequency_points}))
1279 * , pcout(std::cout,
1280 * (Utilities::MPI::this_mpi_process(mpi_communicator) == 0))
1281 * , computing_timer(mpi_communicator,
1283 * TimerOutput::never,
1284 * TimerOutput::wall_times)
1292 * <a name="step_62-ElasticWavesetup_system"></a>
1293 * <h4>ElasticWave::setup_system</h4>
1297 * There is nothing new in this function, the only difference with @ref step_40 "step-40" is
1302 *
template <
int dim>
1307 *
dof_handler.distribute_dofs(fe);
1309 *
locally_owned_dofs = dof_handler.locally_owned_dofs();
1315 *
mpi_communicator);
1317 *
system_rhs.reinit(locally_owned_dofs, mpi_communicator);
1319 *
constraints.
clear();
1323 *
constraints.close();
1329 *
locally_owned_dofs,
1333 *
system_matrix.reinit(locally_owned_dofs,
1334 *
locally_owned_dofs,
1336 *
mpi_communicator);
1344 * <a name=
"step_62-ElasticWaveassemble_system"></a>
1356 *
template <
int dim>
1366 *
const unsigned int dofs_per_cell = fe.n_dofs_per_cell();
1372 *
std::vector<types::global_dof_index> local_dof_indices(dofs_per_cell);
1380 *
std::vector<double>
rho_values(n_q_points);
1381 *
std::vector<Vector<std::complex<double>>>
pml_values(
1382 *
n_q_points,
Vector<std::complex<double>>(dim));
1401 *
for (
const auto &cell : dof_handler.active_cell_iterators())
1402 *
if (cell->is_locally_owned())
1417 *
fe_values.reinit(cell);
1419 *
parameters.right_hand_side.vector_value_list(
1420 *
fe_values.get_quadrature_points(),
rhs_values);
1421 *
parameters.rho.value_list(fe_values.get_quadrature_points(),
1423 *
parameters.pml.vector_value_list(
1424 *
fe_values.get_quadrature_points(),
pml_values);
1438 *
ExcInternalError());
1440 *
ExcInternalError());
1441 *
for (
unsigned int q = 0;
q < n_q_points; ++
q)
1461 *
std::complex<double>
xi(1, 0);
1476 *
quadrature_data.JxW = fe_values.JxW(
q);
1478 *
for (
unsigned int component = 0; component < dim; ++component)
1487 *
xi *= s[component];
1498 *
for (
unsigned int m = 0; m < dim; ++m)
1499 *
for (
unsigned int n = 0; n < dim; ++n)
1500 *
for (
unsigned int k = 0;
k < dim; ++
k)
1501 *
for (
unsigned int l = 0;
l < dim; ++
l)
1505 *
(2.0 * s[n] * s[
k]);
1508 *
(2.0 * s[n] * s[l]);
1511 *
for (
unsigned int i = 0; i < dofs_per_cell; ++i)
1518 *
for (
unsigned int j = 0;
j < dofs_per_cell; ++
j)
1530 *
quadrature_data.mass_coefficient[i][
j] =
1540 *
for (
unsigned int m = 0; m < dim; ++m)
1541 *
for (
unsigned int n = 0; n < dim; ++n)
1542 *
for (
unsigned int k = 0;
k < dim; ++
k)
1543 *
for (
unsigned int l = 0;
l < dim; ++
l)
1578 *
quadrature_data.stiffness_coefficient[i][
j] =
1588 *
quadrature_data.right_hand_side[i] =
1601 *
for (
unsigned int i = 0; i < dofs_per_cell; ++i)
1603 *
for (
unsigned int j = 0;
j < dofs_per_cell; ++
j)
1606 *
matrix_sum += -Utilities::fixed_power<2>(omega) *
1607 *
quadrature_data.mass_coefficient[i][
j];
1608 *
matrix_sum += quadrature_data.stiffness_coefficient[i][
j];
1611 *
cell_rhs(i) += quadrature_data.right_hand_side[i];
1614 *
cell->get_dof_indices(local_dof_indices);
1615 *
constraints.distribute_local_to_global(cell_matrix,
1617 *
local_dof_indices,
1629 * <a name=
"step_62-ElasticWavesolve"></a>
1630 * <
h4>ElasticWave::solve</
h4>
1642 *
template <
int dim>
1647 *
locally_owned_dofs, mpi_communicator);
1653 *
pcout <<
" Solved in " << solver_control.last_step() <<
" iterations."
1662 * <a name=
"step_62-ElasticWaveinitialize_position_vector"></a>
1670 *
template <
int dim>
1685 *
(
position_idx / ((
double)(parameters.nb_probe_points - 1))) *
1686 *
(parameters.probe_stop_point + (-parameters.probe_start_point)) +
1687 *
parameters.probe_start_point;
1700 * <a name=
"step_62-ElasticWavestore_frequency_step_data"></a>
1708 *
template <
int dim>
1735 *
std::vector<bool> marked_vertices = {};
1736 *
const double tolerance = 1.e-10;
1750 *
cache, point, cell_hint, marked_vertices, tolerance);
1794 * `std::complex<double>`.
1809 *
if (parameters.save_vtu_files)
1812 *
std::vector<DataComponentInterpretation::DataComponentInterpretation>
1817 *
data_out.add_data_vector(dof_handler,
1822 *
for (
unsigned int i = 0; i <
subdomain.size(); ++i)
1824 *
data_out.add_data_vector(
subdomain,
"subdomain");
1826 *
std::vector<Vector<double>>
force(
1828 *
std::vector<Vector<double>>
pml(
1834 *
if (cell->is_locally_owned())
1839 *
parameters.right_hand_side.value(cell->center(),
dim_idx);
1841 *
parameters.pml.value(cell->center(),
dim_idx).
imag();
1843 *
rho(cell->active_cell_index()) =
1844 *
parameters.rho.value(cell->center());
1859 *
pml[
dim_idx](cell->active_cell_index()) = -1e+20;
1861 *
rho(cell->active_cell_index()) = -1
e+20;
1868 *
"force_" + std::to_string(
dim_idx));
1870 *
"pml_" + std::to_string(
dim_idx));
1872 *
data_out.add_data_vector(
rho,
"rho");
1874 *
data_out.build_patches();
1878 *
((
unsigned int)std::log10(parameters.nb_frequency_points)) + 1;
1881 *
const std::string
filename = (parameters.simulation_name +
"_" +
1883 *
data_out.write_vtu_in_parallel(
filename, mpi_communicator);
1892 * <a name=
"step_62-ElasticWaveoutput_results"></a>
1900 *
template <
int dim>
1928 * <a name=
"step_62-ElasticWavesetup_quadrature_cache"></a>
1938 *
template <
int dim>
1944 *
std::vector<QuadratureCache<dim>> tmp;
1952 *
for (
const auto &cell :
triangulation.active_cell_iterators())
1953 *
if (cell->is_locally_owned())
1966 * <a name=
"step_62-ElasticWavefrequency_sweep"></a>
1976 *
template <
int dim>
1983 *
pcout << parameters.simulation_name +
" frequency idx: "
1984 *
<<
frequency_idx <<
'/' << parameters.nb_frequency_points - 1
1992 *
pcout <<
" Number of active cells : "
1994 *
pcout <<
" Number of degrees of freedom : "
1995 *
<< dof_handler.n_dofs() << std::endl;
2005 *
parameters.data.set_attribute(
"active_cells",
2007 *
parameters.data.set_attribute(
"degrees_of_freedom",
2008 *
dof_handler.n_dofs());
2017 *
(parameters.start_frequency +
2019 *
(parameters.stop_frequency - parameters.start_frequency) /
2020 *
(parameters.nb_frequency_points - 1));
2041 *
pcout << std::endl;
2050 * <a name=
"step_62-ElasticWaverun"></a>
2051 * <
h4>ElasticWave::run</
h4>
2058 *
template <
int dim>
2062 *
pcout <<
"Debug mode" << std::endl;
2064 *
pcout <<
"Release mode" << std::endl;
2069 *
p1(0) = -parameters.dimension_x / 2;
2070 *
p1(1) = -parameters.dimension_y / 2;
2073 *
p1(2) = -parameters.dimension_y / 2;
2076 *
p2(0) = parameters.dimension_x / 2;
2077 *
p2(1) = parameters.dimension_y / 2;
2080 *
p2(2) = parameters.dimension_y / 2;
2082 *
std::vector<unsigned int>
divisions(dim);
2083 *
divisions[0] =
int(parameters.dimension_x / parameters.dimension_y);
2112 * <a name=
"step_62-Themainfunction"></a>
2124 *
using namespace dealii;
2125 *
const unsigned int dim = 2;
2141 *
{
"displacement",
"calibration"}};
2166 *
group.set_attribute<
double>(
"dimension_x", 2
e-5);
2167 *
group.set_attribute<
double>(
"dimension_y", 2
e-8);
2168 *
group.set_attribute<
double>(
"probe_pos_x", 8
e-6);
2169 *
group.set_attribute<
double>(
"probe_pos_y", 0);
2170 *
group.set_attribute<
double>(
"probe_width_y", 2
e-08);
2171 *
group.set_attribute<
unsigned int>(
"nb_probe_points", 5);
2172 *
group.set_attribute<
unsigned int>(
"grid_level", 1);
2173 *
group.set_attribute<
double>(
"cavity_resonance_frequency", 20
e9);
2174 *
group.set_attribute<
unsigned int>(
"nb_mirror_pairs", 15);
2176 *
group.set_attribute<
double>(
"poissons_ratio", 0.27);
2177 *
group.set_attribute<
double>(
"youngs_modulus", 270000000000.0);
2178 *
group.set_attribute<
double>(
"material_a_rho", 3200);
2181 *
group.set_attribute<
double>(
"material_b_rho", 2000);
2183 *
group.set_attribute<
double>(
"material_b_rho", 3200);
2185 *
group.set_attribute(
2187 *
group.get_attribute<
double>(
"youngs_modulus") *
2188 *
group.get_attribute<
double>(
"poissons_ratio") /
2189 *
((1 +
group.get_attribute<
double>(
"poissons_ratio")) *
2190 *
(1 - 2 *
group.get_attribute<
double>(
"poissons_ratio"))));
2191 *
group.set_attribute(
"mu",
2192 *
group.get_attribute<
double>(
"youngs_modulus") /
2193 *
(2 * (1 +
group.get_attribute<
double>(
2194 *
"poissons_ratio"))));
2196 *
group.set_attribute<
double>(
"max_force_amplitude", 1
e26);
2197 *
group.set_attribute<
double>(
"force_sigma_x", 1
e-7);
2198 *
group.set_attribute<
double>(
"force_sigma_y", 1);
2199 *
group.set_attribute<
double>(
"max_force_width_x", 3
e-7);
2200 *
group.set_attribute<
double>(
"max_force_width_y", 2
e-8);
2201 *
group.set_attribute<
double>(
"force_x_pos", -8
e-6);
2202 *
group.set_attribute<
double>(
"force_y_pos", 0);
2204 *
group.set_attribute<
bool>(
"pml_x",
true);
2205 *
group.set_attribute<
bool>(
"pml_y",
false);
2206 *
group.set_attribute<
double>(
"pml_width_x", 1.8e-6);
2207 *
group.set_attribute<
double>(
"pml_width_y", 5
e-7);
2208 *
group.set_attribute<
double>(
"pml_coeff", 1.6);
2209 *
group.set_attribute<
unsigned int>(
"pml_coeff_degree", 2);
2211 *
group.set_attribute<
double>(
"center_frequency", 20
e9);
2212 *
group.set_attribute<
double>(
"frequency_range", 0.5e9);
2213 *
group.set_attribute<
double>(
2214 *
"start_frequency",
2215 *
group.get_attribute<
double>(
"center_frequency") -
2216 *
group.get_attribute<
double>(
"frequency_range") / 2);
2217 *
group.set_attribute<
double>(
2219 *
group.get_attribute<
double>(
"center_frequency") +
2220 *
group.get_attribute<
double>(
"frequency_range") / 2);
2221 *
group.set_attribute<
unsigned int>(
"nb_frequency_points", 400);
2224 *
group.set_attribute<std::string>(
"simulation_name",
2225 *
"phononic_cavity_displacement");
2227 *
group.set_attribute<std::string>(
"simulation_name",
2228 *
"phononic_cavity_calibration");
2230 *
group.set_attribute<
bool>(
"save_vtu_files",
false);
2262 *
catch (std::exception &exc)
2264 *
std::cerr << std::endl
2266 *
<<
"----------------------------------------------------"
2268 *
std::cerr <<
"Exception on processing: " << std::endl
2269 *
<< exc.what() << std::endl
2270 *
<<
"Aborting!" << std::endl
2271 *
<<
"----------------------------------------------------"
2278 *
std::cerr << std::endl
2280 *
<<
"----------------------------------------------------"
2282 *
std::cerr <<
"Unknown exception!" << std::endl
2283 *
<<
"Aborting!" << std::endl
2284 *
<<
"----------------------------------------------------"
2305# Gaussian function that we use to fit the resonance
2307 omega = 2 * constants.
pi *
freq
2349plt.
title(
'Phase (transmission coefficient)\n')
2383<
img alt=
"Phononic superlattice cavity" src=
"https://www.dealii.org/images/steps/developer/step-62.05.png" height=
"400" />
2384<
img alt=
"Phononic superlattice cavity" src=
"https://www.dealii.org/images/steps/developer/step-62.06.png" height=
"400" />
2394<
img alt=
"Phononic superlattice cavity" src=
"https://www.dealii.org/images/steps/developer/step-62.07.png" height=
"400" />
2409<
img alt=
"Phononic superlattice cavity" src=
"https://www.dealii.org/images/steps/developer/step-62.08.png" height=
"400" />
2416<
img alt=
"Phononic superlattice cavity" src=
"https://www.dealii.org/images/steps/developer/step-62.09.png" height=
"400" />
2432<a name=
"step_62-Possibilitiesforextensions"></a><
h3>Possibilities
for extensions</
h3>
2443import matplotlib.pyplot as plt
2445import scipy.constants as constants
2446import scipy.optimize
2448# This considerably reduces the size of the svg data
2449plt.rcParams['svg.fonttype'] = 'none'
2451h5_file = h5py.File('results.h5', 'w')
2452data = h5_file.create_group('data')
2453displacement = data.create_group('displacement')
2454calibration = data.create_group('calibration')
2457for group in [displacement, calibration]:
2458 # Dimensions of the domain
2459 # The waveguide length is equal to dimension_x
2460 group.attrs['dimension_x'] = 2e-5
2461 # The waveguide width is equal to dimension_y
2462 group.attrs['dimension_y'] = 2e-8
2464 # Position of the probe that we use to measure the flux
2465 group.attrs['probe_pos_x'] = 8e-6
2466 group.attrs['probe_pos_y'] = 0
2467 group.attrs['probe_width_y'] = 2e-08
2469 # Number of points in the probe
2470 group.attrs['nb_probe_points'] = 5
2473 group.attrs['grid_level'] = 1
2476 group.attrs['cavity_resonance_frequency'] = 20e9
2477 group.attrs['nb_mirror_pairs'] = 15
2480 group.attrs['poissons_ratio'] = 0.27
2481 group.attrs['youngs_modulus'] = 270000000000.0
2482 group.attrs['material_a_rho'] = 3200
2483 if group == displacement:
2484 group.attrs['material_b_rho'] = 2000
2486 group.attrs['material_b_rho'] = 3200
2487 group.attrs['lambda'] = (group.attrs['youngs_modulus'] * group.attrs['poissons_ratio'] /
2488 ((1 + group.attrs['poissons_ratio']) *
2489 (1 - 2 * group.attrs['poissons_ratio'])))
2490 group.attrs['mu']= (group.attrs['youngs_modulus'] / (2 * (1 + group.attrs['poissons_ratio'])))
2493 group.attrs['max_force_amplitude'] = 1e26
2494 group.attrs['force_sigma_x'] = 1e-7
2495 group.attrs['force_sigma_y'] = 1
2496 group.attrs['max_force_width_x'] = 3e-7
2497 group.attrs['max_force_width_y'] = 2e-8
2498 group.attrs['force_x_pos'] = -8e-6
2499 group.attrs['force_y_pos'] = 0
2502 group.attrs['pml_x'] = True
2503 group.attrs['pml_y'] = False
2504 group.attrs['pml_width_x'] = 1.8e-6
2505 group.attrs['pml_width_y'] = 5e-7
2506 group.attrs['pml_coeff'] = 1.6
2507 group.attrs['pml_coeff_degree'] = 2
2510 group.attrs['center_frequency'] = 20e9
2511 group.attrs['frequency_range'] = 0.5e9
2512 group.attrs['start_frequency'] = group.attrs['center_frequency'] - group.attrs['frequency_range'] / 2
2513 group.attrs['stop_frequency'] = group.attrs['center_frequency'] + group.attrs['frequency_range'] / 2
2514 group.attrs['nb_frequency_points'] = 400
2517 if group == displacement:
2518 group.attrs['simulation_name'] = 'phononic_cavity_displacement'
2520 group.attrs['simulation_name'] = 'phononic_cavity_calibration'
2521 group.attrs['save_vtu_files'] = False
2526In order to read the HDF5 parameters we have to use the
2527HDF5::File::FileAccessMode::open flag.
2529 HDF5::File data_file("results.h5",
2536<a name=
"step_62-PlainProg"></a>
void write(const Container &data)
void write_selection(const Container &data, const std::vector< hsize_t > &coordinates)
#define Assert(cond, exc)
void loop(IteratorType begin, std_cxx20::type_identity_t< IteratorType > end, DOFINFO &dinfo, INFOBOX &info, const std::function< void(std_cxx20::type_identity_t< DOFINFO > &, typename INFOBOX::CellInfo &)> &cell_worker, const std::function< void(std_cxx20::type_identity_t< DOFINFO > &, typename INFOBOX::CellInfo &)> &boundary_worker, const std::function< void(std_cxx20::type_identity_t< DOFINFO > &, std_cxx20::type_identity_t< DOFINFO > &, typename INFOBOX::CellInfo &, typename INFOBOX::CellInfo &)> &face_worker, AssemblerType &assembler, const LoopControl &lctrl=LoopControl())
void make_hanging_node_constraints(const DoFHandler< dim, spacedim > &dof_handler, AffineConstraints< number > &constraints)
void make_sparsity_pattern(const DoFHandler< dim, spacedim > &dof_handler, SparsityPatternBase &sparsity_pattern, const AffineConstraints< number > &constraints={}, const bool keep_constrained_dofs=true, const types::subdomain_id subdomain_id=numbers::invalid_subdomain_id)
@ update_values
Shape function values.
@ update_JxW_values
Transformed quadrature weights.
@ update_gradients
Shape function gradients.
@ update_quadrature_points
Transformed quadrature points.
const Mapping< dim, spacedim > & get_default_linear_mapping(const Triangulation< dim, spacedim > &triangulation)
std::vector< index_type > data
@ component_is_part_of_vector
void subdivided_hyper_rectangle(Triangulation< dim, spacedim > &tria, const std::vector< unsigned int > &repetitions, const Point< dim > &p1, const Point< dim > &p2, const bool colorize=false)
@ valid
Iterator points to a valid object.
@ matrix
Contents is actually a matrix.
@ symmetric
Matrix is symmetric.
constexpr types::blas_int one
void cell_matrix(FullMatrix< double > &M, const FEValuesBase< dim > &fe, const FEValuesBase< dim > &fetest, const ArrayView< const std::vector< double > > &velocity, const double factor=1.)
Point< spacedim > point(const gp_Pnt &p, const double tolerance=1e-10)
SymmetricTensor< 2, dim, Number > C(const Tensor< 2, dim, Number > &F)
SymmetricTensor< 2, dim, Number > e(const Tensor< 2, dim, Number > &F)
Tensor< 2, dim, Number > l(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
Number angle(const Tensor< 1, spacedim, Number > &a, const Tensor< 1, spacedim, Number > &b)
void apply(const Kokkos::TeamPolicy< MemorySpace::Default::kokkos_space::execution_space >::member_type &team_member, const Kokkos::View< Number *, MemorySpace::Default::kokkos_space > shape_data, const ViewTypeIn in, ViewTypeOut out)
unsigned int this_mpi_process(const MPI_Comm mpi_communicator)
void run(const Iterator &begin, const std_cxx20::type_identity_t< Iterator > &end, Worker worker, Copier copier, const ScratchData &sample_scratch_data, const CopyData &sample_copy_data, const unsigned int queue_length, const unsigned int chunk_size)
long double gamma(const unsigned int n)
int(&) functions(const void *v1, const void *v2)
void assemble(const MeshWorker::DoFInfoBox< dim, DOFINFO > &dinfo, A *assembler)
::VectorizedArray< Number, width > abs(const ::VectorizedArray< Number, width > &)
const ::parallel::distributed::Triangulation< dim, spacedim > * triangulation