<commit_before>//-----------------------------------------------------------
//
//    Copyright (C) 2015 by the deal2lkit authors
//
//    This file is part of the deal2lkit library.
//
//    The deal2lkit library is free software; you can use it, redistribute
//    it, and/or modify it under the terms of the GNU Lesser General
//    Public License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//    The full text of the license can be found in the file LICENSE at
//    the top level of the deal2lkit distribution.
//
//-----------------------------------------------------------

#include <deal.II/base/config.h>
#include <deal2lkit/parsed_grid_generator.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/grid_in.h>
#include <deal.II/grid/grid_out.h>

#include <fstream>


D2K_NAMESPACE_OPEN

std::string extension(const std::string &filename)
{
  std::string::size_type idx;
  idx = filename.rfind('.');
  if (idx != std::string::npos)
    {
      return filename.substr(idx+1);
    }
  else
    {
      return "";
    }
}


template <int dim, int spacedim>
ParsedGridGenerator<dim, spacedim>::ParsedGridGenerator(const std::string _section_name,
                                                        const std::string _grid_type,
                                                        const std::string _input_grid_file,
                                                        const std::string _point_1,
                                                        const std::string _point_2,
                                                        const std::string _bool,
                                                        const std::string _double_1,
                                                        const std::string _double_2,
                                                        const std::string _int,
                                                        const std::string _vec_of_int,
                                                        const std::string _mesh_smoothing,
                                                        const std::string _output_grid_file)
  :
  ParameterAcceptor(_section_name),
  mesh_smoothing(_mesh_smoothing),
  grid_name(_grid_type),
  input_grid_file_name(_input_grid_file),
  output_grid_file_name(_output_grid_file),
  str_point_1(_point_1),
  str_point_2(_point_2),
  str_un_int(_int),
  str_double_1(_double_1),
  str_double_2(_double_2),
  str_bool(_bool),
  str_vec_int(_vec_of_int)
{}

template <int dim, int spacedim>
std::string ParsedGridGenerator<dim, spacedim>::create_default_value(const Point<spacedim> &input)
{
  std::ostringstream strs;
  strs << input[0];
  for (unsigned int i=1; i<spacedim; ++i)
    strs<< ","<< input[i];
  std::string def = strs.str();
  return def;

}<commit_msg>silenced warnings<commit_after>//-----------------------------------------------------------
//
//    Copyright (C) 2015 by the deal2lkit authors
//
//    This file is part of the deal2lkit library.
//
//    The deal2lkit library is free software; you can use it, redistribute
//    it, and/or modify it under the terms of the GNU Lesser General
//    Public License as published by the Free Software Foundation; either
//    version 2.1 of the License, or (at your option) any later version.
//    The full text of the license can be found in the file LICENSE at
//    the top level of the deal2lkit distribution.
//
//-----------------------------------------------------------

#include <deal.II/base/config.h>
#include <deal2lkit/parsed_grid_generator.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/grid_in.h>
#include <deal.II/grid/grid_out.h>

#include <fstream>


D2K_NAMESPACE_OPEN

std::string extension(const std::string &filename)
{
  std::string::size_type idx;
  idx = filename.rfind('.');
  if (idx != std::string::npos)
    {
      return filename.substr(idx+1);
    }
  else
    {
      return "";
    }
}


template <int dim, int spacedim>
ParsedGridGenerator<dim, spacedim>::ParsedGridGenerator(const std::string _section_name,
                                                        const std::string _grid_type,
                                                        const std::string _input_grid_file,
                                                        const std::string _point_1,
                                                        const std::string _point_2,
                                                        const std::string _bool,
                                                        const std::string _double_1,
                                                        const std::string _double_2,
                                                        const std::string _int,
                                                        const std::string _vec_of_int,
                                                        const std::string _mesh_smoothing,
                                                        const std::string _output_grid_file)
  :
  ParameterAcceptor(_section_name),
  mesh_smoothing(_mesh_smoothing),
  grid_name(_grid_type),
  input_grid_file_name(_input_grid_file),
  output_grid_file_name(_output_grid_file),
  str_point_1(_point_1),
  str_point_2(_point_2),
  str_bool(_bool),
  str_double_1(_double_1),
  str_double_2(_double_2),
  str_un_int(_int),
  str_vec_int(_vec_of_int)
{}

template <int dim, int spacedim>
std::string ParsedGridGenerator<dim, spacedim>::create_default_value(const Point<spacedim> &input)
{
  std::ostringstream strs;
  strs << input[0];
  for (unsigned int i=1; i<spacedim; ++i)
    strs<< ","<< input[i];
  std::string def = strs.str();
  return def;

}
{'fraction_non_alphanumeric': 0.13066202090592335, 'fraction_numerical': 0.009407665505226481, 'mean_word_length': 1.5675313059033988, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 44, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6321613', 'n_tokens_mistral': 1529, 'n_tokens_neox': 1495, 'n_words': 383}