AQUAgpusph 4.1.2
Loading...
Searching...
No Matches
ASCII.h
Go to the documentation of this file.
1/*
2 * This file is part of AQUAgpusph, a free CFD program based on SPH.
3 * Copyright (C) 2012 Jose Luis Cercos Pita <jl.cercos@upm.es>
4 *
5 * AQUAgpusph is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * AQUAgpusph is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with AQUAgpusph. If not, see <http://www.gnu.org/licenses/>.
17 */
18
25#ifndef ASCII_H_INCLUDED
26#define ASCII_H_INCLUDED
27
28#include <sphPrerequisites.h>
30
31namespace Aqua {
32namespace InputOutput {
33
58class ASCII : public Particles
59{
60 public:
69 ASCII(ProblemSetup& sim_data,
70 unsigned int iset,
71 unsigned int offset,
72 unsigned int n = 0);
73
75 virtual ~ASCII();
76
81 void save(float t);
82
85 void load();
86
87 private:
91 const unsigned int compute_n();
92
97 unsigned int readNParticles(std::ifstream& f);
98
102 void formatLine(std::string& l);
103
110 unsigned int readNFields(std::string l);
111
119 virtual std::string readField(const std::string field,
120 const std::string line,
121 unsigned int index,
122 void* data);
123
128 void create(std::ofstream& f);
129
131 unsigned int _next_file_index;
132}; // class InputOutput
133
134}
135} // namespaces
136
137#endif // ASCII_H_INCLUDED
Particles files manager. (See Aqua::InputOutput::Particles for details)
Plain text particles data files loader/saver.
Definition: ASCII.h:59
void load()
Load the data.
Definition: ASCII.cpp:55
void save(float t)
Save the data.
Definition: ASCII.cpp:219
virtual ~ASCII()
Destructor.
Definition: ASCII.cpp:52
Particles file loader/saver base class.
Definition: Particles.h:52
unsigned int n()
Get the number of particles managed by this instance.
Definition: Particles.h:78
Simulation configuration data.
Definition: ProblemSetup.h:91
Main AQUAgpusph namespace.
Definition: ArgumentsManager.cpp:45
Set of definitions and macros related with the implementation.