<commit_before>/*
 * test_plane_sw_normal_mode.cpp
 *
 *  Created on: 14 Nov 2019
 *      Author: <NAME> <<EMAIL>>
 */



#if !SWEET_USE_PLANE_SPECTRAL_SPACE
	#error "Spectral space not activated"
#endif

#if SWEET_GUI
#	error	"GUI not supported"
#endif


#include <sweet/plane/PlaneData.hpp>
#include <sweet/SimulationVariables.hpp>
#include <sweet/plane/PlaneOperators.hpp>
#include "test_plane_sw_normal_modes/SWE_Plane_Normal_Modes.hpp"

#include <ostream>
#include <cmath>


PlaneDataConfig planeDataConfigInstance;
PlaneDataConfig *planeDataConfig = &planeDataConfigInstance;

SimulationVariables simVars;

int main(
		int i_argc,
		char *i_argv[]
)
{
	// override flag
	SimulationVariables simVars;

	if (!simVars.setupFromMainParameters(i_argc, i_argv))
		return -1;

	planeDataConfigInstance.setupAuto(simVars.disc.space_res_physical, simVars.disc.space_res_spectral, simVars.misc.reuse_spectral_transformation_plans);

	std::cout << "*************************************************************" << std::endl;
	std::cout << "Testing normal mode conversion tool" << std::endl;
	std::cout << "*************************************************************" << std::endl;
	//std::size_t res[2] = {res_x, res_y};

	//std::size_t test_max_freqx = planeDataConfig->spectral_real_modes[0];
	//std::size_t test_max_freqy = planeDataConfig->spectral_real_modes[1];

	std::cout << "*************************************************************" << std::endl;
	planeDataConfig->printInformation();
	std::cout << "*************************************************************" << std::endl;
	std::cout << std::endl;

	PlaneData h(planeDataConfig);
	PlaneData u(planeDataConfig);
	PlaneData v(planeDataConfig);

	// Spectral mode to be converted (x,y) respectively
	std::size_t k0, k1;

	double igwest_mode=1.0;
	double igeast_mode=0.0;
	double geo_mode=0.0;

	//Normal modes to be generated
	
	//std::size_t max_modes_x = planeDataConfig->spectral_real_modes[0];
	//std::size_t max_modes_y = planeDataConfig->spectral_real_modes[1];
	k0=5;
	k1=3;
	h.spectral_set_zero();
	u.spectral_set_zero();
	v.spectral_set_zero();
	//std::cout<< "out:" << h.planeDataConfig->spectral_data_size[1] << std::endl;

	SWE_Plane_Normal_Modes::add_normal_mode(
								k0, k1,
								igwest_mode,
								igeast_mode,
								geo_mode,
								h,
								u,
								v,
								simVars
						);<commit_msg>not a pedro bug on plane_data spectral get/set!<commit_after>/*
 * test_plane_sw_normal_mode.cpp
 *
 *  Created on: 14 Nov 2019
 *      Author: <NAME> <<EMAIL>>
 */



#if !SWEET_USE_PLANE_SPECTRAL_SPACE
	#error "Spectral space not activated"
#endif

#if SWEET_GUI
#	error	"GUI not supported"
#endif


#include <sweet/plane/PlaneData.hpp>
#include <sweet/SimulationVariables.hpp>
#include <sweet/plane/PlaneOperators.hpp>
#include "test_plane_sw_normal_modes/SWE_Plane_Normal_Modes.hpp"

#include <ostream>
#include <cmath>


PlaneDataConfig planeDataConfigInstance;
PlaneDataConfig *planeDataConfig = &planeDataConfigInstance;

SimulationVariables simVars;

int main(
		int i_argc,
		char *i_argv[]
)
{
	// override flag
	SimulationVariables simVars;

	if (!simVars.setupFromMainParameters(i_argc, i_argv))
		return -1;

	planeDataConfigInstance.setupAuto(simVars.disc.space_res_physical, simVars.disc.space_res_spectral, simVars.misc.reuse_spectral_transformation_plans);

	std::cout << "*************************************************************" << std::endl;
	std::cout << "Testing normal mode conversion tool" << std::endl;
	std::cout << "*************************************************************" << std::endl;
	//std::size_t res[2] = {res_x, res_y};

	//std::size_t test_max_freqx = planeDataConfig->spectral_real_modes[0];
	//std::size_t test_max_freqy = planeDataConfig->spectral_real_modes[1];

	std::cout << "*************************************************************" << std::endl;
	planeDataConfig->printInformation();
	std::cout << "*************************************************************" << std::endl;
	std::cout << std::endl;

	PlaneData h(planeDataConfig);
	PlaneData u(planeDataConfig);
	PlaneData v(planeDataConfig);

	// Spectral mode to be converted (x,y) respectively
	std::size_t k0, k1;

	double igwest_mode=1.0;
	double igeast_mode=0.0;
	double geo_mode=0.0;

	//Normal modes to be generated
	
	//std::size_t max_modes_x = planeDataConfig->spectral_real_modes[0];
	//std::size_t max_modes_y = planeDataConfig->spectral_real_modes[1];
	k0=2;
	k1=3;
	h.spectral_set_zero();
	u.spectral_set_zero();
	v.spectral_set_zero();
	//std::cout<< "out:" << h.planeDataConfig->spectral_data_size[1] << std::endl;

	SWE_Plane_Normal_Modes::add_normal_mode(
								k0, k1,
								igwest_mode,
								igeast_mode,
								geo_mode,
								h,
								u,
								v,
								simVars
						);
{'fraction_non_alphanumeric': 0.22398001665278935, 'fraction_numerical': 0.011240632805995004, 'mean_word_length': 5.3981358189081226, 'pattern_counts': {'":': 0, '<': 75, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2265003', 'n_tokens_mistral': 1860, 'n_tokens_neox': 1665, 'n_words': 291}