Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
PostProcessorWriterBase.cc
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* PostProcessorWriterBase.cc (C) 2000-2026 */
9/* */
10/* Base class for a writer for post-processing information. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arcane/utils/Array.h"
15#include "arcane/utils/Collection.h"
16#include "arcane/utils/String.h"
17#include "arcane/utils/List.h"
18
20#include "arcane/core/PostProcessorWriterBase.h"
21#include "arcane/core/ISubDomain.h"
22#include "arcane/core/ItemGroup.h"
23#include "arcane/core/VariableCollection.h"
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
28namespace Arcane
29{
30
31/*---------------------------------------------------------------------------*/
32/*---------------------------------------------------------------------------*/
33
34class PostProcessorWriterBasePrivate
35{
36 public:
37
38 PostProcessorWriterBasePrivate();
39
40 public:
41
42 String m_base_dirname;
43 String m_base_filename;
44 VariableCollection m_variables;
45 ItemGroupList m_groups;
46 SharedArray<Real> m_times;
47};
48
49/*---------------------------------------------------------------------------*/
50/*---------------------------------------------------------------------------*/
51
52PostProcessorWriterBasePrivate::
53PostProcessorWriterBasePrivate()
54: m_base_dirname(".")
55{
56}
57
58/*---------------------------------------------------------------------------*/
59/*---------------------------------------------------------------------------*/
60
61/*---------------------------------------------------------------------------*/
62/*---------------------------------------------------------------------------*/
63
64PostProcessorWriterCommonBase::
65PostProcessorWriterCommonBase()
66: m_p(new PostProcessorWriterBasePrivate())
67{
68}
69
70/*---------------------------------------------------------------------------*/
71/*---------------------------------------------------------------------------*/
72
73PostProcessorWriterCommonBase::
74~PostProcessorWriterCommonBase()
75{
76 delete m_p;
77}
78
79/*---------------------------------------------------------------------------*/
80/*---------------------------------------------------------------------------*/
81
82/*---------------------------------------------------------------------------*/
83/*---------------------------------------------------------------------------*/
84
85PostProcessorWriterBase::
86PostProcessorWriterBase(const ServiceBuildInfo& sbi)
87: BasicService(sbi)
88{
89}
90
91/*---------------------------------------------------------------------------*/
92/*---------------------------------------------------------------------------*/
93
95setBaseDirectoryName(const String& dirname)
96{
97 m_p->m_base_dirname = dirname;
98}
99
100/*---------------------------------------------------------------------------*/
101/*---------------------------------------------------------------------------*/
102
105{
106 return m_p->m_base_dirname;
107}
108
109/*---------------------------------------------------------------------------*/
110/*---------------------------------------------------------------------------*/
111
113setBaseFileName(const String& filename)
114{
115 m_p->m_base_filename = filename;
116}
117
118/*---------------------------------------------------------------------------*/
119/*---------------------------------------------------------------------------*/
120
123{
124 return m_p->m_base_filename;
125}
126
127/*---------------------------------------------------------------------------*/
128/*---------------------------------------------------------------------------*/
129
135
136/*---------------------------------------------------------------------------*/
137/*---------------------------------------------------------------------------*/
138
144
145/*---------------------------------------------------------------------------*/
146/*---------------------------------------------------------------------------*/
147
150{
151 m_p->m_groups.clone(groups);
152}
153
154/*---------------------------------------------------------------------------*/
155/*---------------------------------------------------------------------------*/
156
158times()
159{
160 return m_p->m_times;
161}
162
163/*---------------------------------------------------------------------------*/
164/*---------------------------------------------------------------------------*/
165
167variables()
168{
169 return m_p->m_variables;
170}
171
172/*---------------------------------------------------------------------------*/
173/*---------------------------------------------------------------------------*/
174
176groups()
177{
178 return m_p->m_groups;
179}
180
181/*---------------------------------------------------------------------------*/
182/*---------------------------------------------------------------------------*/
183
184/*---------------------------------------------------------------------------*/
185/*---------------------------------------------------------------------------*/
186
192
193/*---------------------------------------------------------------------------*/
194/*---------------------------------------------------------------------------*/
195
201
202/*---------------------------------------------------------------------------*/
203/*---------------------------------------------------------------------------*/
204
205} // namespace Arcane
206
207/*---------------------------------------------------------------------------*/
208/*---------------------------------------------------------------------------*/
Declarations of Arcane's general types.
Base class of a service linked to a subdomain.
Constant view of an array of type T.
virtual const String & baseFileName()=0
Name of the file containing the outputs.
virtual String getBaseFileName()
Name of the file containing the outputs.
virtual const String & baseDirectoryName()=0
Name of the output directory for files.
virtual String getBaseDirectoryName()
Name of the output directory for files.
ItemGroupCollection groups() override
List of groups to save.
VariableCollection variables() override
List of variables to save.
ConstArrayView< Real > times() override
List of saved times.
const String & baseDirectoryName() override
Name of the output directory for files.
void setTimes(ConstArrayView< Real > times) override
Positions the list of times.
const String & baseFileName() override
Name of the file containing the outputs.
void setBaseDirectoryName(const String &dirname) override
Positions the output directory name for files.
void setGroups(ItemGroupCollection groups) override
Positions the list of groups to output.
void setVariables(VariableCollection variables) override
Positions the list of variables to output.
void setBaseFileName(const String &filename) override
Positions the name of the file containing the outputs.
Structure containing the information to create a service.
1D vector of data with reference semantics.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Collection< ItemGroup > ItemGroupCollection
Collection of mesh item groups.
List< ItemGroup > ItemGroupList
Array of mesh item groups.
ConstArrayView< Real > RealConstArrayView
C equivalent of a 1D array of reals.
Definition UtilsTypes.h:488