votca
2024.2-dev
Loading...
Searching...
No Matches
csg
src
libcsg
modules
io
xyzwriter.cc
Go to the documentation of this file.
1
/*
2
* Copyright 2009-2020 The VOTCA Development Team (http://www.votca.org)
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*
16
*/
17
18
#include "
../../../../include/votca/csg/xyzwriter.h
"
19
#include <cstdio>
20
#include <string>
21
namespace
votca
{
22
namespace
csg {
23
24
void
XYZWriter::Open
(std::string file,
bool
bAppend) {
25
if
(bAppend) {
26
out_
.open(file, std::ios_base::app);
27
}
else
{
28
out_
.open(file);
29
}
30
}
31
32
void
XYZWriter::Close
() {
out_
.close(); }
33
34
void
XYZWriter::Write
(
Topology
*conf) {
35
std::string header = (boost::format(
"frame: %1$d time: %2$f\n"
) %
36
(conf->
getStep
() + 1) % conf->
getTime
())
37
.str();
38
Write<Topology>
(*conf, header);
39
}
40
}
// namespace csg
41
}
// namespace votca
votca::csg::Topology
topology of the whole system
Definition
topology.h:81
votca::csg::Topology::getTime
double getTime() const
Definition
topology.h:317
votca::csg::Topology::getStep
Index getStep() const
Definition
topology.h:329
votca::csg::XYZWriter::Close
void Close() override
Definition
xyzwriter.cc:32
votca::csg::XYZWriter::Open
void Open(std::string file, bool bAppend=false) override
Definition
xyzwriter.cc:24
votca::csg::XYZWriter::out_
std::ofstream out_
Definition
xyzwriter.h:76
votca::csg::XYZWriter::Write
void Write(Topology *conf) override
Definition
xyzwriter.cc:34
votca
base class for all analysis tools
Definition
basebead.h:33
xyzwriter.h
Generated by
1.12.0