<commit_before>//
//  CellDataTransfer::push_back.cpp
//  NSolver
//
//  Created by 乔磊 on 15/10/13.
//  Copyright (c) 2015年 乔磊. All rights reserved.
//

#include <NSolver/CellDataTransfer.h>

namespace NSFEMSolver
{

  template<int dim, typename Number>
  template <typename ValueType>
  unsigned int
  CellDataTransfer<dim, Number>::push_back (ValueType *const data_src,
                                            const size_type  size)
  {
    Assert (size <= tria.n_active_cells(),
            ExcMessage ("Not enough data."));

    const size_type new_position = vector_data_ptr.size();
    const size_type active_size = std::min (size, tria.n_active_cells());
    // Allocate 30% more memory for future using.
    vector_data_ptr.push_back (std::vector<Number> (active_size * 1.3));
    std::copy (data_src, data_src+active_size, vector_data_ptr[new_position].begin());

    return (new_position);
  }

// Explicit instantiation
  template
  unsigned int
  CellDataTransfer<2, double>::push_back<double> (double *const   data_src,
                                                  const size_type size);
  template
  unsigned int
  CellDataTransfer<2, double>::push_back<float> (float *const    data_src,
                                                 const size_type size);
  template
  unsigned int
  CellDataTransfer<3, double>::push_back<double> (double *const   data_src,
                                                  const size_type size);
  template
  unsigned int
  CellDataTransfer<3, double>::push_back<float> (float *const    data_src,
                                                 const size_type size);
#include "CellDataTransfer.inst"
}<commit_msg>bugfix: wrong Assert<commit_after>//
//  CellDataTransfer::push_back.cpp
//  NSolver
//
//  Created by 乔磊 on 15/10/13.
//  Copyright (c) 2015年 乔磊. All rights reserved.
//

#include <NSolver/CellDataTransfer.h>

namespace NSFEMSolver
{

  template<int dim, typename Number>
  template <typename ValueType>
  unsigned int
  CellDataTransfer<dim, Number>::push_back (ValueType *const data_src,
                                            const size_type  size)
  {
    Assert (size >= tria.n_active_cells(), ExcMessage ("Not enough data."));

    const size_type new_position = vector_data_ptr.size();
    const size_type active_size = std::min (size, tria.n_active_cells());
    // Allocate 30% more memory for future using.
    vector_data_ptr.push_back (std::vector<Number> (active_size * 1.3));
    std::copy (data_src, data_src+active_size, vector_data_ptr[new_position].begin());

    return (new_position);
  }

// Explicit instantiation
  template
  unsigned int
  CellDataTransfer<2, double>::push_back<double> (double *const   data_src,
                                                  const size_type size);
  template
  unsigned int
  CellDataTransfer<2, double>::push_back<float> (float *const    data_src,
                                                 const size_type size);
  template
  unsigned int
  CellDataTransfer<3, double>::push_back<double> (double *const   data_src,
                                                  const size_type size);
  template
  unsigned int
  CellDataTransfer<3, double>::push_back<float> (float *const    data_src,
                                                 const size_type size);
#include "CellDataTransfer.inst"
}
{'fraction_non_alphanumeric': 0.09883547327560466, 'fraction_numerical': 0.010749477455957002, 'mean_word_length': 2.3333333333333335, 'pattern_counts': {'":': 0, '<': 30, '<?xml version=': 0, '>': 30, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 20, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6703675', 'n_tokens_mistral': 983, 'n_tokens_neox': 943, 'n_words': 238}