1D and 2D photonic crystals for thermo-photovoltaic converters and electro-optic modulators